Skip to content

Commit

Permalink
anthropic[patch]: fix model name in some integration tests (#23779)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccurme authored Jul 2, 2024
1 parent 7a6c06c commit c9dac59
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def test_system_invoke() -> None:

def test_anthropic_call() -> None:
"""Test valid call to anthropic."""
chat = ChatAnthropic(model="test") # type: ignore[call-arg]
chat = ChatAnthropic(model=MODEL_NAME) # type: ignore[call-arg]
message = HumanMessage(content="Hello")
response = chat.invoke([message])
assert isinstance(response, AIMessage)
Expand All @@ -256,7 +256,7 @@ def test_anthropic_call() -> None:

def test_anthropic_generate() -> None:
"""Test generate method of anthropic."""
chat = ChatAnthropic(model="test") # type: ignore[call-arg]
chat = ChatAnthropic(model=MODEL_NAME) # type: ignore[call-arg]
chat_messages: List[List[BaseMessage]] = [
[HumanMessage(content="How many toes do dogs have?")]
]
Expand All @@ -272,7 +272,7 @@ def test_anthropic_generate() -> None:

def test_anthropic_streaming() -> None:
"""Test streaming tokens from anthropic."""
chat = ChatAnthropic(model="test") # type: ignore[call-arg]
chat = ChatAnthropic(model=MODEL_NAME) # type: ignore[call-arg]
message = HumanMessage(content="Hello")
response = chat.stream([message])
for token in response:
Expand All @@ -285,7 +285,7 @@ def test_anthropic_streaming_callback() -> None:
callback_handler = FakeCallbackHandler()
callback_manager = CallbackManager([callback_handler])
chat = ChatAnthropic( # type: ignore[call-arg]
model="test",
model=MODEL_NAME,
callback_manager=callback_manager,
verbose=True,
)
Expand All @@ -301,7 +301,7 @@ async def test_anthropic_async_streaming_callback() -> None:
callback_handler = FakeCallbackHandler()
callback_manager = CallbackManager([callback_handler])
chat = ChatAnthropic( # type: ignore[call-arg]
model="test",
model=MODEL_NAME,
callback_manager=callback_manager,
verbose=True,
)
Expand Down

0 comments on commit c9dac59

Please sign in to comment.