fix(openai): apply request_params to outgoing API payload (#9151)
Signed-off-by: Douwe Osinga <douwe@squareup.com> Co-authored-by: turbowindx <turbowindx@users.noreply.github.com> Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
@@ -1204,6 +1204,14 @@ pub fn create_request(
|
|||||||
payload["stream_options"] = json!({"include_usage": true});
|
payload["stream_options"] = json!({"include_usage": true});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(params) = &model_config.request_params {
|
||||||
|
if let Some(obj) = payload.as_object_mut() {
|
||||||
|
for (key, value) in params {
|
||||||
|
obj.insert(key.clone(), value.clone());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Ok(payload)
|
Ok(payload)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user