diff --git a/arch/arch_config_schema.yaml b/arch/arch_config_schema.yaml index 02014a45..49d3babc 100644 --- a/arch/arch_config_schema.yaml +++ b/arch/arch_config_schema.yaml @@ -4,9 +4,13 @@ properties: version: type: string tools: - type: object + type: array + items: + type: object agents: - type: object + type: array + items: + type: object listeners: type: object additionalProperties: false diff --git a/crates/agent_gateway/src/filter_context.rs b/crates/agent_gateway/src/filter_context.rs index 7320584a..92f3a1a0 100644 --- a/crates/agent_gateway/src/filter_context.rs +++ b/crates/agent_gateway/src/filter_context.rs @@ -82,8 +82,20 @@ impl RootContext for FilterContext { self.system_prompt = Rc::new(config.system_prompt); self.prompt_targets = Rc::new(prompt_targets); self.endpoints = Rc::new(config.endpoints); - self.agents = Rc::new(config.agents); - self.tools = Rc::new(config.tools); + //TOOD: check to make sure that agents name is unique + let agents_map: HashMap = config + .agents + .iter() + .map(|agent| (agent.name.clone(), agent.clone())) + .collect(); + self.agents = Rc::new(agents_map); + //TODO: check to make sure that tools name is unique + let tools_map: HashMap = config + .tools + .iter() + .map(|tool| (tool.name.clone(), tool.clone())) + .collect(); + self.tools = Rc::new(tools_map); if let Some(prompt_guards) = config.prompt_guards { self.prompt_guards = Rc::new(prompt_guards) diff --git a/crates/common/src/configuration.rs b/crates/common/src/configuration.rs index 3e72d4cf..a5987b6a 100644 --- a/crates/common/src/configuration.rs +++ b/crates/common/src/configuration.rs @@ -19,8 +19,8 @@ pub struct Configuration { pub ratelimits: Option>, pub tracing: Option, pub mode: Option, - pub agents: HashMap, - pub tools: HashMap, + pub agents: Vec, + pub tools: Vec, } #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/demos/ai_agent/agent_config copy.yaml b/demos/ai_agent/agent_config copy.yaml deleted file mode 100644 index c6eafde6..00000000 --- a/demos/ai_agent/agent_config copy.yaml +++ /dev/null @@ -1,76 +0,0 @@ -version: v0.1 - - -listeners: - ingress_traffic: - address: 0.0.0.0 - port: 10000 - message_format: openai - timeout: 30s - -llm_providers: - - name: gpt-4o - access_key: $OPENAI_API_KEY - provider_interface: openai - model: gpt-4o - -endpoints: - frankfurther_api: - endpoint: api.frankfurter.dev - protocol: https - -tools: - - name: get_exchange_rate - endpoint: - name: frankfurther_api - path: /v1/latest?base={currency_from}&symbols={currency_to} - params: - - name: currency_from - description: currency symbol to convert from - type: str - default: USD - - name: currency_to - description: currency symbol to convert to - type: str - default: EUR - -prompt_guards: - input_guards: - jailbreak: - on_exception: - message: Looks like you're curious about my abilities, but I can only provide assistance for currency exchange. - -agents: - - name: Currency Exchange Agent - description: Helps with exchange rates for currencies - default_input_modes: - - text - - text/plain - default_output_modes: - - text - - text/plain - skills: - - id: convert_currency - name: Currency Exchange Rates Tool - description: Helps with exchange values between various currencies - examples: - - What is exchange rate between USD and GBP? - capabilities: - streaming: true - push_notifications: true - model: gpt-4o - system_prompt: | - You are a specialized assistant for currency conversions. - Your sole purpose is to use the 'get_exchange_rate' tool to answer questions about currency exchange rates. - If the user asks about anything other than currency conversion or exchange rates, - politely state that you cannot help with that topic and can only assist with currency-related queries. - Do not attempt to answer unrelated questions or use tools for other purposes. - Set response status to input_required if the user needs to provide more information. - Set response status to error if there is an error while processing the request. - Set response status to completed if the request is complete. - tools: - - get_exchange_rate - -tracing: - random_sampling: 100 - trace_arch_internal: true diff --git a/demos/ai_agent/agent_config.yaml b/demos/ai_agent/agent_config.yaml index 52f62400..3e8c218c 100644 --- a/demos/ai_agent/agent_config.yaml +++ b/demos/ai_agent/agent_config.yaml @@ -1,6 +1,5 @@ version: v0.1 - listeners: ingress_traffic: address: 0.0.0.0 @@ -20,10 +19,9 @@ endpoints: protocol: https tools: - get_exchange_rate: - name: get_exchange_rate + - name: get_exchange_rate description: Get the latest exchange rate for a given currency pair - endpoint: + endpoint: name: frankfurther_api path: /v1/latest?base={currency_from}&symbols={currency_to} parameters: @@ -35,16 +33,14 @@ tools: description: currency symbol to convert to type: string default: EUR - get_list_of_supported_currencies: - name: get_list_of_supported_currencies + - name: get_list_of_supported_currencies description: Get the list of supported currencies - endpoint: + endpoint: name: frankfurther_api path: /v1/currencies agents: - currency_exchange_agent: - name: Currency Exchange Agent + - name: Currency Exchange Agent description: Helps with exchange rates for currencies default_input_modes: - text @@ -59,26 +55,26 @@ agents: examples: - What is exchange rate between USD and GBP? capabilities: - streaming: true - push_notifications: true + streaming: true + push_notifications: true agent_orchestrator_model: gpt-4o agent_orchestrator_prompt: | - You are a specialized assistant for currency conversions. - Your sole purpose is to use the 'get_exchange_rate' tool to answer questions about currency exchange rates. - If the user asks about anything other than currency conversion or exchange rates, - politely state that you cannot help with that topic and can only assist with currency-related queries. - Do not attempt to answer unrelated questions or use tools for other purposes. - Set response status to input_required if the user needs to provide more information. - Set response status to error if there is an error while processing the request. - Set response status to completed if the request is complete. + You are a specialized assistant for currency conversions. + Your sole purpose is to use the 'get_exchange_rate' tool to answer questions about currency exchange rates. + If the user asks about anything other than currency conversion or exchange rates, + politely state that you cannot help with that topic and can only assist with currency-related queries. + Do not attempt to answer unrelated questions or use tools for other purposes. + Set response status to input_required if the user needs to provide more information. + Set response status to error if there is an error while processing the request. + Set response status to completed if the request is complete. tools: - get_exchange_rate - get_list_of_supported_currencies model: gpt-4o system_prompt: | - You are a specialized currency exchange assistant. - Your task is to provide the user with the exchange rate between two currencies. - Keep the response concise and relevant to the user's query. + You are a specialized currency exchange assistant. + Your task is to provide the user with the exchange rate between two currencies. + Keep the response concise and relevant to the user's query. tracing: random_sampling: 100 trace_arch_internal: true diff --git a/demos/ai_agent/agent_config_mcp.yaml b/demos/ai_agent/agent_config_mcp.yaml deleted file mode 100644 index 54dd43d7..00000000 --- a/demos/ai_agent/agent_config_mcp.yaml +++ /dev/null @@ -1,58 +0,0 @@ -version: v0.1 - -listeners: - ingress_traffic: - address: 0.0.0.0 - port: 10000 - message_format: openai - timeout: 30s - -llm_providers: - - name: gpt-4o - access_key: $OPENAI_API_KEY - provider_interface: openai - model: gpt-4o - -endpoints: - - - name: frankfurther_api - endpoint: api.frankfurter.dev - protocol: https - - - name: twelvedata_api - endpoint: api.twelvedata.com - protocol: https - -mcp: - - - name: get_currency_exchange_rate - - name: get_list_of_supported_currencies - - name: get_stock_quote - -prompt_guards: - input_guards: - jailbreak: - on_exception: - message: Looks like you're curious about my abilities, but I can only provide assistance for currency exchange. - -agents: - - name: currency_exchange_agent - description: Agent for handling currency exchange queries - llm_provider: gpt-4o - system_prompt: | - You are a helpful assistant. Only respond to queries related to currency exchange. If there are any other questions, I can't help you. - tools: - - get_currency_exchange_rate - - get_list_of_supported_currencies - - - name: get_stock_quote_agent - description: Agent for handling stock quote queries - llm_provider: gpt-4o - system_prompt: | - You are a helpful stock exchange assistant. You are given stock symbol along with its exchange rate in json format. Your task is to parse the data and present it in a human-readable format. Keep the details to highlevel and be concise. - tools: - - get_stock_quote - -tracing: - random_sampling: 100 - trace_arch_internal: true