File tree Expand file tree Collapse file tree 2 files changed +0
-25
lines changed Expand file tree Collapse file tree 2 files changed +0
-25
lines changed Original file line number Diff line number Diff line change 36
36
_default_response_format : None = None
37
37
38
38
39
- def validate_input_tools (
40
- tools : Iterable [ChatCompletionToolParam ] | NotGiven = NOT_GIVEN ,
41
- ) -> None :
42
- if not is_given (tools ):
43
- return
44
-
45
- for tool in tools :
46
- if tool ["type" ] != "function" :
47
- raise ValueError (
48
- f'Currently only `function` tool types support auto-parsing; Received `{ tool ["type" ]} `' ,
49
- )
50
-
51
- strict = tool ["function" ].get ("strict" )
52
- if strict is not True :
53
- raise ValueError (
54
- f'`{ tool ["function" ]["name" ]} ` is not strict. Only `strict` function tools can be auto-parsed'
55
- )
56
-
57
-
58
39
def parse_chat_completion (
59
40
* ,
60
41
response_format : type [ResponseFormatT ] | completion_create_params .ResponseFormat | NotGiven ,
Original file line number Diff line number Diff line change 22
22
from ...._base_client import make_request_options
23
23
from ....lib ._parsing import (
24
24
ResponseFormatT ,
25
- validate_input_tools as _validate_input_tools ,
26
25
parse_chat_completion as _parse_chat_completion ,
27
26
type_to_response_format_param as _type_to_response_format ,
28
27
)
@@ -143,8 +142,6 @@ class MathResponse(BaseModel):
143
142
print("answer: ", message.parsed.final_answer)
144
143
```
145
144
"""
146
- _validate_input_tools (tools )
147
-
148
145
extra_headers = {
149
146
"X-Stainless-Helper-Method" : "beta.chat.completions.parse" ,
150
147
** (extra_headers or {}),
@@ -420,8 +417,6 @@ class MathResponse(BaseModel):
420
417
print("answer: ", message.parsed.final_answer)
421
418
```
422
419
"""
423
- _validate_input_tools (tools )
424
-
425
420
extra_headers = {
426
421
"X-Stainless-Helper-Method" : "beta.chat.completions.parse" ,
427
422
** (extra_headers or {}),
@@ -545,7 +540,6 @@ def stream(
545
540
When the context manager exits, the response will be closed, however the `stream` instance is still available outside
546
541
the context manager.
547
542
"""
548
- _validate_input_tools (tools )
549
543
550
544
extra_headers = {
551
545
"X-Stainless-Helper-Method" : "beta.chat.completions.stream" ,
You can’t perform that action at this time.
0 commit comments