mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2025-09-09 13:55:27 +00:00
Fix a bug
This commit is contained in:
parent
6bc2e85343
commit
cb266c98d4
1 changed files with 1 additions and 1 deletions
|
@ -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"
|
||||
|
||||
# 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():
|
||||
enhanced_messages[0].content += "\n\n" + get_tool_instructions()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue