Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ox696c
ktransformers
Commits
cb266c98
Commit
cb266c98
authored
Apr 16, 2025
by
Creeper-MZ
Browse files
Fix a bug
parent
6bc2e853
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
ktransformers/server/api/openai/endpoints/chat.py
ktransformers/server/api/openai/endpoints/chat.py
+1
-1
No files found.
ktransformers/server/api/openai/endpoints/chat.py
View file @
cb266c98
...
...
@@ -154,7 +154,7 @@ async def chat_completion(request: Request, create: ChatCompletionCreate):
tools_description
+=
f
"Function:
{
tool
.
function
.
name
}
\n
Description:
{
tool
.
function
.
description
}
\n
Parameters:
{
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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment