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
OpenDAS
ktransformers
Commits
a1162eea
Unverified
Commit
a1162eea
authored
Apr 19, 2025
by
wang jiahao
Committed by
GitHub
Apr 19, 2025
Browse files
Merge pull request #1158 from Creeper-MZ/function_call
Update Function call
parents
34c19940
133ba746
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
119 additions
and
116 deletions
+119
-116
ktransformers/server/api/openai/endpoints/chat.py
ktransformers/server/api/openai/endpoints/chat.py
+117
-114
ktransformers/server/schemas/endpoints/chat.py
ktransformers/server/schemas/endpoints/chat.py
+2
-2
No files found.
ktransformers/server/api/openai/endpoints/chat.py
View file @
a1162eea
This diff is collapsed.
Click to expand it.
ktransformers/server/schemas/endpoints/chat.py
View file @
a1162eea
...
@@ -24,7 +24,7 @@ class Message(BaseModel):
...
@@ -24,7 +24,7 @@ class Message(BaseModel):
content
:
Optional
[
str
]
=
None
content
:
Optional
[
str
]
=
None
role
:
Role
role
:
Role
name
:
Optional
[
str
]
=
None
name
:
Optional
[
str
]
=
None
tool_calls
:
Optional
[
List
[
Dict
[
str
,
Any
]]]
=
None
tool_calls
:
Optional
[
List
[
Dict
[
str
,
Any
]]]
=
{}
tool_call_id
:
Optional
[
str
]
=
None
tool_call_id
:
Optional
[
str
]
=
None
def
to_tokenizer_message
(
self
):
def
to_tokenizer_message
(
self
):
...
@@ -33,7 +33,7 @@ class Message(BaseModel):
...
@@ -33,7 +33,7 @@ class Message(BaseModel):
message
[
'content'
]
=
self
.
content
message
[
'content'
]
=
self
.
content
if
self
.
name
is
not
None
:
if
self
.
name
is
not
None
:
message
[
'name'
]
=
self
.
name
message
[
'name'
]
=
self
.
name
if
self
.
tool_calls
is
not
None
:
if
self
.
tool_calls
is
not
{}
:
message
[
'tool_calls'
]
=
self
.
tool_calls
message
[
'tool_calls'
]
=
self
.
tool_calls
if
self
.
tool_call_id
is
not
None
:
if
self
.
tool_call_id
is
not
None
:
message
[
'tool_call_id'
]
=
self
.
tool_call_id
message
[
'tool_call_id'
]
=
self
.
tool_call_id
...
...
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