mirror of
https://github.com/EvolutionAPI/adk-python.git
synced 2025-07-13 15:14:50 -06:00
fix: remove labels from config when using API key from Google AI Studio to call model
PiperOrigin-RevId: 765448305
This commit is contained in:
parent
3ec496dd81
commit
5d297169d0
@ -83,7 +83,7 @@ class Gemini(BaseLlm):
|
||||
Yields:
|
||||
LlmResponse: The model response.
|
||||
"""
|
||||
|
||||
self._preprocess_request(llm_request)
|
||||
self._maybe_append_user_content(llm_request)
|
||||
logger.info(
|
||||
'Sending out request, model: %s, backend: %s, stream: %s',
|
||||
@ -237,6 +237,12 @@ class Gemini(BaseLlm):
|
||||
) as live_session:
|
||||
yield GeminiLlmConnection(live_session)
|
||||
|
||||
def _preprocess_request(self, llm_request: LlmRequest) -> None:
|
||||
|
||||
if llm_request.config and self._api_backend == 'ml_dev':
|
||||
# Using API key from Google AI Studio to call model doesn't support labels.
|
||||
llm_request.config.labels = None
|
||||
|
||||
|
||||
def _build_function_declaration_log(
|
||||
func_decl: types.FunctionDeclaration,
|
||||
|
Loading…
Reference in New Issue
Block a user