add logging config to audio server
add audio client change delimiter for mcp tools from "::" to ":" to save tokens
This commit is contained in:
@@ -132,7 +132,7 @@ impl AgentChat {
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name`: must be in the format "mcp_server_name::tool_or_resource_name".
|
||||
/// * `name`: must be in the format "mcp_server_name:tool_or_resource_name".
|
||||
///
|
||||
/// returns:
|
||||
/// Ok(tuple) => tuple of the server name and the tool or resource name
|
||||
@@ -141,12 +141,12 @@ impl AgentChat {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```ignore
|
||||
/// let result = AgentChat::parse_tool_name("example::get_foo".to_string());
|
||||
/// let result = AgentChat::parse_tool_name("example:get_foo".to_string());
|
||||
/// assert_eq!(result.unwrap(), ("example".to_string(), "get_foo".to_string()))
|
||||
/// ```
|
||||
fn parse_tool_name(name: String) -> Result<(String, String), ChatError> {
|
||||
let (mcp_server_name, tool_name) = name
|
||||
.split_once("::")
|
||||
.split_once(":")
|
||||
.ok_or(ChatError::FunctionParseError(name.clone()))?;
|
||||
|
||||
Ok((mcp_server_name.to_string(), tool_name.to_string()))
|
||||
@@ -161,7 +161,7 @@ impl AgentChat {
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `mpc_server_data`:
|
||||
/// * `name`: must be in the format "mcp_server_name::tool_or_resource_name".
|
||||
/// * `name`: must be in the format "mcp_server_name:tool_or_resource_name".
|
||||
///
|
||||
/// returns: Option<&RestrictedTool>
|
||||
pub fn get_tool(
|
||||
@@ -352,7 +352,7 @@ mod tests {
|
||||
assert_eq!(tools.len(), 1);
|
||||
|
||||
assert_eq!(tools[0].permission, ToolPermission::Ask);
|
||||
chat.set_permission("test::echo".to_string(), ToolPermission::Allowed).unwrap();
|
||||
chat.set_permission("test:echo".to_string(), ToolPermission::Allowed).unwrap();
|
||||
|
||||
let tools: Vec<RestrictedTool> = chat.get_all_tools().cloned().collect();
|
||||
assert_eq!(tools[0].permission, ToolPermission::Allowed);
|
||||
|
||||
Reference in New Issue
Block a user