"git@developer.sourcefind.cn:OpenDAS/ollama.git" did not exist on "592d21e7dbffff5bd4c285503a44d87ffaa6fd1b"
Commit cb266c98 authored by Creeper-MZ's avatar Creeper-MZ
Browse files

Fix a bug

parent 6bc2e853
...@@ -154,7 +154,7 @@ async def chat_completion(request: Request, create: ChatCompletionCreate): ...@@ -154,7 +154,7 @@ async def chat_completion(request: Request, create: ChatCompletionCreate):
tools_description += f"Function: {tool.function.name}\nDescription: {tool.function.description}\nParameters: {tool.function.parameters}\n\n" tools_description += f"Function: {tool.function.name}\nDescription: {tool.function.description}\nParameters: {tool.function.parameters}\n\n"
# If first message is system, add concise tool instructions # If first message is system, add concise tool instructions
if enhanced_messages[0].role == Role.system: if enhanced_messages[0].role == Role.system or enhanced_messages[0].role == Role.user:
if "function calls" not in enhanced_messages[0].content.lower(): if "function calls" not in enhanced_messages[0].content.lower():
enhanced_messages[0].content += "\n\n" + get_tool_instructions() enhanced_messages[0].content += "\n\n" + get_tool_instructions()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment