Skip to content

Commit

Permalink
Remove string default for now
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 committed Jan 18, 2025
1 parent f9bcb57 commit 4bb3bab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ export const run = async () => {
},
{
type: "document",
source: base64,
source: {
media_type: "application/pdf",
type: "base64",
data: base64,
},
},
],
},
]);
console.log(response.content);
//console.log(response.content);
return response.content;
};
9 changes: 1 addition & 8 deletions libs/langchain-anthropic/src/utils/message_inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,7 @@ function _formatContent(content: MessageContent) {
// PDF
return {
type: "document",
source:
typeof contentPart.source === "string"
? {
media_type: "application/pdf",
type: "base64",
data: contentPart.source,
}
: contentPart.source,
source: contentPart.source,
...(cacheControl ? { cache_control: cacheControl } : {}),
};
} else if (
Expand Down

0 comments on commit 4bb3bab

Please sign in to comment.