@@ -96,7 +96,8 @@ def client(self) -> MistralClient:
96
96
_client_params ["timeout" ] = self .timeout
97
97
if self .client_params :
98
98
_client_params .update (self .client_params )
99
- return MistralClient (** _client_params )
99
+ self .mistral_client = MistralClient (** _client_params )
100
+ return self .mistral_client
100
101
101
102
@property
102
103
def api_kwargs (self ) -> Dict [str , Any ]:
@@ -181,10 +182,9 @@ def invoke(self, messages: List[Message]) -> ChatCompletionResponse:
181
182
ChatCompletionResponse: The response from the model.
182
183
"""
183
184
mistral_messages = self ._prepare_messages (messages )
184
- logger .debug (f"Mistral messages: { mistral_messages } " )
185
185
response = self .client .chat .complete (
186
- messages = mistral_messages ,
187
186
model = self .id ,
187
+ messages = mistral_messages ,
188
188
** self .api_kwargs ,
189
189
)
190
190
if response is None :
@@ -202,10 +202,9 @@ def invoke_stream(self, messages: List[Message]) -> Iterator[Any]:
202
202
Iterator[Any]: The streamed response.
203
203
"""
204
204
mistral_messages = self ._prepare_messages (messages )
205
- logger .debug (f"Mistral messages sending to stream endpoint: { mistral_messages } " )
206
205
response = self .client .chat .stream (
207
- messages = mistral_messages ,
208
206
model = self .id ,
207
+ messages = mistral_messages ,
209
208
** self .api_kwargs ,
210
209
)
211
210
if response is None :
@@ -358,7 +357,7 @@ def response(self, messages: List[Message]) -> ModelResponse:
358
357
assistant_message .log ()
359
358
360
359
# -*- Parse and run tool calls
361
- logger .debug (f"Functions: { self ._functions } " )
360
+ # logger.debug(f"Functions: {self._functions}")
362
361
363
362
# -*- Handle tool calls
364
363
if self ._handle_tool_calls (assistant_message , messages , model_response ):
0 commit comments