Async Support
use orpheus::prelude::*;
#[tokio::main]
async fn main() {
// Use the alternative async client
let client = AsyncOrpheus::from_env().expect("ORPHEUS_API_KEY is set");
let res = client
.chat("Who would win in a fist fight, Einstein or Oppenheimer?")
.model("openai/gpt-4o")
.send()
.await // Await the response after calling `send`
.unwrap();
println!("{}", res.content().unwrap());
}Predicting the outcome of a hypothetical fist fight between Albert Einstein and J. Robert Oppenheimer is highly speculative and not particularly meaningful, as both individuals were renowned for their intellectual contributions rather than physical prowess. Einstein is famous for his theories of relativity, while Oppenheimer is best known for his role in the development of the atomic bomb during the Manhattan Project.Async Streaming
Last updated
Was this helpful?