mirror of
https://github.com/open-webui/open-webui
synced 2024-11-24 04:54:12 +00:00
fix optional args not present
This commit is contained in:
parent
70838148e7
commit
c03bfd141e
@ -1313,7 +1313,6 @@ async def generate_chat_completions(
|
|||||||
|
|
||||||
@app.post("/api/chat/completed")
|
@app.post("/api/chat/completed")
|
||||||
async def chat_completed(form_data: dict, user=Depends(get_verified_user)):
|
async def chat_completed(form_data: dict, user=Depends(get_verified_user)):
|
||||||
|
|
||||||
model_list = await get_all_models()
|
model_list = await get_all_models()
|
||||||
models = {model["id"]: model for model in model_list}
|
models = {model["id"]: model for model in model_list}
|
||||||
|
|
||||||
|
@ -16,6 +16,8 @@ log = logging.getLogger(__name__)
|
|||||||
def apply_extra_params_to_tool_function(
|
def apply_extra_params_to_tool_function(
|
||||||
function: Callable, extra_params: dict
|
function: Callable, extra_params: dict
|
||||||
) -> Callable[..., Awaitable]:
|
) -> Callable[..., Awaitable]:
|
||||||
|
sig = inspect.signature(function)
|
||||||
|
extra_params = {k: v for k, v in extra_params.items() if k in sig.parameters}
|
||||||
partial_func = partial(function, **extra_params)
|
partial_func = partial(function, **extra_params)
|
||||||
if inspect.iscoroutinefunction(function):
|
if inspect.iscoroutinefunction(function):
|
||||||
update_wrapper(partial_func, function)
|
update_wrapper(partial_func, function)
|
||||||
|
Loading…
Reference in New Issue
Block a user