8000 Agent Raw response thought instead of final result · Issue #1109 · google/adk-python · GitHub
[go: up one dir, main page]

Skip to content
Agent Raw response thought instead of final result #1109
Open
@momo-tuannguyen12

Description

@momo-tuannguyen12

Describe the bug


message = types.Content(role="user", parts=[types.Part(text=message_text)])
async for event in self.runner.run_async(user_id=self.user_id, session_id=self.session_id, new_message=message):
    if event.is_final_response():
        # validate to ensure text is not empty
        # Get the text content safely using attribute chaining with conditional expressions
        # Dont use getattr
        parts = event.content.parts if event.content else None
        if not parts:
            logger.error(f"reasoning_agent error: event content is empty {event}")

        # find text in part item from index 0
        for part in parts:
            if part.text:
                return part.text

Root agent has sub agent [jira_pm_agent]
When chatting with root agent, it responses a thinking result instead of text
The Raw response: bellow

`INFO:google_genai.models:AFC is enabled with max remote calls: 10.24INFO:httpx:HTTP Request: POST https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro-preview-05-06:generateContent "HTTP/1.1 200 OK"

WARNING:google_genai.types:Warning: there are non-text parts in the response: ['thought_signature', 'function_call'], returning concatenated text result from text parts. Check the full candidates.content.parts accessor to get the full model response

INFO:google_adk.google.adk.models.google_llm:LLM

Function calls:15name: transfer_to_agent, args: {'agent_name': 'jira_pm_agent'}

Raw response: {"candidates":[{"content":{"parts":[{"thought":true,"thought_signature":"AVSoXO5-FQYYhIVP-dtGqxAgdu2KFCqFUlaBKotkovKCRWHrqSevXmgwRj-Qwlfb-SrNAWq-4XtYYOw6CyhmrEV3Ssh1sz3kjeodwrWLuhcqlMnzDpvhhaw8-qkPjRDUDiKKjU9K4qjMfoULxnbdEkU2DOr8cVwQIj29ek8zmng-690aFwDo_IVRTNUfiO32MgITS6AcbjyT-oNWkFGoSFDP8AGRjd-9cSyKZ0sHJULE21rRT8Yvn8Q38WDSiSY6Ap3iTYgzNAjocK6sgOV2gNoVenfuKhW50m3r"},{"function_call":{"args":{"agent_name":"jira_pm_agent"},"name":"transfer_to_agent"}}],"role":"model"},"finish_reason":"STOP","index":0}],"model_version":"models/gemini-2.5-pro-preview-05-06","usage_metadata":{"candidates_token_count":23,"prompt_token_count":3533,"prompt_tokens_details":[{"modality":"TEXT","token_count":3533}],"thoughts_token_count":48,"total_token_count":3604},"automatic_function_calling_history":[]}

INFO:google_adk.google.adk.sessions.database_session_service:Append event: content=Content(parts=[Part(video_metadata=None, thought=True, inline_data=None, file_data=None, thought_signature=b'\x01T\xa8\\xee~\x15\x06\x18\x84\x85O\xf9\xdbF\xab\x10 v\xed\x8a\x14*\x85RV\x81*\x8bd\xa2\xf2\x82Ea\xeb\xa9'\xaf^h0F?\x90\xc2W\xdb\xf9*\xcd\x01j\xbe\xe1{X\xec:\x0b(f\xacEwJ\xc8u\xb3=\xe4\x8d\xea\x1d\xc2\xb5\x8b\xba\x17*\x94\xc9\xf3\x0e\x9b\xe1\x85\xac<\xfa\xa9\x0f\x8d\x10\xd4\x0e"\x8a\x8dOJ\xe2\xa8\xcc~\x85\x0b\xc6v\xdd\x12E6\x0c\xea\xfcq\\\x10"=\xbdzO3\x9ax>\xeb\xdd\x1a\x17\x00\xe8\xfc\x85QL\xd5\x1f\x88\xed\xf62\x02\x13K\xa0\x1cn<\x93\xfa\x83V\x90Q\xa8HP\xcf\xf0\x01\x91\x8d\xdf\xbdq,\x8agK\x07%B\xc4\xdbZ\xd1O\xc6/\x9f\xc47\xf1\xd2\x89&:\x02\x9d\xe2M\x8834\x08\xe8p\xae\xac\x80\xe5v\x80\xda\x15zw\xee*\x15\xb9\xd2m\xeb', code_execution_result=None, executable_code=None, function_call=None, function_response=None, text=None), Part(video_metadata=None, thought=None, inline_data=None, file_data=None, thought_signature=None, code_execution_result=None, executable_code=None, function_call=FunctionCall(id='adk-98ee55d2-65b5-4fb9-a94c-ed59cda7397d', args={'agent_name': 'jira_pm_agent'}, name='transfer_to_agent'), function_response=None, text=None)], role='model') grounding_metadata=None partial=None turn_complete=None error_code=None error_message=None interrupted=None custom_metadata=None usage_metadata=GenerateContentResponseUsageMetadata(cache_tokens_details=None, cached_content_token_count=None, candidates_token_count=23, candidates_tokens_details=None, prompt_token_count=3533, prompt_tokens_details=[ModalityTokenCount(modality=<MediaModality.TEXT: 'TEXT'>, token_count=3533)], thoughts_token_count=48, tool_use_prompt_token_count=None, tool_use_prompt_tokens_details=None, total_token_count=3604, traffic_type=None) invocation_id='e-e9df368f-df6f-423e-9876-247d6360f5fe' author='reasoning_agent' actions=EventActions(skip_summarization=None, state_delta={}, artifact_delta={}, transfer_to_agent=None, escalate=None, requested_auth_configs={}) long_running_tool_ids=set() branch=None id='PXYF5U0a' timestamp=1748927375.897826 to session spaces/AAAAYmNaT6E_spaces/AAAAYmNaT6E/threads/I6Og_VKLxeM_SPACE820`

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Python version(python -V): 3.1.12
  • ADK version(pip show google-adk): 1.0.0
Image

Metadata

Metadata

Assignees

Labels

coreIssues related to the core interface and implementation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0