diff --git a/crates/prompt_gateway/src/stream_context.rs b/crates/prompt_gateway/src/stream_context.rs index b8a5007f..9782698e 100644 --- a/crates/prompt_gateway/src/stream_context.rs +++ b/crates/prompt_gateway/src/stream_context.rs @@ -263,6 +263,10 @@ impl StreamContext { ); } + // update prompt target name from the tool call + callout_context.prompt_target_name = + Some(self.tool_calls.as_ref().unwrap()[0].function.name.clone()); + self.schedule_api_call_request(callout_context); } @@ -359,8 +363,8 @@ impl StreamContext { let http_status = self .get_http_call_response_header(":status") .unwrap_or(StatusCode::OK.as_str().to_string()); - debug!("api_call_response_handler: http_status: {}", http_status); - if http_status != StatusCode::OK.as_str() { + debug!("api_call_response_handler: http_status: {}", http_status); + if http_status != StatusCode::OK.as_str() { warn!( "api server responded with non 2xx status code: {}", http_status diff --git a/tests/rest/api_prompt_gateway.rest b/tests/rest/api_prompt_gateway.rest index 537b06ac..db06cafe 100644 --- a/tests/rest/api_prompt_gateway.rest +++ b/tests/rest/api_prompt_gateway.rest @@ -100,3 +100,17 @@ Content-Type: application/json ], "stream": true } + +### currency conversion test +POST {{prompt_endpoint}}/v1/chat/completions HTTP/1.1 +Content-Type: application/json + +{ + "model": "--", + "messages": [ + { + "role": "user", + "content": "can you please convert 100 jpy" + } + ] +}