Babel Bridge
LLM API Adapter SDK for Rust
This is a Rust SDK for interacting with various Large Language Model (LLM) APIs, starting with the Anthropic API. It allows you to send messages and engage in conversations with language models.
Features
- Send single messages to the Anthropic API and retrieve responses
- Engage in multi-turn conversations with Anthropic's language models
- Customize the model, max tokens, and temperature for each request
- Handle API errors and parse responses using Rust structs
Supported APIs
Currently, this SDK only supports the Anthropic API. However, there are plans to add support for additional Language Model APIs in the future. Stay tuned for updates!
Installation
Add the following to your Cargo.toml
file:
[]
= "x.x.x"
Usage
First, make sure you have an API key from Anthropic. Set the API key as an environment variable
named ANTHROPIC_API_KEY
.
Sending a Single Message
To send a single message to the Anthropic API and retrieve the response:
use AnthropicClient;
use Message;
async
Engaging in a Conversation
To start a conversation with Anthropic's language models:
use AnthropicClient;
async
Documentation
For detailed documentation and more examples, please refer to the API documentation.
Contributing
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.