Respect requested gemini model (#13427)

Previously, we always went to gemini-pro.

Release Notes:

- N/A
This commit is contained in:
Nathan Sobo 2024-06-23 14:10:31 -06:00 committed by GitHub
parent 9298d3b525
commit 5b754915e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -11,10 +11,11 @@ pub async fn stream_generate_content(
client: Arc<dyn HttpClient>,
api_url: &str,
api_key: &str,
model: &str,
request: GenerateContentRequest,
) -> Result<BoxStream<'static, Result<GenerateContentResponse>>> {
let uri = format!(
"{}/v1beta/models/gemini-pro:streamGenerateContent?alt=sse&key={}",
"{}/v1beta/models/{model}:streamGenerateContent?alt=sse&key={}",
api_url, api_key
);