Skip to content

Conversation

@leehuwuj
Copy link
Collaborator

@leehuwuj leehuwuj commented May 7, 2025

Update package after this PR is released: #592

Summary by CodeRabbit

  • New Features

    • Introduced new TypeScript artifact workflows for code and document generation, including event-driven logic and UI state updates.
    • Added a README template for the TypeScript artifact workflow to guide setup and usage.
  • Bug Fixes

    • Corrected documentation to reference the correct custom UI component file in the Deep Research workflow.
  • Refactor

    • Migrated Deep Research and Financial Report workflows to a functional, middleware-driven architecture for improved modularity and event handling.
    • Simplified and unified import statements across various TypeScript workflow components.
  • Chores

    • Updated dependencies for several templates, including version bumps and additions for llama-parse, @llamaindex/workflow, and llamaindex.
    • Enhanced file copying logic to include all relevant TypeScript workflow files.
    • Adjusted prompts to always request language selection, regardless of app type.
  • Documentation

    • Added and updated README files to improve onboarding and clarify workflow setup instructions.

@changeset-bot
Copy link

changeset-bot bot commented May 7, 2025

🦋 Changeset detected

Latest commit: afcd53e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-llama Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented May 7, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update introduces new TypeScript artifact workflows, refactors existing workflows to use a middleware-driven event-based architecture, updates dependencies, and adds documentation. It also standardizes import paths, enhances workflow event schemas, and modifies file copying logic for workflow templates. Several dependency versions are updated or added across templates.

Changes

File(s) Change Summary
.changeset/fluffy-otters-refuse.md, .changeset/yummy-moles-lick.md Added changeset files documenting patch updates for the creation of a TypeScript artifact use case and the adoption of a new workflow engine in TypeScript use cases.
packages/create-llama/helpers/typescript.ts Broadened file copy operation to include all .ts files and updated @llamaindex/readers dependency version when backend flag is true.
packages/create-llama/questions/simple.ts Removed conditional, so language selection prompt now always appears regardless of appType.
packages/create-llama/templates/components/llamaindex/typescript/documents/upload.ts, packages/create-llama/templates/components/vectordbs/llamaindexserver/llamacloud/typescript/index.ts, packages/create-llama/templates/components/vectordbs/typescript/llamacloud/index.ts Consolidated and standardized import statements for LlamaCloudIndex.
packages/create-llama/templates/components/reflex/contract_review/pyproject.toml, packages/create-llama/templates/components/reflex/extractor/pyproject.toml, packages/create-llama/templates/types/streaming/fastapi/pyproject.toml Added llama-parse>=0.6.21,<0.7.0 to dependencies.
packages/create-llama/templates/components/workflows/typescript/agentic_rag/workflow.ts Changed import of agent from "llamaindex" to "@llamaindex/workflow".
packages/create-llama/templates/components/workflows/typescript/artifacts/README-template.md Added a new README template for TypeScript artifact workflow projects, explaining setup, usage, and workflow switching.
packages/create-llama/templates/components/workflows/typescript/artifacts/code-workflow.ts, packages/create-llama/templates/components/workflows/typescript/artifacts/doc-workflow.ts Introduced new TypeScript modules for code and document artifact workflows using event-driven, stateful middleware and Zod schemas for event validation.
packages/create-llama/templates/components/workflows/typescript/artifacts/workflow.ts Added a workflow factory module for artifact workflows, defaulting to code workflow and supporting future document workflow integration.
packages/create-llama/templates/components/workflows/typescript/deep_research/README-template.md Corrected file path reference for the custom UI component in documentation.
packages/create-llama/templates/components/workflows/typescript/deep_research/workflow.ts Refactored from a class-based to a functional, middleware-driven workflow using event handlers and stateful middleware.
packages/create-llama/templates/components/workflows/typescript/financial_report/workflow.ts Refactored from a class-based to a functional, event-driven workflow using middleware and event handler registration.
packages/create-llama/templates/types/llamaindexserver/nextjs/package.json Updated dependencies: removed @llamaindex/readers, added @llamaindex/workflow, and bumped versions for @llamaindex/server and llamaindex.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Frontend
    participant WorkflowFactory
    participant Workflow
    participant LLM

    User->>Frontend: Submit input
    Frontend->>WorkflowFactory: Send request with input
    WorkflowFactory->>Workflow: Create workflow instance
    Workflow->>Workflow: Handle startAgentEvent (store input)
    Workflow->>LLM: Plan (analyze input/context)
    LLM-->>Workflow: Return requirement/plan
    Workflow->>Workflow: Decide next step (coding or answering)
    alt Coding
        Workflow->>LLM: Generate code artifact
        LLM-->>Workflow: Return code
        Workflow->>Frontend: Emit artifact and UI events
    end
    Workflow->>LLM: Synthesize answer/explanation
    LLM-->>Workflow: Stream response
    Workflow->>Frontend: Stream agent events and stop event
