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
change
sglang
Commits
ae335842
Unverified
Commit
ae335842
authored
May 26, 2025
by
Chang Su
Committed by
GitHub
May 26, 2025
Browse files
[Bugfix]: Fix call for function_call_parser.multi_format_detector in adapter.py (#6650)
parent
477a101c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
python/sglang/srt/openai_api/adapter.py
python/sglang/srt/openai_api/adapter.py
+6
-6
No files found.
python/sglang/srt/openai_api/adapter.py
View file @
ae335842
...
@@ -1618,14 +1618,14 @@ async def v1_chat_completions(
...
@@ -1618,14 +1618,14 @@ async def v1_chat_completions(
latest_delta_len
=
len
(
call_item
.
parameters
)
latest_delta_len
=
len
(
call_item
.
parameters
)
expected_call
=
json
.
dumps
(
expected_call
=
json
.
dumps
(
parser
.
multi_format_parser
.
detectors
[
0
]
parser
.
detector
.
prev_tool_call_arr
[
index
].
get
(
.
prev_tool_call_arr
[
index
]
"arguments"
,
{}
.
get
(
"arguments"
,
{}
),
),
ensure_ascii
=
False
,
ensure_ascii
=
False
,
)
)
actual_call
=
parser
.
multi_format_parser
.
detectors
[
actual_call
=
parser
.
detector
.
streamed_args_for_tool
[
0
index
]
.
streamed_args_for_tool
[
index
]
]
if
latest_delta_len
>
0
:
if
latest_delta_len
>
0
:
actual_call
=
actual_call
[:
-
latest_delta_len
]
actual_call
=
actual_call
[:
-
latest_delta_len
]
remaining_call
=
expected_call
.
replace
(
remaining_call
=
expected_call
.
replace
(
...
...
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