mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
fix(rust): update gateway message adapter
This commit is contained in:
parent
e218ab4e26
commit
12c02ddb04
2 changed files with 13 additions and 12 deletions
|
|
@ -51,22 +51,22 @@ pub async fn run(
|
|||
Value::String(upstream_model.to_string()),
|
||||
);
|
||||
|
||||
let options = RequestOptions {
|
||||
api_key: (deployment.litellm_params.api_key.as_deref()).map(|value| value.to_string()),
|
||||
api_base: (deployment.litellm_params.api_base.as_deref()).map(|value| value.to_string()),
|
||||
custom_llm_provider: (custom_llm_provider).map(|value| value.to_string()),
|
||||
extra_headers,
|
||||
timeout: None,
|
||||
..Default::default()
|
||||
};
|
||||
let request = MessagesRequest {
|
||||
model: provider_model,
|
||||
body,
|
||||
options: RequestOptions {
|
||||
api_key: (deployment.litellm_params.api_key.as_deref()).map(|value| value.to_string()),
|
||||
api_base: (deployment.litellm_params.api_base.as_deref())
|
||||
.map(|value| value.to_string()),
|
||||
custom_llm_provider: (custom_llm_provider).map(|value| value.to_string()),
|
||||
extra_headers,
|
||||
timeout: None,
|
||||
..Default::default()
|
||||
},
|
||||
};
|
||||
if request.body.get("stream").and_then(Value::as_bool) == Some(true) {
|
||||
return messages_stream(
|
||||
request,
|
||||
&options,
|
||||
&LiteLlmRequestContext {
|
||||
..Default::default()
|
||||
},
|
||||
|
|
@ -77,6 +77,7 @@ pub async fn run(
|
|||
|
||||
let response = messages(
|
||||
request,
|
||||
&options,
|
||||
&LiteLlmRequestContext {
|
||||
..Default::default()
|
||||
},
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
"limit": 0
|
||||
},
|
||||
"LIT006": {
|
||||
"limit": 1027
|
||||
"limit": 1022
|
||||
},
|
||||
"LIT007": {
|
||||
"limit": 0
|
||||
|
|
@ -27,10 +27,10 @@
|
|||
"limit": 0
|
||||
},
|
||||
"LIT010": {
|
||||
"limit": 16426
|
||||
"limit": 16419
|
||||
},
|
||||
"LIT011": {
|
||||
"limit": 5506
|
||||
"limit": 5497
|
||||
},
|
||||
"LIT012": {
|
||||
"limit": 4486
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue