Skip to content

Commit

Permalink
fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
lkuligin committed Feb 20, 2024
1 parent 072559d commit 3e5da91
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions libs/vertexai/langchain_google_vertexai/chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,14 +397,14 @@ def _generate(
)
generations = [
ChatGeneration(
message=_parse_response_candidate(c),
message=_parse_response_candidate(candidate),
generation_info=get_generation_info(
c,
candidate,
self._is_gemini_model,
usage_metadata=response.to_dict().get("usage_metadata"),
),
)
for c in response.candidates
for candidate in response.candidates
]
else:
question = _get_question(messages)
Expand All @@ -416,14 +416,14 @@ def _generate(
response = chat.send_message(question.content, **msg_params)
generations = [
ChatGeneration(
message=AIMessage(content=r.text),
message=AIMessage(content=candidate.text),
generation_info=get_generation_info(
r,
candidate,
self._is_gemini_model,
usage_metadata=response.raw_prediction_response.metadata,
),
)
for r in response.candidates
for candidate in response.candidates
]
return ChatResult(generations=generations)

Expand Down

0 comments on commit 3e5da91

Please sign in to comment.