Loading

Possibly related PRs

  • run-llama/create-llama#552: Conflicts with this PR by adding a DeepResearchEvent class to the deep research workflow, while this PR removes the class in favor of a functional event system.
  • run-llama/create-llama#566: Refactors Deep Research workflow UI events to use Zod schemas and a new UIEvent class, related to this PR's focus on typed UI event schemas in workflows.
  • run-llama/create-llama#570: Updates dependency versions in the same Next.js template as this PR, though with a different scope and set of packages.

Suggested reviewers

  • leehuwuj

Poem

🐇
Hopping through workflows, TypeScript in tow,
Event-driven bunnies, middleware in the flow.
Artifacts and documents, Zod schemas in hand,
Refactored old classes, now functions are grand!
With dependencies fresh and imports aligned,
This patch leaves no carrot behind.
🥕

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0384268 and afcd53e.

📒 Files selected for processing (19)
  • .changeset/fluffy-otters-refuse.md (1 hunks)
  • .changeset/yummy-moles-lick.md (1 hunks)
  • packages/create-llama/helpers/typescript.ts (2 hunks)
  • packages/create-llama/questions/simple.ts (1 hunks)
  • packages/create-llama/templates/components/llamaindex/typescript/documents/upload.ts (1 hunks)
  • packages/create-llama/templates/components/reflex/contract_review/pyproject.toml (1 hunks)
  • packages/create-llama/templates/components/reflex/extractor/pyproject.toml (1 hunks)
  • packages/create-llama/templates/components/vectordbs/llamaindexserver/llamacloud/typescript/index.ts (1 hunks)
  • packages/create-llama/templates/components/vectordbs/typescript/llamacloud/index.ts (1 hunks)
  • packages/create-llama/templates/components/workflows/typescript/agentic_rag/workflow.ts (1 hunks)
  • packages/create-llama/templates/components/workflows/typescript/artifacts/README-template.md (1 hunks)
  • packages/create-llama/templates/components/workflows/typescript/artifacts/code-workflow.ts (1 hunks)
  • packages/create-llama/templates/components/workflows/typescript/artifacts/doc-workflow.ts (1 hunks)
  • packages/create-llama/templates/components/workflows/typescript/artifacts/workflow.ts (1 hunks)
  • packages/create-llama/templates/components/workflows/typescript/deep_research/README-template.md (1 hunks)
  • packages/create-llama/templates/components/workflows/typescript/deep_research/workflow.ts (5 hunks)
  • packages/create-llama/templates/components/workflows/typescript/financial_report/workflow.ts (7 hunks)
  • packages/create-llama/templates/types/llamaindexserver/nextjs/package.json (1 hunks)
  • packages/create-llama/templates/types/streaming/fastapi/pyproject.toml (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@leehuwuj leehuwuj force-pushed the lee/update-create-llama-ts-with-new-workflow branch from 4aad498 to 4d95b0d Compare May 8, 2025 02:03
@leehuwuj leehuwuj force-pushed the lee/update-create-llama-ts-with-new-workflow branch from 3b0fd2d to 59fb863 Compare May 8, 2025 02:54
@thucpn thucpn self-requested a review May 8, 2025 03:56
@marcusschiesser marcusschiesser marked this pull request as ready for review May 9, 2025 10:20
@marcusschiesser marcusschiesser merged commit f4ca602 into main May 9, 2025
32 of 33 checks passed
@marcusschiesser marcusschiesser deleted the lee/update-create-llama-ts-with-new-workflow branch May 9, 2025 10:20
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.

4 participants