Skip to content

Commit

Permalink
chore: lint files
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul committed Apr 4, 2024
1 parent 1396b1d commit 38a8fcb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/core_docs/docs/integrations/chat/anthropic_tools.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_class_name: hidden
---

:::warning
This API is deprecated as Anthropic now officially supports tools. [Click here to read the documentation](/docs/models/chat/anthropic#tools).
This API is deprecated as Anthropic now officially supports tools. [Click here to read the documentation](/docs/integrations/chat/anthropic#tools).
:::

# Anthropic Tools
Expand Down
14 changes: 12 additions & 2 deletions libs/langchain-google-common/src/utils/gemini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,24 @@ export function messageContentToParts(content: MessageContent): GeminiPart[] {
.map((content) => {
switch (content.type) {
case "text":
return messageContentText(content);
if ("text" in content) {
return messageContentText(content as MessageContentText);
}
break;
case "image_url":
return messageContentImageUrl(content);
if ("image_url" in content) {
// Type guard for MessageContentImageUrl
return messageContentImageUrl(content as MessageContentImageUrl);
}
break;
default:
throw new Error(
`Unsupported type received while converting message to message parts`
);
}
throw new Error(
`Cannot coerce "${content.type}" message part into a string.`
);
})
.reduce((acc: GeminiPart[], val: GeminiPart | null | undefined) => {
if (val) {
Expand Down

0 comments on commit 38a8fcb

Please sign in to comment.