Skip to content
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

chore: move wikipedia tool to create-llama #498

Merged
merged 9 commits into from
Feb 3, 2025

Conversation

thucpn
Copy link
Collaborator

@thucpn thucpn commented Feb 3, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a Wikipedia search tool that lets you retrieve content directly from Wikipedia with support for multiple languages.
  • Chores

    • Streamlined the underlying integration and updated dependencies to enhance performance and maintainability, including the addition of the Wikipedia package.
    • Enhanced end-to-end testing workflow for better artifact management and reporting, including dynamic naming for uploaded artifacts.

Copy link

changeset-bot bot commented Feb 3, 2025

🦋 Changeset detected

Latest commit: 3f06188

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

Copy link

coderabbitai bot commented Feb 3, 2025

Walkthrough

This pull request introduces a new patch named "create-llama" that reorganizes the codebase by relocating the Wikipedia tool into the "create-llama" context. The tool is now incorporated into the agent’s tool factory via an added import and asynchronous instantiation function. A new file defines the WikipediaTool class along with its types, metadata, and methods. Additionally, the wikipedia dependency (version ^2.1.2) is added to package management in both streaming/express and streaming/nextjs projects.

Changes

File(s) Change Summary
.changeset/thin-buses-hunt.md Added patch "create-llama" to relocate the Wikipedia tool to the appropriate context.
templates/.../agent/tools/index.ts Added import for WikipediaTool and its parameters; updated toolFactory with an async function to instantiate and return a WikipediaTool instance.
templates/.../agent/tools/wikipedia.ts Created new file defining WikipediaTool class, related types (WikipediaParameter, WikipediaToolParams), constants, and methods for tool operations.
templates/types/streaming/{express,nextjs}/package.json Added new dependency entry: "wikipedia": "^2.1.2" to the dependencies section in both package.json files.
.github/workflows/e2e.yml Updated GitHub Actions workflow to use actions/upload-artifact@v4, modified artifact naming to include OS variable, and added overwrite option.

Possibly related PRs

  • feat: Improve FastAPI agentic template #447: The changes in the main PR, which involve relocating the Wikipedia tool and enhancing its integration within the "create-llama" context, are related to the modifications in the retrieved PR that also involve the Wikipedia tool, specifically its environment variable handling.
  • feat: implement interpreter tool #94: The changes in the main PR are related to the modifications in the templates/components/engines/typescript/agent/tools/index.ts file, where both PRs involve updates to the tool factory for adding new tools (WikipediaTool in the main PR and InterpreterTool in the retrieved PR).
  • feat: Add e2b code artifact tool support for the FastAPI template #339: The changes in the main PR, which involve reorganizing the Wikipedia tool within the "create-llama" context, are related to the modifications in the retrieved PR that also focus on enhancing tool configurations, specifically for the FastAPI template, indicating a shared context of tool management.

Suggested reviewers

  • marcusschiesser

Poem

I'm a coding rabbit, hopping through change,
Moving old tools into a context so strange.
The Wikipedia tool now leaps in style,
Nestled in create-llama with a happy smile.
Bytes and bounces in every line,
A hoppy patch that's truly divine! 🐰✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.

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. (Beta)
  • @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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 131e63a and 518f345.

📒 Files selected for processing (5)
  • .changeset/thin-buses-hunt.md (1 hunks)
  • templates/components/engines/typescript/agent/tools/index.ts (2 hunks)
  • templates/components/engines/typescript/agent/tools/wikipedia.ts (1 hunks)
  • templates/types/streaming/express/package.json (1 hunks)
  • templates/types/streaming/nextjs/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .changeset/thin-buses-hunt.md
🧰 Additional context used
📓 Path-based instructions (4)
templates/types/streaming/express/package.json (1)

