Expand description
Anthropic Claude API client library for text and object generation.
This crate provides a Rust client for interacting with Anthropic’s Claude API, supporting both text generation and structured JSON object generation.
§Example
use elizaos_plugin_anthropic::{create_client_from_env, TextGenerationParams};
let client = create_client_from_env()?;
let params = TextGenerationParams::new("Hello, Claude!");
let response = client.generate_text_small(params).await?;
println!("{}", response.text);Re-exports§
pub use client::AnthropicClient;pub use config::AnthropicConfig;pub use error::AnthropicError;pub use error::Result;pub use models::Model;pub use models::ModelSize;pub use types::ContentBlock;pub use types::Message;pub use types::ObjectGenerationParams;pub use types::Role;pub use types::TextGenerationParams;pub use types::TextGenerationResponse;
Modules§
- client
- HTTP client for making API requests to Anthropic.
- config
- Configuration types for the Anthropic client.
- error
- Error types for API operations.
- models
- Model definitions and utilities.
- types
- Request and response types for the API.
Constants§
- PLUGIN_
DESCRIPTION - A description of this plugin’s functionality.
- PLUGIN_
NAME - The name of this plugin.
- PLUGIN_
VERSION - The version of this plugin, derived from Cargo.toml.
Functions§
- create_
client_ from_ env - Creates an Anthropic client using environment variables for configuration.