openai-rs / openai-api Goto Github PK
View Code? Open in Web Editor NEWA simple Rust library for OpenAI API, free from complex async operations and redundant dependencies.
License: MIT License
A simple Rust library for OpenAI API, free from complex async operations and redundant dependencies.
License: MIT License
Hello,
I just noticed that there is a typo on crates.io pointing to your github project: "https://github.com/openai-rs/opena**_p_**i-api"
so it gives a 404 error.
Hope it helps :)
thanks a lot for the rust crate
I don't know if there's another crate for this, but https://github.com/abonander/multipart is not a public archive and it might be a good idea to use another more stable crate, if it exists.
Thanks for the project. It's delightfully simple and a pleasure to use. Currently, Messages take a role and a string for the content. When it comes to vision though I believe we need to pass more than a string in.
Is there any plans to support this or if its possible already?
can you add support for wasm (wasm32-unknown-unknown
)? thanks
https://platform.openai.com/docs/api-reference/embeddings/create
There is now an option for controlling the encoding format, and for the new v3 models, the dimensions of the vector. But the EmbeddingsBody
doesn't have it
#[derive(Debug, Serialize, Deserialize)]
pub struct EmbeddingsBody {
/// ID of the model to use. You can use the List models API to see all of your available models,
/// or see our Model overview for descriptions of them.
pub model: String,
/// Input text to get embeddings for, encoded as a string or array of tokens. To get embeddings for multiple inputs in a single request,
/// pass an array of strings or array of token arrays. Each input must not exceed 8192 tokens in length.
pub input: Vec<String>,
/// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
#[serde(skip_serializing_if = "Option::is_none")]
pub user: Option<String>,
}
When a map of type HashMap<String, String> is passed for logit_bias, the following error results:
Error: API error: {"error":{"code":null,"message":"All values in 'logit_bias' must be reals, but found a <class 'str'>","param":"logit_bias","type":"invalid_request_error"}}. Trying again...
And obviously it won't compile if I try to pass any other type.
Hi there this crate is simple and great! I'm just wondering why EmbeddingData's fields are private here:
#[derive(Debug, Serialize, Deserialize)]
pub struct EmbeddingData {
object: Option<String>,
embedding: Option<Vec<f64>>,
index: i32,
}
I would like to get the embedding
vector directly.
PS: The link to the repo on the crate https://crates.io/crates/openai_api_rust is showing a 404, I think the link is different https://github.com/openai-rs/openapi-api
Can you tell us the advantages over the existing library?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.