Pattern templates/**: For files under the templates folder, do not report 'Missing Dependencies Detected' errors.

templates/components/engines/typescript/agent/tools/index.ts (1)

Pattern templates/**: For files under the templates folder, do not report 'Missing Dependencies Detected' errors.

templates/types/streaming/nextjs/package.json (1)

Pattern templates/**: For files under the templates folder, do not report 'Missing Dependencies Detected' errors.

templates/components/engines/typescript/agent/tools/wikipedia.ts (1)

Pattern templates/**: For files under the templates folder, do not report 'Missing Dependencies Detected' errors.

🔇 Additional comments (4)
templates/components/engines/typescript/agent/tools/wikipedia.ts (1)

1-32: LGTM! Well-structured type definitions and metadata.

The type definitions and metadata are well-organized with:

  • Clear parameter types with proper optionals
  • Comprehensive metadata with accurate descriptions
  • Proper JSON schema validation
templates/components/engines/typescript/agent/tools/index.ts (1)

37-39: LGTM! Consistent tool factory integration.

The Wikipedia tool integration follows the established pattern used for other tools in the factory.

templates/types/streaming/express/package.json (1)

32-33: Verify the Wikipedia package version.

Let's ensure we're using the latest stable version of the Wikipedia package.

✅ Verification successful

Wikipedia package version is current.

The latest stable version of the Wikipedia package is 2.1.2, which exactly matches the version specified in the package.json.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check latest version of wikipedia package
npm view wikipedia versions --json | jq -r '.[-1]'

Length of output: 58

templates/types/streaming/nextjs/package.json (1)

39-40: LGTM! Consistent package versioning.

The Wikipedia package version is consistent with the Express implementation.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 518f345 and e555554.

📒 Files selected for processing (1)
  • .github/workflows/e2e.yml (2 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/e2e.yml

75-75: property "runs-on" is not defined in object type {datasources: string; frameworks: string; node-version: number; os: string; python-version: number}

(expression)


143-143: property "runs-on" is not defined in object type {datasources: string; frameworks: string; node-version: number; os: string; python-version: number}

(expression)

⏰ Context from checks skipped due to timeout of 90000ms (45)
  • GitHub Check: typescript (20, 3.11, ubuntu-22.04, express, --llamacloud)
  • GitHub Check: typescript (20, 3.11, ubuntu-22.04, express, --example-file)
  • GitHub Check: typescript (20, 3.11, ubuntu-22.04, express, --no-files)
  • GitHub Check: typescript (20, 3.11, ubuntu-22.04, nextjs, --llamacloud)
  • GitHub Check: typescript (20, 3.11, ubuntu-22.04, nextjs, --example-file)
  • GitHub Check: typescript (20, 3.11, ubuntu-22.04, nextjs, --no-files)
  • GitHub Check: typescript (20, 3.11, windows-latest, express, --llamacloud)
  • GitHub Check: typescript (20, 3.11, windows-latest, express, --example-file)
  • GitHub Check: typescript (20, 3.11, windows-latest, express, --no-files)
  • GitHub Check: typescript (20, 3.11, windows-latest, nextjs, --llamacloud)
  • GitHub Check: typescript (20, 3.11, windows-latest, nextjs, --example-file)
  • GitHub Check: typescript (20, 3.11, windows-latest, nextjs, --no-files)
  • GitHub Check: typescript (20, 3.11, macos-latest, express, --llamacloud)
  • GitHub Check: typescript (20, 3.11, macos-latest, express, --example-file)
  • GitHub Check: typescript (20, 3.11, macos-latest, express, --no-files)
  • GitHub Check: typescript (20, 3.11, macos-latest, nextjs, --llamacloud)
  • GitHub Check: typescript (20, 3.11, macos-latest, nextjs, --example-file)
  • GitHub Check: typescript (20, 3.11, macos-latest, nextjs, --no-files)
  • GitHub Check: typescript (18, 3.11, ubuntu-22.04, express, --llamacloud)
  • GitHub Check: typescript (18, 3.11, ubuntu-22.04, express, --example-file)
  • GitHub Check: typescript (18, 3.11, ubuntu-22.04, express, --no-files)
  • GitHub Check: typescript (18, 3.11, ubuntu-22.04, nextjs, --llamacloud)
  • GitHub Check: typescript (18, 3.11, ubuntu-22.04, nextjs, --example-file)
  • GitHub Check: typescript (18, 3.11, ubuntu-22.04, nextjs, --no-files)
  • GitHub Check: typescript (18, 3.11, windows-latest, express, --llamacloud)
  • GitHub Check: typescript (18, 3.11, windows-latest, express, --example-file)
  • GitHub Check: typescript (18, 3.11, windows-latest, express, --no-files)
  • GitHub Check: typescript (18, 3.11, windows-latest, nextjs, --llamacloud)
  • GitHub Check: typescript (18, 3.11, windows-latest, nextjs, --example-file)
  • GitHub Check: typescript (18, 3.11, windows-latest, nextjs, --no-files)
  • GitHub Check: python (20, 3.11, ubuntu-22.04, fastapi, --llamacloud)
  • GitHub Check: python (20, 3.11, ubuntu-22.04, fastapi, --example-file)
  • GitHub Check: python (20, 3.11, ubuntu-22.04, fastapi, --no-files)
  • GitHub Check: typescript (18, 3.11, macos-latest, express, --llamacloud)
  • GitHub Check: typescript (18, 3.11, macos-latest, express, --example-file)
  • GitHub Check: python (20, 3.11, windows-latest, fastapi, --llamacloud)
  • GitHub Check: typescript (18, 3.11, macos-latest, express, --no-files)
  • GitHub Check: python (20, 3.11, windows-latest, fastapi, --example-file)
  • GitHub Check: typescript (18, 3.11, macos-latest, nextjs, --llamacloud)
  • GitHub Check: python (20, 3.11, windows-latest, fastapi, --no-files)
  • GitHub Check: typescript (18, 3.11, macos-latest, nextjs, --example-file)
  • GitHub Check: python (20, 3.11, macos-latest, fastapi, --llamacloud)
  • GitHub Check: typescript (18, 3.11, macos-latest, nextjs, --no-files)
  • GitHub Check: python (20, 3.11, macos-latest, fastapi, --example-file)
  • GitHub Check: python (20, 3.11, macos-latest, fastapi, --no-files)

.github/workflows/e2e.yml Outdated Show resolved Hide resolved
.github/workflows/e2e.yml Outdated Show resolved Hide resolved
.github/workflows/e2e.yml Outdated Show resolved Hide resolved
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
.github/workflows/e2e.yml (2)

72-77: Update Artifact Upload for Python E2E Job

The workflow now correctly upgrades to actions/upload-artifact@v4 and uses descriptive artifact naming by incorporating ${{ matrix.os }}, ${{ matrix.frameworks }}, and ${{ matrix.datasources }}. The addition of overwrite: true ensures that previous artifacts with the same name are replaced, which helps maintain a clean artifact repository. Please verify that these matrix variables are consistently defined across the configuration, as this improves the maintainability and traceability of test reports.


140-145: Enhance Artifact Upload for TypeScript E2E Job

Similar to the Python job, the TypeScript job now uses actions/upload-artifact@v4 and applies a refined naming strategy by appending ${{ matrix.os }}, ${{ matrix.frameworks }}, ${{ matrix.datasources }}, and node${{ matrix.node-version }} to the artifact name. This assures unique identification of artifacts per job configuration. The overwrite: true option further enhances reliability by ensuring that existing artifacts are replaced when necessary.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ef743a9 and 3f06188.

📒 Files selected for processing (1)
  • .github/workflows/e2e.yml (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (45)
  • GitHub Check: typescript (20, 3.11, ubuntu-22.04, express, --llamacloud)
  • GitHub Check: typescript (20, 3.11, ubuntu-22.04, express, --example-file)
  • GitHub Check: typescript (20, 3.11, ubuntu-22.04, express, --no-files)
  • GitHub Check: typescript (20, 3.11, ubuntu-22.04, nextjs, --llamacloud)
  • GitHub Check: typescript (20, 3.11, ubuntu-22.04, nextjs, --example-file)
  • GitHub Check: typescript (20, 3.11, ubuntu-22.04, nextjs, --no-files)
  • GitHub Check: typescript (20, 3.11, windows-latest, express, --llamacloud)
  • GitHub Check: typescript (20, 3.11, windows-latest, express, --example-file)
  • GitHub Check: typescript (20, 3.11, windows-latest, express, --no-files)
  • GitHub Check: typescript (20, 3.11, windows-latest, nextjs, --llamacloud)
  • GitHub Check: typescript (20, 3.11, windows-latest, nextjs, --example-file)
  • GitHub Check: typescript (20, 3.11, windows-latest, nextjs, --no-files)
  • GitHub Check: typescript (20, 3.11, macos-latest, express, --llamacloud)
  • GitHub Check: typescript (20, 3.11, macos-latest, express, --example-file)
  • GitHub Check: typescript (20, 3.11, macos-latest, express, --no-files)
  • GitHub Check: typescript (20, 3.11, macos-latest, nextjs, --llamacloud)
  • GitHub Check: typescript (20, 3.11, macos-latest, nextjs, --example-file)
  • GitHub Check: typescript (20, 3.11, macos-latest, nextjs, --no-files)
  • GitHub Check: typescript (18, 3.11, ubuntu-22.04, express, --llamacloud)
  • GitHub Check: typescript (18, 3.11, ubuntu-22.04, express, --example-file)
  • GitHub Check: typescript (18, 3.11, ubuntu-22.04, express, --no-files)
  • GitHub Check: typescript (18, 3.11, ubuntu-22.04, nextjs, --llamacloud)
  • GitHub Check: typescript (18, 3.11, ubuntu-22.04, nextjs, --example-file)
  • GitHub Check: typescript (18, 3.11, ubuntu-22.04, nextjs, --no-files)
  • GitHub Check: typescript (18, 3.11, windows-latest, express, --llamacloud)
  • GitHub Check: typescript (18, 3.11, windows-latest, express, --example-file)
  • GitHub Check: typescript (18, 3.11, windows-latest, express, --no-files)
  • GitHub Check: typescript (18, 3.11, windows-latest, nextjs, --llamacloud)
  • GitHub Check: typescript (18, 3.11, windows-latest, nextjs, --example-file)
  • GitHub Check: typescript (18, 3.11, windows-latest, nextjs, --no-files)
  • GitHub Check: python (20, 3.11, ubuntu-22.04, fastapi, --llamacloud)
  • GitHub Check: typescript (18, 3.11, macos-latest, express, --llamacloud)
  • GitHub Check: python (20, 3.11, ubuntu-22.04, fastapi, --example-file)
  • GitHub Check: typescript (18, 3.11, macos-latest, express, --example-file)
  • GitHub Check: python (20, 3.11, ubuntu-22.04, fastapi, --no-files)
  • GitHub Check: typescript (18, 3.11, macos-latest, express, --no-files)
  • GitHub Check: python (20, 3.11, windows-latest, fastapi, --llamacloud)
  • GitHub Check: typescript (18, 3.11, macos-latest, nextjs, --llamacloud)
  • GitHub Check: python (20, 3.11, windows-latest, fastapi, --example-file)
  • GitHub Check: python (20, 3.11, windows-latest, fastapi, --no-files)
  • GitHub Check: typescript (18, 3.11, macos-latest, nextjs, --example-file)
  • GitHub Check: python (20, 3.11, macos-latest, fastapi, --llamacloud)
  • GitHub Check: typescript (18, 3.11, macos-latest, nextjs, --no-files)
  • GitHub Check: python (20, 3.11, macos-latest, fastapi, --example-file)
  • GitHub Check: python (20, 3.11, macos-latest, fastapi, --no-files)

@marcusschiesser marcusschiesser merged commit c1552eb into main Feb 3, 2025
47 checks passed
@marcusschiesser marcusschiesser deleted the chore/move-wikipedia-tool-to-cl branch February 3, 2025 10:35
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.

2 participants