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

@ -4503,6 +4503,7 @@ async fn complete_with_google_ai(
session.http_client.clone(),
google_ai::API_URL,
api_key.as_ref(),
&request.model.clone(),
crate::ai::language_model_request_to_google_ai(request)?,
)
.await

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
);