Skip to content

Commit

Permalink
fix: change signatures for the stream function
Browse files Browse the repository at this point in the history
  • Loading branch information
yjp20 authored and stainless-app[bot] committed Jul 29, 2024
1 parent 70f3f5c commit d83a4d6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/anthropic/_utils/_reflection.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def assert_signatures_in_sync(

if custom_param.annotation != source_param.annotation:
errors.append(
f"types for the `{name}` param are do not match; source={repr(source_param.annotation)} checking={repr(source_param.annotation)}"
f"types for the `{name}` param are do not match; source={repr(source_param.annotation)} checking={repr(custom_param.annotation)}"
)
continue

Expand Down
26 changes: 2 additions & 24 deletions src/anthropic/resources/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,18 +885,7 @@ def stream(
*,
max_tokens: int,
messages: Iterable[MessageParam],
model: Union[
str,
Literal[
"claude-3-5-sonnet-20240620",
"claude-3-opus-20240229",
"claude-3-sonnet-20240229",
"claude-3-haiku-20240307",
"claude-2.1",
"claude-2.0",
"claude-instant-1.2",
],
],
model: ModelParam,
metadata: message_create_params.Metadata | NotGiven = NOT_GIVEN,
stop_sequences: List[str] | NotGiven = NOT_GIVEN,
system: Union[str, Iterable[TextBlockParam]] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -1800,18 +1789,7 @@ def stream(
*,
max_tokens: int,
messages: Iterable[MessageParam],
model: Union[
str,
Literal[
"claude-3-5-sonnet-20240620",
"claude-3-opus-20240229",
"claude-3-sonnet-20240229",
"claude-3-haiku-20240307",
"claude-2.1",
"claude-2.0",
"claude-instant-1.2",
],
],
model: ModelParam,
metadata: message_create_params.Metadata | NotGiven = NOT_GIVEN,
stop_sequences: List[str] | NotGiven = NOT_GIVEN,
system: Union[str, Iterable[TextBlockParam]] | NotGiven = NOT_GIVEN,
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/streaming/test_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def test_stream_method_definition_in_sync(sync: bool) -> None:

if custom_param.annotation != generated_param.annotation:
errors.append(
f"types for the `{name}` param are do not match; generated={repr(generated_param.annotation)} custom={repr(generated_param.annotation)}"
f"types for the `{name}` param are do not match; generated={repr(generated_param.annotation)} custom={repr(custom_param.annotation)}"
)
continue

Expand Down

0 comments on commit d83a4d6

Please sign in to comment.