Skip to content

Instantly share code, notes, and snippets.

@pontusab
Created February 27, 2024 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pontusab/34fd94a7e9e8f59bdf7a306b6649ee02 to your computer and use it in GitHub Desktop.
Save pontusab/34fd94a7e9e8f59bdf7a306b6649ee02 to your computer and use it in GitHub Desktop.
Process PDF
const completion = await io.openai.chat.completions.create("completion", {
model: "gpt-3.5-turbo",
messages: [
{
role: "system",
content:
"You are a invoice parser. From this invoice extract total amount, due date, issuer name, currency and transform currency value to currency code and return it as currency. Return the response in JSON format",
},
{
role: "user",
content: JSON.stringify(docs.at(0)?.pageContent),
},
],
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment