@@ -49,7 +49,7 @@ def test_anthropic_invoke_happy_path(mock_anthropic: Mock) -> None:
4949 input_text = "may thy knife chip and shatter"
5050 response = llm .invoke (input_text )
5151 assert response .content == "generated text"
52- llm .client .messages .create .assert_called_once_with (
52+ llm .client .messages .create .assert_called_once_with ( # type: ignore[attr-defined]
5353 messages = [{"role" : "user" , "content" : input_text }],
5454 model = "claude-3-opus-20240229" ,
5555 system = anthropic .NOT_GIVEN ,
@@ -81,7 +81,7 @@ def test_anthropic_invoke_with_message_history_happy_path(mock_anthropic: Mock)
8181 response = llm .invoke (question , message_history )
8282 assert response .content == "generated text"
8383 message_history .add_message (LLMMessage (role = "user" , content = question ))
84- llm .client .messages .create .assert_called_once_with (
84+ llm .client .messages .create .assert_called_once_with ( # type: ignore[attr-defined]
8585 messages = message_history ,
8686 model = "claude-3-opus-20240229" ,
8787 system = anthropic .NOT_GIVEN ,
@@ -107,14 +107,14 @@ def test_anthropic_invoke_with_system_instruction(
107107 assert isinstance (response , LLMResponse )
108108 assert response .content == "generated text"
109109 messages = [{"role" : "user" , "content" : question }]
110- llm .client .messages .create .assert_called_with (
110+ llm .client .messages .create .assert_called_with ( # type: ignore[attr-defined]
111111 model = "claude-3-opus-20240229" ,
112112 system = system_instruction ,
113113 messages = messages ,
114114 ** model_params ,
115115 )
116116
117- assert llm .client .messages .create .call_count == 1
117+ assert llm .client .messages .create .call_count == 1 # type: ignore[attr-defined]
118118
119119
120120def test_anthropic_invoke_with_message_history_and_system_instruction (
@@ -145,14 +145,14 @@ def test_anthropic_invoke_with_message_history_and_system_instruction(
145145 assert isinstance (response , LLMResponse )
146146 assert response .content == "generated text"
147147 message_history .add_message (LLMMessage (role = "user" , content = question ))
148- llm .client .messages .create .assert_called_with (
148+ llm .client .messages .create .assert_called_with ( # type: ignore[attr-defined]
149149 model = "claude-3-opus-20240229" ,
150150 system = system_instruction ,
151151 messages = message_history ,
152152 ** model_params ,
153153 )
154154
155- assert llm .client .messages .create .call_count == 1
155+ assert llm .client .messages .create .call_count == 1 # type: ignore[attr-defined]
156156
157157
158158def test_anthropic_invoke_with_message_history_validation_error (
@@ -190,7 +190,7 @@ async def test_anthropic_ainvoke_happy_path(mock_anthropic: Mock) -> None:
190190 input_text = "may thy knife chip and shatter"
191191 response = await llm .ainvoke (input_text )
192192 assert response .content == "Return text"
193- llm .async_client .messages .create .assert_awaited_once_with (
193+ llm .async_client .messages .create .assert_awaited_once_with ( # type: ignore[attr-defined]
194194 model = "claude-3-opus-20240229" ,
195195 system = anthropic .NOT_GIVEN ,
196196 messages = [{"role" : "user" , "content" : input_text }],
0 commit comments