enh: __metadata__ param for tools & functions

Co-Authored-By: DmitriyAlergant-T1A <93501479+dmitriyalergant-t1a@users.noreply.github.com>
This commit is contained in:
Timothy Jaeryang Baek 2024-11-18 10:12:54 -08:00
parent 7da29b6798
commit e3485d2d88
2 changed files with 2 additions and 0 deletions

View File

@ -406,6 +406,7 @@ async def generate_function_chat_completion(form_data, user, models: dict = {}):
"name": user.name, "name": user.name,
"role": user.role, "role": user.role,
}, },
"__metadata__": metadata,
} }
extra_params["__tools__"] = get_tools( extra_params["__tools__"] = get_tools(
app, app,

View File

@ -604,6 +604,7 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware):
"name": user.name, "name": user.name,
"role": user.role, "role": user.role,
}, },
"__metadata__": metadata,
} }
# Initialize data_items to store additional data to be sent to the client # Initialize data_items to store additional data to be sent to the client