A Rust library for interacting with the Anthropic API.
Add the following to your `Cargo.toml` file:
```toml
[dependencies]
anthropic_api = "0.1.0"
Usage
Here's a simple example of how to use the anthropic_api crate to send a request to the Anthropic API:
use send_request;
Make sure to set the ANTHROPIC_API_KEY environment variable with your Anthropic API key before running the code.
Make sure to set the ANTHROPIC_API_URL environment variable with your Anthropic API key before running the code.
Make sure to set the ANTHROPIC_API_VERSION environment variable with your Anthropic API key before running the code.
ANTHROPIC_API_URL=https://api.anthropic.com/v1/messages
ANTHROPIC_API_VERSION=2023-06-01
ANTHROPIC_API_KEY=xxxxxxxx
API
send_request(content: &str) -> Result<String, Box<dyn std::error::Error>>
Sends a request to the Anthropic API with the provided content and returns the response as a String.
content: The content to send to the Anthropic API.- Returns: A
Resultcontaining the response string on success, or an error on failure.
License
This project is licensed under the MIT License. See the LICENSE file for details.