Skip to content

Commit

Permalink
added Vertex examples as attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
lkuligin committed Oct 16, 2023
1 parent e366427 commit e0774c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libs/langchain/langchain/chat_models/vertexai.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class ChatVertexAI(_VertexAICommon, BaseChatModel):

model_name: str = "chat-bison"
"Underlying model name."
examples: Optional[List[BaseMessage]] = None

@classmethod
def is_lc_serializable(self) -> bool:
Expand Down Expand Up @@ -175,7 +176,7 @@ def _generate(
question = _get_question(messages)
history = _parse_chat_history(messages[:-1])
params = self._prepare_params(stop=stop, stream=False, **kwargs)
examples = kwargs.get("examples", None)
examples = kwargs.get("examples") or self.examples
if examples:
params["examples"] = _parse_examples(examples)

Expand Down

0 comments on commit e0774c9

Please sign in to comment.