Skip to content

feat: Add LlamaIndexWorkflowAdapter #6278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

leehuwuj
Copy link

@leehuwuj leehuwuj commented May 12, 2025

Background

Support converting the workflow event stream from LlamaIndex to Vercel format.

Summary

  • Add a new adapter: LlamaIndexWorkflowAdapter which uses the new API (createDataStream) instead of transform DataStream (deprecated).
  • Keep the existing one of EngineResponse to avoid breaking changes and maintain compatibility with the shared code with Langchain AI.

Tasks

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • Formatting issues have been fixed (run pnpm prettier-fix in the project root)

data: T;
};

interface StreamCallbacks {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lgrammel we passed DataStreamWriter to let the callback code modify the datastream - might be generally useful for the existing stream callbacks

leehuwuj added 2 commits May 12, 2025 15:12
…ext clarity. Added a new example using the AI SDK's `LlamaIndexWorkflowAdapter` for streaming events, and revised existing text for better readability.
@marcusschiesser
Copy link
Contributor

@lgrammel please have a look, this PR is adding support for LlamaIndex Workflows (see https://ts.llamaindex.ai/docs/llamaindex/modules/agents/agent_workflow)

@lgrammel
Copy link
Collaborator

lgrammel commented May 12, 2025

This whole area is vastly changing in v5 - I would recommend making the changes to the v5 branch which has a separate package for llamaindex

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.

3 participants