diff --git a/arch/src/stream_context.rs b/arch/src/stream_context.rs index 7a099afb..e16ae160 100644 --- a/arch/src/stream_context.rs +++ b/arch/src/stream_context.rs @@ -524,32 +524,17 @@ impl StreamContext { debug!("tool_params: {}", tool_params_json_str); let endpoint = prompt_target.endpoint.unwrap(); - let mut path = endpoint.path.unwrap_or(String::from("/")); - let method = endpoint - .method - .unwrap_or(public_types::configuration::Method::Post); - let mut body = Some(tool_params_json_str.as_bytes()); - if method == public_types::configuration::Method::Post { - let mut query_params = vec![]; - for (key, value) in tool_params { - query_params.push(format!("{}={}", key, format!("{:?}", value))); - } - let path_args = &query_params.join("&"); - path.push_str("?"); - path.push_str(path_args); - } else { - body = None; - } + let path: String = endpoint.path.unwrap_or(String::from("/")); let token_id = match self.dispatch_http_call( &endpoint.name, vec![ - (":method", method.to_string().as_str()), + (":method", "POST"), (":path", path.as_ref()), (":authority", endpoint.name.as_str()), ("content-type", "application/json"), ("x-envoy-max-retries", "3"), ], - body, + Some(tool_params_json_str.as_bytes()), vec![], Duration::from_secs(5), ) { diff --git a/docs/source/_config/prompt-config-full-reference.yml b/docs/source/_config/prompt-config-full-reference.yml index 58bfb1ed..dff5aaa3 100644 --- a/docs/source/_config/prompt-config-full-reference.yml +++ b/docs/source/_config/prompt-config-full-reference.yml @@ -94,7 +94,6 @@ prompt_targets: endpoint: name: app_server path: "/agent/summary" - method: Post # Arch uses the default LLM and treats the response from the endpoint as the prompt to send to the LLM auto_llm_dispatch_on_response: true # override system prompt for this prompt target diff --git a/public_types/src/configuration.rs b/public_types/src/configuration.rs index eaf48245..1abb7e46 100644 --- a/public_types/src/configuration.rs +++ b/public_types/src/configuration.rs @@ -165,44 +165,6 @@ pub struct Parameter { pub struct EndpointDetails { pub name: String, pub path: Option, - pub method: Option, -} - - -#[derive(Debug, Clone, Serialize, PartialEq, Eq, Hash)] -#[serde(rename_all = "UPPERCASE")] -pub enum Method { - Get, - Post, - Put, - Delete, -} - -impl ToString for Method { - fn to_string(&self) -> String { - match self { - Method::Get => "GET".to_string(), - Method::Post => "POST".to_string(), - Method::Put => "PUT".to_string(), - Method::Delete => "DELETE".to_string(), - } - } -} - -impl<'de> Deserialize<'de> for Method { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - match s.to_uppercase().as_str() { - "GET" => Ok(Method::Get), - "POST" => Ok(Method::Post), - "PUT" => Ok(Method::Put), - "DELETE" => Ok(Method::Delete), - _ => Err(serde::de::Error::custom(format!("Invalid enum variant: {}", s))), - } - } } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -284,10 +246,6 @@ mod test { prompt_target.endpoint.as_ref().unwrap().path, Some("/agent/summary".to_string()) ); - assert_eq!( - prompt_target.endpoint.as_ref().unwrap().method.as_ref().unwrap().to_string(), - "POST".to_string() - ); let error_target = config.error_target.as_ref().unwrap(); assert_eq!(