Skip to content

Artifact management with get_fast_api_app #309

Closed

Description

@sohaybmelgendy

Is your feature request related to a problem? Please describe.

I'm currently utilizing the get_fast_api_app() function from the ADK to initialize my FastAPI application.

app: FastAPI = get_fast_api_app(
    agent_dir       = AGENT_DIR,
    session_db_url  = SESSION_DB_URL,
    allow_origins   = ALLOWED_ORIGINS,
    web             = SERVE_WEB_INTERFACE
)

if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=8000)

While I can configure the session storage using the session_db_url parameter, I've encountered a limitation: there's no straightforward way to configure or override the artifact_service. This restricts my ability to manage artifacts using custom storage solutions.

Describe the solution you'd like

It would be beneficial to have the ability to specify a custom artifact_service when using get_fast_api_app(), similar to how session_db_url allows for session storage configuration. This could be achieved by adding an artifact_service parameter to the function, enabling developers to inject their preferred artifact storage mechanism.

Describe alternatives you've considered

As a workaround, I've attempted to subclass or monkey-patch the Runner instance created within get_fast_api_app(). However, due to the encapsulation of the Runner within the function's scope and the lack of exposure of its internal components, this approach is not feasible. The only viable alternative currently is to bypass get_fast_api_app() entirely and manually set up the FastAPI application and Runner, which negates the convenience that get_fast_api_app() is intended to provide.

Additional context

Providing a parameter to configure the artifact_service would align with the existing design pattern of get_fast_api_app() and enhance its flexibility. This addition would facilitate the integration of custom artifact storage solutions, thereby broadening the applicability of the ADK in diverse deployment scenarios.

Activity

  1. jeyong-shin commented on Apr 23, 2025

    @jeyong-shin

    Totally agree. artifact_service isn’t handled properly during agent deployment.

  2. self-assigned this
    on Apr 29, 2025
  3. added
    core
    on Apr 29, 2025
  4. added
    services
    and removed
    core
    on May 28, 2025
  5. DeanChensj commented on May 28, 2025

    @DeanChensj
    Collaborator

    Thanks for reporting this, we will add option to specify this in future release

  6. added this to the FixIt Week milestone on May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

services

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions