add logging config to audio server
add audio client change delimiter for mcp tools from "::" to ":" to save tokens
This commit is contained in:
@@ -2,6 +2,7 @@ use own_assist_common::config_loader::ConfigLoadingError;
|
||||
use std::collections::HashMap;
|
||||
use ollama_rs::headers::{HeaderMap, HeaderValue};
|
||||
use ollama_rs::Ollama;
|
||||
use own_mcp::audio::{AudioClient, AudioClientTrait};
|
||||
use rmcp::model::Implementation;
|
||||
use serde::Deserialize;
|
||||
use url::Url;
|
||||
@@ -12,10 +13,18 @@ use own_assist_common::config_from_file;
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct Config {
|
||||
ollama: OllamaConfig,
|
||||
#[serde(rename = "audio-server")]
|
||||
audio_server: AudioServerConfig,
|
||||
#[serde(rename = "mcp-servers")]
|
||||
mcp_servers: Vec<MCPServerConfig>
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct AudioServerConfig {
|
||||
url: Url,
|
||||
authorization: Option<String>,
|
||||
}
|
||||
|
||||
impl Config {
|
||||
pub fn from_file() -> Result<Self, ConfigLoadingError> {
|
||||
config_from_file("assist.toml")
|
||||
@@ -39,6 +48,15 @@ impl Config {
|
||||
ollama
|
||||
}
|
||||
|
||||
pub fn audio_client(&self) -> AudioClient {
|
||||
let mut audio_client = AudioClient::new(self.audio_server.url.clone());
|
||||
if let Some(authorization) = &self.audio_server.authorization {
|
||||
audio_client = audio_client.with_authorization(authorization.clone());
|
||||
}
|
||||
|
||||
audio_client
|
||||
}
|
||||
|
||||
pub async fn mcp_clients(&self) -> HashMap<String, MCPClient> {
|
||||
let mut mcp_clients: HashMap<String, MCPClient> = HashMap::new();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user