NCTCMumbai
commited on
Commit
•
5186af2
1
Parent(s):
7403c09
Update backend/query_llm.py
Browse files- backend/query_llm.py +6 -3
backend/query_llm.py
CHANGED
@@ -52,13 +52,16 @@ def format_prompt(message: str, api_kind: str):
|
|
52 |
"""
|
53 |
|
54 |
# Create a list of message dictionaries with role and content
|
55 |
-
|
|
|
56 |
|
57 |
if api_kind == "openai":
|
58 |
-
return
|
59 |
elif api_kind == "hf":
|
60 |
return tokenizer.apply_chat_template(messages, tokenize=False)
|
61 |
-
elif api_kind:
|
|
|
|
|
62 |
raise ValueError("API is not supported")
|
63 |
|
64 |
|
|
|
52 |
"""
|
53 |
|
54 |
# Create a list of message dictionaries with role and content
|
55 |
+
messages1: List[Dict[str, Any]] = [{'role': 'user', 'content': message}]
|
56 |
+
messages2: List[Dict[str, Any]] = [{'role': 'user', 'content': message}]
|
57 |
|
58 |
if api_kind == "openai":
|
59 |
+
return messages1
|
60 |
elif api_kind == "hf":
|
61 |
return tokenizer.apply_chat_template(messages, tokenize=False)
|
62 |
+
elif api_kind=="gemini":
|
63 |
+
return messages2
|
64 |
+
else:
|
65 |
raise ValueError("API is not supported")
|
66 |
|
67 |
|