From 0722c23db5dca0595530f7c7a969fc0d126db226 Mon Sep 17 00:00:00 2001 From: "mv.nandan" Date: Thu, 15 May 2025 15:44:39 +0530 Subject: [PATCH] fix: support dict-style function tool_choice for OpenAI realtime API --- python/rtclient/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/rtclient/models.py b/python/rtclient/models.py index cdef1ce..401af5b 100644 --- a/python/rtclient/models.py +++ b/python/rtclient/models.py @@ -32,10 +32,12 @@ class ServerVAD(ModelWithDefaults): TurnDetection = Annotated[Union[NoTurnDetection, ServerVAD], Field(discriminator="type")] +class FunctionName(BaseModel): + name: str class FunctionToolChoice(ModelWithDefaults): type: Literal["function"] = "function" - function: str + function: FunctionName ToolChoice = Literal["auto", "none", "required"] | FunctionToolChoice