mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
formating
This commit is contained in:
parent
3b39807377
commit
7e3be60f0e
@ -190,10 +190,14 @@ async def chat_completion_tools_handler(
|
||||
|
||||
try:
|
||||
spec = tools[tool_function_name].get("spec", {})
|
||||
allowed_params = spec.get("parameters", {}).get("properties", {}).keys()
|
||||
allowed_params = (
|
||||
spec.get("parameters", {}).get("properties", {}).keys()
|
||||
)
|
||||
tool_function = tools[tool_function_name]["callable"]
|
||||
tool_function_params = {
|
||||
k: v for k, v in tool_function_params.items() if k in allowed_params
|
||||
k: v
|
||||
for k, v in tool_function_params.items()
|
||||
if k in allowed_params
|
||||
}
|
||||
tool_output = await tool_function(**tool_function_params)
|
||||
|
||||
@ -1759,7 +1763,11 @@ async def process_chat_response(
|
||||
spec = tool.get("spec", {})
|
||||
|
||||
try:
|
||||
allowed_params = spec.get("parameters", {}).get("properties", {}).keys()
|
||||
allowed_params = (
|
||||
spec.get("parameters", {})
|
||||
.get("properties", {})
|
||||
.keys()
|
||||
)
|
||||
tool_function = tool["callable"]
|
||||
tool_function_params = {
|
||||
k: v
|
||||
|
Loading…
Reference in New Issue
Block a user