initial commit

This commit is contained in:
Adil Hafeez 2025-05-08 14:07:23 -07:00
parent 1f95fac4af
commit 1d19f0c2f7
No known key found for this signature in database
GPG key ID: 9B18EF7691369645
36 changed files with 3003 additions and 109 deletions

View file

@ -166,6 +166,7 @@ pub struct LlmProvider {
pub endpoint: Option<String>,
pub port: Option<u16>,
pub rate_limits: Option<LlmRatelimit>,
pub usage: Option<String>,
}
impl Display for LlmProvider {

View file

@ -27,3 +27,4 @@ pub const HALLUCINATION_TEMPLATE: &str =
"It seems I'm missing some information. Could you provide the following details ";
pub const OTEL_COLLECTOR_HTTP: &str = "opentelemetry_collector_http";
pub const OTEL_POST_PATH: &str = "/v1/traces";
pub const LLM_ROUTE_HEADER: &str = "x-arch-llm-route";

View file

@ -2,6 +2,7 @@ use std::rc::Rc;
use crate::{configuration, llm_providers::LlmProviders};
use configuration::LlmProvider;
use log::info;
use rand::{seq::IteratorRandom, thread_rng};
#[derive(Debug)]
@ -29,6 +30,8 @@ pub fn get_llm_provider(
ProviderHint::Name(name) => llm_providers.get(&name),
});
info!("selected provider: maybe_provider: {:?}", maybe_provider);
if let Some(provider) = maybe_provider {
return provider;
}