2323 async_to_streamed_response_wrapper ,
2424)
2525from .._streaming import Stream , AsyncStream
26+ from ..types .chat import Chat
2627from .._base_client import make_request_options
27- from ..types .chat_completion import ChatCompletion
2828from ..types .chat_completion_chunk import ChatCompletionChunk
29- from ..types .shared_params .tool_param import ToolParam
3029
3130__all__ = ["ChatResource" , "AsyncChatResource" ]
3231
@@ -65,15 +64,15 @@ def chat(
6564 stream_options : chat_chat_params .StreamOptions | NotGiven = NOT_GIVEN ,
6665 temperature : float | NotGiven = NOT_GIVEN ,
6766 tool_choice : chat_chat_params .ToolChoice | NotGiven = NOT_GIVEN ,
68- tools : Iterable [ToolParam ] | NotGiven = NOT_GIVEN ,
67+ tools : Iterable [chat_chat_params . Tool ] | NotGiven = NOT_GIVEN ,
6968 top_p : float | NotGiven = NOT_GIVEN ,
7069 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
7170 # The extra values given here take precedence over values defined on the client or passed to this method.
7271 extra_headers : Headers | None = None ,
7372 extra_query : Query | None = None ,
7473 extra_body : Body | None = None ,
7574 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
76- ) -> ChatCompletion :
75+ ) -> Chat :
7776 """Generate a chat completion based on the provided messages.
7877
7978 The response shown
@@ -148,7 +147,7 @@ def chat(
148147 stream_options : chat_chat_params .StreamOptions | NotGiven = NOT_GIVEN ,
149148 temperature : float | NotGiven = NOT_GIVEN ,
150149 tool_choice : chat_chat_params .ToolChoice | NotGiven = NOT_GIVEN ,
151- tools : Iterable [ToolParam ] | NotGiven = NOT_GIVEN ,
150+ tools : Iterable [chat_chat_params . Tool ] | NotGiven = NOT_GIVEN ,
152151 top_p : float | NotGiven = NOT_GIVEN ,
153152 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
154153 # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -231,15 +230,15 @@ def chat(
231230 stream_options : chat_chat_params .StreamOptions | NotGiven = NOT_GIVEN ,
232231 temperature : float | NotGiven = NOT_GIVEN ,
233232 tool_choice : chat_chat_params .ToolChoice | NotGiven = NOT_GIVEN ,
234- tools : Iterable [ToolParam ] | NotGiven = NOT_GIVEN ,
233+ tools : Iterable [chat_chat_params . Tool ] | NotGiven = NOT_GIVEN ,
235234 top_p : float | NotGiven = NOT_GIVEN ,
236235 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
237236 # The extra values given here take precedence over values defined on the client or passed to this method.
238237 extra_headers : Headers | None = None ,
239238 extra_query : Query | None = None ,
240239 extra_body : Body | None = None ,
241240 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
242- ) -> ChatCompletion | Stream [ChatCompletionChunk ]:
241+ ) -> Chat | Stream [ChatCompletionChunk ]:
243242 """Generate a chat completion based on the provided messages.
244243
245244 The response shown
@@ -314,15 +313,15 @@ def chat(
314313 stream_options : chat_chat_params .StreamOptions | NotGiven = NOT_GIVEN ,
315314 temperature : float | NotGiven = NOT_GIVEN ,
316315 tool_choice : chat_chat_params .ToolChoice | NotGiven = NOT_GIVEN ,
317- tools : Iterable [ToolParam ] | NotGiven = NOT_GIVEN ,
316+ tools : Iterable [chat_chat_params . Tool ] | NotGiven = NOT_GIVEN ,
318317 top_p : float | NotGiven = NOT_GIVEN ,
319318 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
320319 # The extra values given here take precedence over values defined on the client or passed to this method.
321320 extra_headers : Headers | None = None ,
322321 extra_query : Query | None = None ,
323322 extra_body : Body | None = None ,
324323 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
325- ) -> ChatCompletion | Stream [ChatCompletionChunk ]:
324+ ) -> Chat | Stream [ChatCompletionChunk ]:
326325 return self ._post (
327326 "/v1/chat" ,
328327 body = maybe_transform (
@@ -345,7 +344,7 @@ def chat(
345344 options = make_request_options (
346345 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
347346 ),
348- cast_to = ChatCompletion ,
347+ cast_to = Chat ,
349348 stream = stream or False ,
350349 stream_cls = Stream [ChatCompletionChunk ],
351350 )
@@ -385,15 +384,15 @@ async def chat(
385384 stream_options : chat_chat_params .StreamOptions | NotGiven = NOT_GIVEN ,
386385 temperature : float | NotGiven = NOT_GIVEN ,
387386 tool_choice : chat_chat_params .ToolChoice | NotGiven = NOT_GIVEN ,
388- tools : Iterable [ToolParam ] | NotGiven = NOT_GIVEN ,
387+ tools : Iterable [chat_chat_params . Tool ] | NotGiven = NOT_GIVEN ,
389388 top_p : float | NotGiven = NOT_GIVEN ,
390389 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
391390 # The extra values given here take precedence over values defined on the client or passed to this method.
392391 extra_headers : Headers | None = None ,
393392 extra_query : Query | None = None ,
394393 extra_body : Body | None = None ,
395394 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
396- ) -> ChatCompletion :
395+ ) -> Chat :
397396 """Generate a chat completion based on the provided messages.
398397
399398 The response shown
@@ -468,7 +467,7 @@ async def chat(
468467 stream_options : chat_chat_params .StreamOptions | NotGiven = NOT_GIVEN ,
469468 temperature : float | NotGiven = NOT_GIVEN ,
470469 tool_choice : chat_chat_params .ToolChoice | NotGiven = NOT_GIVEN ,
471- tools : Iterable [ToolParam ] | NotGiven = NOT_GIVEN ,
470+ tools : Iterable [chat_chat_params . Tool ] | NotGiven = NOT_GIVEN ,
472471 top_p : float | NotGiven = NOT_GIVEN ,
473472 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
474473 # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -551,15 +550,15 @@ async def chat(
551550 stream_options : chat_chat_params .StreamOptions | NotGiven = NOT_GIVEN ,
552551 temperature : float | NotGiven = NOT_GIVEN ,
553552 tool_choice : chat_chat_params .ToolChoice | NotGiven = NOT_GIVEN ,
554- tools : Iterable [ToolParam ] | NotGiven = NOT_GIVEN ,
553+ tools : Iterable [chat_chat_params . Tool ] | NotGiven = NOT_GIVEN ,
555554 top_p : float | NotGiven = NOT_GIVEN ,
556555 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
557556 # The extra values given here take precedence over values defined on the client or passed to this method.
558557 extra_headers : Headers | None = None ,
559558 extra_query : Query | None = None ,
560559 extra_body : Body | None = None ,
561560 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
562- ) -> ChatCompletion | AsyncStream [ChatCompletionChunk ]:
561+ ) -> Chat | AsyncStream [ChatCompletionChunk ]:
563562 """Generate a chat completion based on the provided messages.
564563
565564 The response shown
@@ -634,15 +633,15 @@ async def chat(
634633 stream_options : chat_chat_params .StreamOptions | NotGiven = NOT_GIVEN ,
635634 temperature : float | NotGiven = NOT_GIVEN ,
636635 tool_choice : chat_chat_params .ToolChoice | NotGiven = NOT_GIVEN ,
637- tools : Iterable [ToolParam ] | NotGiven = NOT_GIVEN ,
636+ tools : Iterable [chat_chat_params . Tool ] | NotGiven = NOT_GIVEN ,
638637 top_p : float | NotGiven = NOT_GIVEN ,
639638 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
640639 # The extra values given here take precedence over values defined on the client or passed to this method.
641640 extra_headers : Headers | None = None ,
642641 extra_query : Query | None = None ,
643642 extra_body : Body | None = None ,
644643 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
645- ) -> ChatCompletion | AsyncStream [ChatCompletionChunk ]:
644+ ) -> Chat | AsyncStream [ChatCompletionChunk ]:
646645 return await self ._post (
647646 "/v1/chat" ,
648647 body = await async_maybe_transform (
@@ -665,7 +664,7 @@ async def chat(
665664 options = make_request_options (
666665 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
667666 ),
668- cast_to = ChatCompletion ,
667+ cast_to = Chat ,
669668 stream = stream or False ,
670669 stream_cls = AsyncStream [ChatCompletionChunk ],
671670 )
0 commit comments