oris-runtime 0.15.0

An agentic workflow runtime and programmable AI execution system in Rust: stateful graphs, agents, tools, and multi-step execution.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use oris_runtime::embedding::{
    embedder_trait::Embedder,
    openai::openai_embedder::{AzureConfig, OpenAiEmbedder},
};

#[tokio::main]
async fn main() {
    let azure_config = AzureConfig::default()
        .with_api_key("REPLACE_ME_WITH_YOUR_API_KEY")
        .with_api_base("https://REPLACE_ME.openai.azure.com")
        .with_api_version("2023-05-15")
        .with_deployment_id("text-embedding-ada-002");

    let embedder = OpenAiEmbedder::new(azure_config);
    let result = embedder.embed_query("Why is the sky blue?").await.unwrap();
    println!("{:?}", result);
}