Fix token counting requests in Gemini (#29643)

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-04-29 22:55:07 -06:00 committed by GitHub
parent 8d77efa781
commit edf78e770d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View file

@ -76,12 +76,10 @@ pub async fn count_tokens(
client: &dyn HttpClient,
api_url: &str,
api_key: &str,
model_id: &str,
request: CountTokensRequest,
) -> Result<CountTokensResponse> {
let uri = format!(
"{}/v1beta/models/gemini-pro:countTokens?key={}",
api_url, api_key
);
let uri = format!("{api_url}/v1beta/models/{model_id}:countTokens?key={api_key}",);
let request = serde_json::to_string(&request)?;
let request_builder = HttpRequest::builder()