File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ def create(
4444 extra_headers : Headers | None = None ,
4545 extra_body : Body | None = None ,
4646 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
47+ response_format : object | None = None ,
48+ thinking : object | None = None ,
4749 ) -> AsyncTaskStatus :
4850 _cast_type = AsyncTaskStatus
4951 logger .debug (f"temperature:{ temperature } , top_p:{ top_p } " )
@@ -87,6 +89,8 @@ def create(
8789 "tool_choice" : tool_choice ,
8890 "meta" : meta ,
8991 "extra" : maybe_transform (extra , code_geex_params .CodeGeexExtra ),
92+ "response_format" : response_format ,
93+ "thinking" : thinking
9094 }
9195 return self ._post (
9296 "/async/chat/completions" ,
Original file line number Diff line number Diff line change @@ -47,7 +47,8 @@ def create(
4747 extra_headers : Headers | None = None ,
4848 extra_body : Body | None = None ,
4949 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
50- response_format : object | None = None
50+ response_format : object | None = None ,
51+ thinking : object | None = None ,
5152 ) -> Completion | StreamResponse [ChatCompletionChunk ]:
5253 logger .debug (f"temperature:{ temperature } , top_p:{ top_p } " )
5354 if temperature is not None and temperature != NOT_GIVEN :
@@ -91,7 +92,8 @@ def create(
9192 "tool_choice" : tool_choice ,
9293 "meta" : meta ,
9394 "extra" : maybe_transform (extra , code_geex_params .CodeGeexExtra ),
94- "response_format" : response_format
95+ "response_format" : response_format ,
96+ "thinking" : thinking
9597 })
9698 return self ._post (
9799 "/chat/completions" ,
Original file line number Diff line number Diff line change @@ -49,13 +49,19 @@ class Choice(BaseModel):
4949 finish_reason : Optional [str ] = None
5050 index : int
5151
52+ class PromptTokensDetails (BaseModel ):
53+ cached_tokens : int
54+
55+ class CompletionTokensDetails (BaseModel ):
56+ reasoning_tokens : int
5257
5358class CompletionUsage (BaseModel ):
5459 prompt_tokens : int
60+ prompt_tokens_details : Optional [PromptTokensDetails ] = None
5561 completion_tokens : int
62+ completion_tokens_details : Optional [CompletionTokensDetails ] = None
5663 total_tokens : int
5764
58-
5965class ChatCompletionChunk (BaseModel ):
6066 id : Optional [str ] = None
6167 choices : List [Choice ]
You can’t perform that action at this time.
0 commit comments