weft-core 0.1.1

OpenAI-compatible AI agent runtime with WASM capability plugin system
Documentation
1
2
3
4
5
6
7
8
9
10
11
use crate::config::ProviderConfig;
use crate::types::ChatRequest;
use anyhow::Result;
use async_trait::async_trait;

#[async_trait]
pub trait RouterLayer: Send + Sync {
    /// Choose which provider should handle this request.
    /// Returns the provider name.
    async fn route(&self, request: &ChatRequest, providers: &[ProviderConfig]) -> Result<String>;
}