Skip to content

docs(ag-ui): fix the router import path and install extra in the README - #23746

Open
ninglinLiu wants to merge 1 commit into
run-llama:mainfrom
ninglinLiu:docs/ag-ui-readme-router-import
Open

ninglinLiu wants to merge 1 commit into
run-llama:mainfrom
ninglinLiu:docs/ag-ui-readme-router-import

Conversation

@ninglinLiu

Copy link
Copy Markdown

Description

The AG-UI integration README's server example does not run as written:

  • It imports get_ag_ui_workflow_router from llama_index.protocols.ag_ui.server, but the package has no server module, so the example fails with ModuleNotFoundError: No module named 'llama_index.protocols.ag_ui.server'. The factory lives in llama_index.protocols.ag_ui.router (which is also what the package tests import).
  • router.py imports fastapi at module level, but FastAPI is only installed through the package's fastapi extra ([project.optional-dependencies]). With the README's pip install llama-index-protocols-ag-ui, importing the router fails with No module named 'fastapi'.

Changes (README only):

  • Import from llama_index.protocols.ag_ui.router.
  • Install with pip install "llama-index-protocols-ag-ui[fastapi]" and note that the example also needs uvicorn.
  • List the two router parameters the README was missing (timeout, workflow_factory), matching get_ag_ui_workflow_router's signature.

Checked in a clean venv with llama-index-protocols-ag-ui==0.6.0: the .server import raises ModuleNotFoundError, the router import fails without FastAPI, and from llama_index.protocols.ag_ui.router import get_ag_ui_workflow_router works once the fastapi extra is installed.

AI disclosure: I used an AI assistant to help find this and draft the change. I reviewed the diff and verified the imports locally.

New Package?

  • Yes
  • No

Version Bump?

  • Yes
  • No

Type of Change

  • This change requires a documentation update

How Has This Been Tested?

  • I believe this change is already covered by existing unit tests (README only)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant