Skip to content

Artifact/File Upload example not clear #194

Closed

Description

@QAInsights

** Please make sure you read the contribution guide and file the issues in the rigth place. **
Contribution guide.

Describe the bug
Artifact/File Upload example not clear

To Reproduce
Steps to reproduce the behavior:

  1. Follow the artifact/file upload example

Expected behavior
File should get uploaded/read by agent.

Screenshots
NA

Desktop (please complete the following information):

  • OS: Windows
  • Python version(python -V): 3.12.8
  • ADK version(pip show google-adk): 0.1.0

Additional context

Failed to parse the parameter context: google.adk.agents.callback_context.CallbackContext of function on_file_upload for automatic function calling.Automatic function calling works best with simpler function signature schema,consider manually parse your function declaration for function on_file_upload.

Activity

  1. self-assigned this
    on Apr 15, 2025
  2. boyangsvl commented on Apr 19, 2025

    @boyangsvl
    Collaborator

    Could you provide a full stack trace?

  3. QAInsights commented on Apr 19, 2025

    @QAInsights
    Author

    @boyangsvl

    ERROR - fast_api.py:616 - Error in event_generator: Failed to parse the parameter context: google.adk.agents.callback_context.CallbackContext of function save_generated_report for automatic function calling.Automatic function calling works best with simpler function signature schema,consider manually parse your function declaration for function save_generated_report.
    Traceback (most recent call last):
      File "/Users/naveenkumar/Gits/perf_tools_google_agent/.venv/lib/python3.12/site-packages/google/adk/cli/fast_api.py", line 605, in event_generator
        async for event in runner.run_async(
      File "/Users/naveenkumar/Gits/perf_tools_google_agent/.venv/lib/python3.12/site-packages/google/adk/runners.py", line 197, in run_async
        async for event in invocation_context.agent.run_async(invocation_context):
      File "/Users/naveenkumar/Gits/perf_tools_google_agent/.venv/lib/python3.12/site-packages/google/adk/agents/base_agent.py", line 141, in run_async
        async for event in self._run_async_impl(ctx):
      File "/Users/naveenkumar/Gits/perf_tools_google_agent/.venv/lib/python3.12/site-packages/google/adk/agents/llm_agent.py", line 232, in _run_async_impl
        async for event in self._llm_flow.run_async(ctx):
      File "/Users/naveenkumar/Gits/perf_tools_google_agent/.venv/lib/python3.12/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 231, in run_async
        async for event in self._run_one_step_async(invocation_context):
      File "/Users/naveenkumar/Gits/perf_tools_google_agent/.venv/lib/python3.12/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 245, in _run_one_step_async
        async for event in self._preprocess_async(invocation_context, llm_request):
      File "/Users/naveenkumar/Gits/perf_tools_google_agent/.venv/lib/python3.12/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 283, in _preprocess_async
        await tool.process_llm_request(
      File "/Users/naveenkumar/Gits/perf_tools_google_agent/.venv/lib/python3.12/site-packages/google/adk/tools/base_tool.py", line 96, in process_llm_request
        if (function_declaration := self._get_declaration()) is None:
                                    ^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/naveenkumar/Gits/perf_tools_google_agent/.venv/lib/python3.12/site-packages/google/adk/tools/function_tool.py", line 42, in _get_declaration
        build_function_declaration(
      File "/Users/naveenkumar/Gits/perf_tools_google_agent/.venv/lib/python3.12/site-packages/google/adk/tools/_automatic_function_calling_util.py", line 232, in build_function_declaration
        from_function_with_options(func, variant)
      File "/Users/naveenkumar/Gits/perf_tools_google_agent/.venv/lib/python3.12/site-packages/google/adk/tools/_automatic_function_calling_util.py", line 309, in from_function_with_options
        schema = function_parameter_parse_util._parse_schema_from_parameter(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/naveenkumar/Gits/perf_tools_google_agent/.venv/lib/python3.12/site-packages/google/adk/tools/function_parameter_parse_util.py", line 292, in _parse_schema_from_parameter
        raise ValueError(
    ValueError: Failed to parse the parameter context: google.adk.agents.callback_context.CallbackContext of function save_generated_report for automatic function calling.Automatic function calling works best with simpler function signature schema,consider manually parse your function declaration for function save_generated_report.
    
  4. hangfei commented on May 31, 2025

    @hangfei
    Collaborator

    Could you retry if this is fixed in latest wheel? @QAInsights

  5. added
    documentation
    on Jun 6, 2025
  6. dominicdev commented on Jun 12, 2025

    @dominicdev

    how to upload file for artifact? example if none web

  7. DeanChensj commented on Jun 16, 2025

    @DeanChensj
    Collaborator
  8. saeed-git-123 commented on Aug 20, 2025

    @saeed-git-123

    Could you provide a full stack trace?

    Hello, Is there any solution for this??
    Have you found a way to upload a file via the ADK web UI, save it as an artifact, and then load it for use in subsequent functions?"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

documentation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions