Crates.io | latitude-sdk |
lib.rs | latitude-sdk |
version | 1.0.0 |
source | src |
created_at | 2024-11-05 12:29:30.702948 |
updated_at | 2024-11-05 12:29:30.702948 |
description | A crate for integrating with the Latitude API. |
homepage | https://latitude.so |
repository | https://github.com/NewtTheWolf/latitude-rs |
max_upload_size | |
id | 1436476 |
size | 218,290 |
This crate provides a client for interacting with the Latitude API, allowing users to execute documents (prompts) and handle real-time AI-powered conversations through a simple HTTP-based interface.
Add this crate to your Cargo.toml
file:
cargo add latitude-sdk
To use the Latitude API client, create an instance of Client
with your API key, set the project ID, and run a document.
use latitude_sdk::Client;
let client = Client::builder("your_api_key".into())
.project_id(123)
.version_id("version-uuid".to_string())
.base_url("https://custom.url/api".to_string())
.build();
Here is a simple example of how to use the client to run a document:
use latitude_sdk::{Client, Document};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::builder("your_api_key".into())
.project_id(123)
.version_id("version-uuid".to_string())
.base_url("https://custom.url/api".to_string())
.build();
let document = Document::new("document_id".to_string());
let response = client.run_document(document).await?;
println!("Response: {:?}", response);
Ok(())
}
We welcome contributions! Please see CONTRIBUTING.md for more details.
This project is licensed under the MIT License. See the LICENSE file for details.