LLM-SDK
SDK for OpenAI compatible APIs.
Usage
Add llm-sdk
by using cargo add llm-sdk
.
Features
- Embedding API
- Transcription & Translation API
- Speech API
- Chat Completion API with tools
- Chat Completion API streaming
- Chat Completion API with image input
- Create Image API
- Create Image Edit API
- Create Image Variant API
As assistant API is still in Beta and is super slow, so we don't have plan to support it (and relevant file APIs) for now.
Examples
Here are some examples of how to use the SDK:
// create image
let sdk = new;
let req = new;
let res = sdk.create_image;
// chat completion
let messages = vec!;
let req = new;
let res = sdk.chat_completion.await?;
For more usage, please check the test cases.