MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / requests_with_file

Function requests_with_file

tests/test_open_telemetry.py:264–268  ·  view source on GitHub ↗

The requests of a Message Batch whose one message has the image in `file`, which the client reads when it prepares the body.

(file: pathlib.Path)

Source from the content-addressed store, hash-verified

262
263
264def requests_with_file(file: pathlib.Path) -> Any:
265 """The requests of a Message Batch whose one message has the image in `file`, which the client reads when it prepares the body."""
266 image = {"type": "image", "source": {"type": "base64", "media_type": "image/png", "data": file}}
267 params = {"max_tokens": 1, "messages": [{"role": "user", "content": [image]}], "model": "claude-test"}
268 return [{"custom_id": "a", "params": params}]
269
270
271def sse(events: Sequence[dict[str, Any]]) -> bytes:

Calls

no outgoing calls

Tested by

no test coverage detected