Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary support #337

Closed
philkunz opened this issue Mar 18, 2024 · 4 comments
Closed

Binary support #337

philkunz opened this issue Mar 18, 2024 · 4 comments
Assignees

Comments

@philkunz
Copy link

From the docs it is not clear how we are supposed to input binaries and images...

@philkunz
Copy link
Author

Whats the status on this one?

@atali
Copy link

atali commented Apr 14, 2024

would love to see a code example, trying multiple solutions but none of them worked

@mixa9269
Copy link

Try this one:

const message = await anthropic.messages.create({
    max_tokens: 1024,
    model: 'claude-3-haiku-20240307',
    messages: [{ 
      role: 'user', 
      content: [
        {
          type: 'image',
          source: {
            data: base64,
            media_type: 'image/jpeg',
            type: 'base64',
          }
        },
        {
          type: 'text',
          text: 'Your instruction here',
        },
      ],
    }],
  });

@olu-an
Copy link

olu-an commented May 29, 2024

@philkunz @atali we have documentation with examples for image use cases: https://docs.anthropic.com/en/docs/vision.

Could you reopen with more details if you still have questions?

@olu-an olu-an closed this as completed May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants