Expand description
Anthropic provider for Prompty.
This crate provides the Anthropic executor and processor implementations,
registered under the key "anthropic".
Anthropic’s Messages API differs from OpenAI in several key ways:
- System messages are extracted to a top-level
systemfield - Messages always use content block arrays
[{type: "text", text: "..."}] - Tools use
input_schemainstead ofparameters max_tokensis required (defaults to 4096)- Auth uses
x-api-keyheader (notAuthorization: Bearer) - Tool results are batched into one user message with
tool_resultblocks
§Usage
prompty_anthropic::register();
// Now invoke/turn will use Anthropic for agents with provider="anthropic"Re-exports§
pub use executor::AnthropicExecutor;pub use models::list_models;pub use models::list_models_async;pub use processor::AnthropicProcessor;pub use processor::process_response;
Modules§
- executor
- Anthropic executor — sends requests to the Anthropic Messages API.
- models
- Model discovery for Anthropic — calls
GET /v1/modelsand maps the response toModelInfo. Anthropic returnscontext_lengthand modality information directly, so no enrichment table is needed. - processor
- Anthropic processor — extracts results from Anthropic Messages API responses.
- wire
- Wire format conversion for the Anthropic Messages API.
Functions§
- register
- Register the Anthropic executor and processor in the global registry.