mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
chore: Replace isinstance call with hasattr call
Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com> PiperOrigin-RevId: 869919864
This commit is contained in:
committed by
Copybara-Service
parent
811e50a0cb
commit
1d4b0f9ff5
@@ -41,12 +41,11 @@ class _ContentLlmRequestProcessor(BaseLlmRequestProcessor):
|
||||
async def run_async(
|
||||
self, invocation_context: InvocationContext, llm_request: LlmRequest
|
||||
) -> AsyncGenerator[Event, None]:
|
||||
from ...agents.llm_agent import LlmAgent
|
||||
from ...models.google_llm import Gemini
|
||||
|
||||
agent = invocation_context.agent
|
||||
preserve_function_call_ids = False
|
||||
if isinstance(agent, LlmAgent):
|
||||
if hasattr(agent, 'canonical_model'):
|
||||
canonical_model = agent.canonical_model
|
||||
preserve_function_call_ids = (
|
||||
isinstance(canonical_model, Gemini)
|
||||
|
||||
Reference in New Issue
Block a user