mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
refac
This commit is contained in:
parent
50181ee99e
commit
b1d5e3b687
1 changed files with 8 additions and 9 deletions
|
|
@ -1401,15 +1401,18 @@ async def chat_completion(
|
||||||
request.state.direct = True
|
request.state.direct = True
|
||||||
request.state.model = model
|
request.state.model = model
|
||||||
|
|
||||||
|
model_info_params = (
|
||||||
|
model_info.params.model_dump() if model_info and model_info.params else {}
|
||||||
|
)
|
||||||
|
|
||||||
# Chat Params
|
# Chat Params
|
||||||
stream_delta_chunk_size = form_data.get("params", {}).get(
|
stream_delta_chunk_size = form_data.get("params", {}).get(
|
||||||
"stream_delta_chunk_size"
|
"stream_delta_chunk_size"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Model Params
|
# Model Params
|
||||||
if model_info and model_info.params:
|
if not stream_delta_chunk_size and model_info_params:
|
||||||
stream_delta_chunk_size = model_info.params.model_dump().get(
|
stream_delta_chunk_size = model_info_params.get("stream_delta_chunk_size")
|
||||||
"stream_delta_chunk_size"
|
|
||||||
)
|
|
||||||
|
|
||||||
metadata = {
|
metadata = {
|
||||||
"user_id": user.id,
|
"user_id": user.id,
|
||||||
|
|
@ -1430,11 +1433,7 @@ async def chat_completion(
|
||||||
"native"
|
"native"
|
||||||
if (
|
if (
|
||||||
form_data.get("params", {}).get("function_calling") == "native"
|
form_data.get("params", {}).get("function_calling") == "native"
|
||||||
or (
|
or model_info_params.get("function_calling") == "native"
|
||||||
model_info
|
|
||||||
and model_info.params.model_dump().get("function_calling")
|
|
||||||
== "native"
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
else "default"
|
else "default"
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue