Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/libninjacom/openai-rs
openai client, generated from the OpenAPI spec.
https://github.com/libninjacom/openai-rs
openai openapi rust
Last synced: 6 days ago
JSON representation
openai client, generated from the OpenAPI spec.
- Host: GitHub
- URL: https://github.com/libninjacom/openai-rs
- Owner: libninjacom
- License: mit
- Created: 2022-08-05T21:15:13.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-03-17T15:08:11.000Z (over 1 year ago)
- Last Synced: 2024-10-30T17:25:52.729Z (16 days ago)
- Topics: openai, openapi, rust
- Language: Rust
- Homepage:
- Size: 56.6 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
OpenAi client, generated from the OpenAPI spec.
# Usage
```rust
use openai::OpenAiClient;
use openai::model::*;
#[tokio::main]
async fn main() {
let client = OpenAiClient::from_env();
let response = client.list_engines().await.unwrap();
println!("{:#?}", response);
}
```This example loads configuration from environment variables, specifically:
- `OPENAI_API_KEY` - Your OpenAI API key
# Installation
Add this to your Cargo.toml:
```toml
[dependencies]
openai2 = "2"
```The crate is named `openai2`, but it is imported as `openai`:
```rust
use openai;
```# Documentation
* [Client Library Documentation](https://docs.rs/openai2)
You can see working examples of every API call in the `examples/` directory.
# Contributing
Contributions are welcome!
*Library created with [Libninja](https://www.libninja.com).*