Skip to content

Conversation

@claude89757
Copy link
Contributor

This commit addresses two issues with AG-UI FastAPI endpoint registration:

  1. Request body schema for Swagger UI: Added AGUIRequest Pydantic model to define the request body structure. This enables proper OpenAPI schema generation, making the Swagger UI functional for testing AG-UI endpoints.

  2. OpenAPI tags support: Added tags parameter to add_agent_framework_fastapi_endpoint() with a default value of ["AG-UI"]. This ensures endpoints are properly grouped in the OpenAPI documentation instead of falling into the "default" category.

Changes:

  • Added AGUIRequest Pydantic model in _types.py with fields:
    • messages: AG-UI format messages
    • run_id: Optional run identifier
    • thread_id: Optional thread identifier
    • state: Optional shared state for agentic generative UI
  • Modified add_agent_framework_fastapi_endpoint() to accept tags parameter and use AGUIRequest as the request body model
  • Added DEFAULT_TAGS constant exported from the module
  • Updated existing test for validation error handling (now returns 422)
  • Added comprehensive tests for new functionality

🤖 Generated with Claude Code

Motivation and Context

Description

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

This commit addresses two issues with AG-UI FastAPI endpoint registration:

1. **Request body schema for Swagger UI**: Added `AGUIRequest` Pydantic
   model to define the request body structure. This enables proper
   OpenAPI schema generation, making the Swagger UI functional for
   testing AG-UI endpoints.

2. **OpenAPI tags support**: Added `tags` parameter to
   `add_agent_framework_fastapi_endpoint()` with a default value of
   ["AG-UI"]. This ensures endpoints are properly grouped in the
   OpenAPI documentation instead of falling into the "default" category.

Changes:
- Added `AGUIRequest` Pydantic model in `_types.py` with fields:
  - `messages`: AG-UI format messages
  - `run_id`: Optional run identifier
  - `thread_id`: Optional thread identifier
  - `state`: Optional shared state for agentic generative UI
- Modified `add_agent_framework_fastapi_endpoint()` to accept `tags`
  parameter and use `AGUIRequest` as the request body model
- Added `DEFAULT_TAGS` constant exported from the module
- Updated existing test for validation error handling (now returns 422)
- Added comprehensive tests for new functionality

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@github-actions github-actions bot changed the title [Python] Fix AG-UI endpoint missing request body schema and tags Python: [Python] Fix AG-UI endpoint missing request body schema and tags Nov 23, 2025
@claude89757
Copy link
Contributor Author

@claude89757 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants