mirror of
https://github.com/katanemo/plano.git
synced 2026-07-05 15:52:12 +02:00
fix more
This commit is contained in:
parent
31c21a5491
commit
d994a4c8f5
4 changed files with 9 additions and 9 deletions
|
|
@ -344,7 +344,7 @@ impl HttpContext for StreamContext {
|
||||||
|
|
||||||
info!(
|
info!(
|
||||||
"on_http_request_body: provider: {}, model requested (in body): {}, model selected: {}",
|
"on_http_request_body: provider: {}, model requested (in body): {}, model selected: {}",
|
||||||
self.llm_provider().provider_interface,
|
self.llm_provider().name,
|
||||||
model_requested,
|
model_requested,
|
||||||
model_name.unwrap_or(&"None".to_string()),
|
model_name.unwrap_or(&"None".to_string()),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -266,7 +266,7 @@ fn llm_gateway_bad_request_to_open_ai_chat_completions() {
|
||||||
.expect_get_buffer_bytes(Some(BufferType::HttpRequestBody))
|
.expect_get_buffer_bytes(Some(BufferType::HttpRequestBody))
|
||||||
.returning(Some(incomplete_chat_completions_request_body))
|
.returning(Some(incomplete_chat_completions_request_body))
|
||||||
.expect_log(Some(LogLevel::Debug), None)
|
.expect_log(Some(LogLevel::Debug), None)
|
||||||
.expect_log(Some(LogLevel::Info), Some("on_http_request_body: provider: openai, model requested (in body): gpt-1, model selected: gpt-4"))
|
.expect_log(Some(LogLevel::Info), Some("on_http_request_body: provider: open-ai-gpt-4, model requested (in body): gpt-1, model selected: gpt-4"))
|
||||||
.expect_send_local_response(
|
.expect_send_local_response(
|
||||||
Some(StatusCode::BAD_REQUEST.as_u16().into()),
|
Some(StatusCode::BAD_REQUEST.as_u16().into()),
|
||||||
None,
|
None,
|
||||||
|
|
@ -432,7 +432,7 @@ fn llm_gateway_override_model_name() {
|
||||||
.returning(Some(chat_completions_request_body))
|
.returning(Some(chat_completions_request_body))
|
||||||
// The actual call is not important in this test, we just need to grab the token_id
|
// The actual call is not important in this test, we just need to grab the token_id
|
||||||
.expect_log(Some(LogLevel::Debug), None)
|
.expect_log(Some(LogLevel::Debug), None)
|
||||||
.expect_log(Some(LogLevel::Info), Some("on_http_request_body: provider: openai, model requested (in body): gpt-1, model selected: gpt-4"))
|
.expect_log(Some(LogLevel::Info), Some("on_http_request_body: provider: open-ai-gpt-4, model requested (in body): gpt-1, model selected: gpt-4"))
|
||||||
.expect_log(Some(LogLevel::Debug), None)
|
.expect_log(Some(LogLevel::Debug), None)
|
||||||
.expect_log(Some(LogLevel::Debug), None)
|
.expect_log(Some(LogLevel::Debug), None)
|
||||||
.expect_metric_record("input_sequence_length", 29)
|
.expect_metric_record("input_sequence_length", 29)
|
||||||
|
|
@ -481,7 +481,7 @@ fn llm_gateway_override_use_default_model() {
|
||||||
// The actual call is not important in this test, we just need to grab the token_id
|
// The actual call is not important in this test, we just need to grab the token_id
|
||||||
.expect_log(
|
.expect_log(
|
||||||
Some(LogLevel::Info),
|
Some(LogLevel::Info),
|
||||||
Some("on_http_request_body: provider: openai, model requested (in body): gpt-1, model selected: gpt-4"),
|
Some("on_http_request_body: provider: open-ai-gpt-4, model requested (in body): gpt-1, model selected: gpt-4"),
|
||||||
)
|
)
|
||||||
.expect_log(Some(LogLevel::Debug), None)
|
.expect_log(Some(LogLevel::Debug), None)
|
||||||
.expect_log(Some(LogLevel::Debug), None)
|
.expect_log(Some(LogLevel::Debug), None)
|
||||||
|
|
@ -529,7 +529,7 @@ fn llm_gateway_override_use_model_name_none() {
|
||||||
.returning(Some(chat_completions_request_body))
|
.returning(Some(chat_completions_request_body))
|
||||||
// The actual call is not important in this test, we just need to grab the token_id
|
// The actual call is not important in this test, we just need to grab the token_id
|
||||||
.expect_log(Some(LogLevel::Debug), None)
|
.expect_log(Some(LogLevel::Debug), None)
|
||||||
.expect_log(Some(LogLevel::Info), Some("on_http_request_body: provider: openai, model requested (in body): none, model selected: gpt-4"))
|
.expect_log(Some(LogLevel::Info), Some("on_http_request_body: provider: open-ai-gpt-4, model requested (in body): none, model selected: gpt-4"))
|
||||||
.expect_log(Some(LogLevel::Debug), None)
|
.expect_log(Some(LogLevel::Debug), None)
|
||||||
.expect_log(Some(LogLevel::Debug), None)
|
.expect_log(Some(LogLevel::Debug), None)
|
||||||
.expect_metric_record("input_sequence_length", 29)
|
.expect_metric_record("input_sequence_length", 29)
|
||||||
|
|
|
||||||
|
|
@ -15,14 +15,14 @@ llm_providers:
|
||||||
name: openai/gpt-4o
|
name: openai/gpt-4o
|
||||||
provider_interface: openai
|
provider_interface: openai
|
||||||
routing_preferences:
|
routing_preferences:
|
||||||
- description: b
|
- description: generating new code snippets, functions, or boilerplate based on user prompts or requirements
|
||||||
name: code understanding
|
name: code generation
|
||||||
- access_key: $OPENAI_API_KEY
|
- access_key: $OPENAI_API_KEY
|
||||||
model: gpt-4.1
|
model: gpt-4.1
|
||||||
name: openai/gpt-4.1
|
name: openai/gpt-4.1
|
||||||
provider_interface: openai
|
provider_interface: openai
|
||||||
routing_preferences:
|
routing_preferences:
|
||||||
- description: a
|
- description: understand and explain existing code snippets, functions, or libraries
|
||||||
name: code understanding
|
name: code understanding
|
||||||
tracing:
|
tracing:
|
||||||
random_sampling: 100
|
random_sampling: 100
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ Content-Type: application/json
|
||||||
HTTP 200
|
HTTP 200
|
||||||
[Asserts]
|
[Asserts]
|
||||||
header "content-type" == "application/json"
|
header "content-type" == "application/json"
|
||||||
jsonpath "$.model" matches /^gpt-4o-mini/
|
jsonpath "$.model" matches /^gpt-4.1/
|
||||||
jsonpath "$.usage" != null
|
jsonpath "$.usage" != null
|
||||||
jsonpath "$.choices[0].message.content" != null
|
jsonpath "$.choices[0].message.content" != null
|
||||||
jsonpath "$.choices[0].message.role" == "assistant"
|
jsonpath "$.choices[0].message.role" == "assistant"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue