Skip to content

Commit

Permalink
chore: lint files
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul committed Jul 29, 2024
1 parent 27cf734 commit ff82bf1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions libs/langchain-google-common/src/chat_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,15 @@ class ChatConnection<AuthOptions> extends AbstractGoogleLLMConnection<
}

// Combine adjacent function messages
if (cur[0]?.role === "function" && acc.length > 0 && acc[acc.length - 1].role === "function") {
acc[acc.length - 1].parts = [...acc[acc.length - 1].parts, ...cur[0].parts];
if (
cur[0]?.role === "function" &&
acc.length > 0 &&
acc[acc.length - 1].role === "function"
) {
acc[acc.length - 1].parts = [
...acc[acc.length - 1].parts,
...cur[0].parts,
];
} else {
acc.push(...cur);
}
Expand Down

0 comments on commit ff82bf1

Please sign in to comment.