anthropics / anthropic-quickstarts

A collection of projects designed to help developers quickly get started with building deployable applications using the Anthropic API
MIT License
6.55k stars 904 forks source link

[computer-use] prompt is too long: 213610 tokens > 199999 maximum #133

Closed lostmsu closed 1 week ago

lostmsu commented 1 week ago

I actually have a custom implementation of the tool. But here's the JSON I submit:

computer-use.json

It is a simple 1024x768 PNG.

I am puzzled as the quickstart (judging from the code) does up to 10 (up to 50 with prompt caching) images. How do they fit? Am I doing something completely wrong?

x5a commented 1 week ago

@lostmsu your content block is implicitly being processed as text rather than an image. See here for an example of how to properly structure your image tool result.