Skip to content

Commit

Permalink
change method name
Browse files Browse the repository at this point in the history
  • Loading branch information
MateuszOssGit committed Nov 8, 2024
1 parent bdf0f70 commit f4da81c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libs/ibm/langchain_ibm/chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ def _generate(
return generate_from_stream(stream_iter)

message_dicts, params = self._create_message_dicts(messages, stop, **kwargs)
updated_params = self._update_params(params, kwargs)
updated_params = self._merge_params(params, kwargs)

response = self.watsonx_model.chat(
messages=message_dicts, **(kwargs | {"params": updated_params})
Expand All @@ -700,7 +700,7 @@ def _stream(
**kwargs: Any,
) -> Iterator[ChatGenerationChunk]:
message_dicts, params = self._create_message_dicts(messages, stop, **kwargs)
updated_params = self._update_params(params, kwargs)
updated_params = self._merge_params(params, kwargs)

default_chunk_class: Type[BaseMessageChunk] = AIMessageChunk
base_generation_info: dict = {}
Expand Down Expand Up @@ -744,7 +744,7 @@ def _stream(
yield generation_chunk

@staticmethod
def _update_params(params: dict, kwargs: dict) -> dict:
def _merge_params(params: dict, kwargs: dict) -> dict:
param_updates = {}
for k in [
"frequency_penalty",
Expand Down

0 comments on commit f4da81c

Please sign in to comment.