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: bump LITS 0.9 #505

Merged
merged 9 commits into from
Feb 20, 2025
Merged

chore: bump LITS 0.9 #505

merged 9 commits into from
Feb 20, 2025

Conversation

thucpn
Copy link
Collaborator

@thucpn thucpn commented Feb 18, 2025

Summary by CodeRabbit

  • New Features

    • Introduced unified configuration for language and embedding model integrations across various providers.
    • Added new setupProvider function for multiple providers to streamline initialization.
  • Refactor

    • Streamlined provider initialization and updated component integration paths for vector databases, ensuring a cleaner setup.
    • Simplified dependency management for vector databases.
  • Chores

    • Updated core dependencies and bumped component versions to improve stability and performance.

Copy link

changeset-bot bot commented Feb 18, 2025

🦋 Changeset detected

Latest commit: 156813c

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 18, 2025

Walkthrough

This pull request introduces a patch labeled "create-llama" and bumps the LITS version to 0.9. The enhancements include an updated installTSTemplate function with a new modelConfig parameter and related dependency management improvements. New setupProvider functions are added across various provider modules and consolidated in the settings, replacing legacy initialization functions. Numerous vector store modules and loader files update their import paths to new scoped packages, and package.json files in streaming templates receive new dependencies and version updates. Minor type adjustments are made in a FastAPI router.

Changes

File(s) Change Summary
.changeset/grumpy-snails-listen.md Added new patch entry "create-llama" and bumped LITS version to 0.9.
helpers/typescript.ts Enhanced installTSTemplate: added modelConfig parameter, introduced providerDependencies and vectorDbDependencies constants, and updated updatePackageJson logic.
templates/components/loaders/typescript/file/loader.ts
templates/components/loaders/typescript/llama_parse/loader.ts
Updated import paths for SimpleDirectoryReader and adjusted import positioning for LlamaParseReader.
templates/components/providers/typescript/*/provider.ts
templates/components/settings/typescript/settings.ts
Introduced new setupProvider functions in multiple provider modules (Anthropic, Azure OpenAI, Gemini, Groq, Mistral, Ollama, OpenAI) and consolidated provider initialization in settings by removing legacy init functions.
templates/components/vectordbs/typescript/** Updated import paths for vector store classes (AstraDB, Chroma, Milvus, MongoDBAtlas, PG, Pinecone, Qdrant, Weaviate) to use scoped @llamaindex packages; added utility functions (loadAndIndex, getDataSource) where applicable.
templates/types/streaming/express/package.json
templates/types/streaming/nextjs/package.json
Added dependencies @aws-crypto/sha256-js and pathe; updated llamaindex version from 0.8.2 to ^0.9.0.
templates/types/streaming/fastapi/app/api/routers/query.py Updated type annotation for response in query_request from a generic string to a specific Response type.

Sequence Diagram(s)

sequenceDiagram
    participant App
    participant Settings
    participant Provider
    App->>Settings: Start application
    Settings->>Provider: setupProvider()
    Provider-->>Settings: Return configured llm & embedModel
    Settings-->>App: Settings initialized with provider settings
Loading
sequenceDiagram
    participant CLI
    participant installTSTemplate
    participant CopySettings
    participant UpdatePkgJson

    CLI->>installTSTemplate: Call installTSTemplate(args, modelConfig)
    installTSTemplate->>CopySettings: Copy provider settings based on modelConfig.provider
    installTSTemplate->>UpdatePkgJson: Update package dependencies via vectorDbDependencies
    UpdatePkgJson-->>installTSTemplate: Package JSON updated
    installTSTemplate-->>CLI: Template installation complete
Loading

Possibly related PRs

Suggested reviewers

  • marcusschiesser

Poem

I'm a rabbit with a digital hop,
Cheering for patches that never stop.
New functions bloom like spring in code,
Providers align on a streamlined road.
With each commit, my whiskers twitch,
Celebrating a change that's truly rich!
🐇💻 Hop on, code friends!


📜 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 94faa1c and 156813c.

📒 Files selected for processing (2)
  • templates/types/streaming/express/package.json (1 hunks)
  • templates/types/streaming/nextjs/package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • templates/types/streaming/nextjs/package.json
  • templates/types/streaming/express/package.json
⏰ 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: python (20, 3.11, ubuntu-22.04, fastapi, --llamacloud)
  • GitHub Check: typescript (18, 3.11, windows-latest, nextjs, --no-files)
  • GitHub Check: python (20, 3.11, ubuntu-22.04, fastapi, --example-file)
  • 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, ubuntu-22.04, fastapi, --no-files)
  • 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)

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.

@thucpn
Copy link
Collaborator Author

thucpn commented Feb 18, 2025

Got this warning when start chatting.

Updated: no longer get warning in 0.9.1

Critical dependency: Accessing import.meta directly is unsupported (only property access or destructuring is supported)

Import trace for requested module:
./node_modules/.pnpm/@huggingface+transformers@3.3.3/node_modules/@huggingface/transformers/dist/transformers.mjs
./node_modules/.pnpm/@llamaindex+env@0.1.27_@aws_ede8700ce078b32f846ae32495d9aeb3/node_modules/@llamaindex/env/multi-model/dist/index.js
./node_modules/.pnpm/@llamaindex+huggingface@0.0_aa11a225fa18572f453b1d8c48d185d3/node_modules/@llamaindex/huggingface/dist/index.js
./app/api/chat/engine/settings.ts
./app/api/chat/route.ts
Using 'openai' model provider

@thucpn thucpn changed the title [WIP] chore: bump LITS 0.9 chore: bump LITS 0.9 Feb 19, 2025
@thucpn thucpn marked this pull request as ready for review February 19, 2025 10:12
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: 7

🧹 Nitpick comments (7)
templates/components/vectordbs/typescript/chroma/generate.ts (1)

23-24: Fix typos in the comment.

The comment has two issues:

  1. "Documentss" has an extra 's'
  2. The comment mentions Pinecone but this is a Chroma implementation
-  // create index from all the Documentss and store them in Pinecone
+  // create index from all the Documents and store them in Chroma
helpers/typescript.ts (2)

185-190: Guard against invalid or undefined modelConfig.provider.
Copying files from <provider> folder without a check may cause errors if modelConfig.provider is invalid or not set. Consider handling or logging such cases to provide user feedback.


386-405: Conditional dependency injection for backend mode is well-structured.
The new code snippet smoothly handles back-end enabled setups by installing the required readers, vector DB, and provider dependencies. Consider graceful handling or warnings if the chosen provider/DB is unsupported or omitted.

templates/components/providers/typescript/anthropic/provider.ts (1)

9-12: Consider extracting embedModelMap to a shared configuration.

The embedModelMap is duplicated across provider files.

Consider moving it to a shared configuration file to maintain consistency and reduce duplication.

// shared/embeddings.ts
export const embedModelMap: Record<string, string> = {
  "all-MiniLM-L6-v2": "Xenova/all-MiniLM-L6-v2",
  "all-mpnet-base-v2": "Xenova/all-mpnet-base-v2",
};
templates/types/streaming/fastapi/app/api/routers/query.py (1)

25-30: Update return type annotation for consistency.

The function's return type annotation is str but it's using the Response type internally.

Update the return type annotation:

 async def query_request(
     query: str,
-) -> str:
+) -> str:  # Consider updating to -> Response if the full response object is needed
     query_engine = get_query_engine()
     response: Response = await query_engine.aquery(query)
     return response.response
templates/components/providers/typescript/azure-openai/provider.ts (1)

19-24: Consider adding environment variable validation.

The configuration relies on environment variables without validation. Consider adding checks for required variables.

 const azureConfig = {
+  // Throw error if required environment variables are missing
+  get apiKey() {
+    const key = process.env.AZURE_OPENAI_KEY;
+    if (!key) throw new Error("AZURE_OPENAI_KEY is required");
+    return key;
+  },
+  get endpoint() {
+    const endpoint = process.env.AZURE_OPENAI_ENDPOINT;
+    if (!endpoint) throw new Error("AZURE_OPENAI_ENDPOINT is required");
+    return endpoint;
+  },
   apiVersion:
     process.env.AZURE_OPENAI_API_VERSION || process.env.OPENAI_API_VERSION,
 };
templates/types/streaming/nextjs/package.json (1)

13-14: Consider package inclusion strategy for frontend NextJS.

Based on the past review comment, backend packages should only be included for fullstack NextJS templates. Consider conditionally including these packages based on the template type.

Could you clarify if this is a frontend-only or fullstack NextJS template? For frontend-only templates, we should only include @llamaindex/next.

Also applies to: 31-31

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9e723c3 and 94faa1c.

📒 Files selected for processing (31)
  • .changeset/grumpy-snails-listen.md (1 hunks)
  • helpers/typescript.ts (8 hunks)
  • templates/components/loaders/typescript/file/loader.ts (1 hunks)
  • templates/components/loaders/typescript/llama_parse/loader.ts (1 hunks)
  • templates/components/providers/typescript/anthropic/provider.ts (1 hunks)
  • templates/components/providers/typescript/azure-openai/provider.ts (1 hunks)
  • templates/components/providers/typescript/gemini/provider.ts (1 hunks)
  • templates/components/providers/typescript/groq/provider.ts (1 hunks)
  • templates/components/providers/typescript/mistral/provider.ts (1 hunks)
  • templates/components/providers/typescript/ollama/provider.ts (1 hunks)
  • templates/components/providers/typescript/openai/provider.ts (1 hunks)
  • templates/components/settings/typescript/settings.ts (1 hunks)
  • templates/components/vectordbs/typescript/astra/generate.ts (1 hunks)
  • templates/components/vectordbs/typescript/astra/index.ts (1 hunks)
  • templates/components/vectordbs/typescript/chroma/generate.ts (1 hunks)
  • templates/components/vectordbs/typescript/chroma/index.ts (1 hunks)
  • templates/components/vectordbs/typescript/milvus/generate.ts (1 hunks)
  • templates/components/vectordbs/typescript/milvus/index.ts (1 hunks)
  • templates/components/vectordbs/typescript/mongo/generate.ts (1 hunks)
  • templates/components/vectordbs/typescript/mongo/index.ts (1 hunks)
  • templates/components/vectordbs/typescript/pg/generate.ts (1 hunks)
  • templates/components/vectordbs/typescript/pg/index.ts (1 hunks)
  • templates/components/vectordbs/typescript/pinecone/generate.ts (1 hunks)
  • templates/components/vectordbs/typescript/pinecone/index.ts (1 hunks)
  • templates/components/vectordbs/typescript/qdrant/generate.ts (1 hunks)
  • templates/components/vectordbs/typescript/qdrant/index.ts (1 hunks)
  • templates/components/vectordbs/typescript/weaviate/generate.ts (1 hunks)
  • templates/components/vectordbs/typescript/weaviate/index.ts (1 hunks)
  • templates/types/streaming/express/package.json (1 hunks)
  • templates/types/streaming/fastapi/app/api/routers/query.py (2 hunks)
  • templates/types/streaming/nextjs/package.json (2 hunks)
✅ Files skipped from review due to trivial changes (2)
  • .changeset/grumpy-snails-listen.md
  • templates/components/vectordbs/typescript/astra/generate.ts
🧰 Additional context used
📓 Path-based instructions (1)
`templates/**`: For files under the `templates` folder, do n...

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

  • templates/components/vectordbs/typescript/pg/index.ts
  • templates/components/vectordbs/typescript/milvus/index.ts
  • templates/types/streaming/fastapi/app/api/routers/query.py
  • templates/components/providers/typescript/groq/provider.ts
  • templates/components/providers/typescript/openai/provider.ts
  • templates/types/streaming/nextjs/package.json
  • templates/components/vectordbs/typescript/qdrant/generate.ts
  • templates/components/vectordbs/typescript/mongo/generate.ts
  • templates/components/vectordbs/typescript/mongo/index.ts
  • templates/components/loaders/typescript/file/loader.ts
  • templates/types/streaming/express/package.json
  • templates/components/vectordbs/typescript/weaviate/generate.ts
  • templates/components/vectordbs/typescript/pg/generate.ts
  • templates/components/vectordbs/typescript/pinecone/index.ts
  • templates/components/providers/typescript/ollama/provider.ts
  • templates/components/vectordbs/typescript/chroma/index.ts
  • templates/components/vectordbs/typescript/astra/index.ts
  • templates/components/vectordbs/typescript/weaviate/index.ts
  • templates/components/vectordbs/typescript/milvus/generate.ts
  • templates/components/providers/typescript/mistral/provider.ts
  • templates/components/providers/typescript/gemini/provider.ts
  • templates/components/providers/typescript/anthropic/provider.ts
  • templates/components/vectordbs/typescript/chroma/generate.ts
  • templates/components/settings/typescript/settings.ts
  • templates/components/providers/typescript/azure-openai/provider.ts
  • templates/components/vectordbs/typescript/pinecone/generate.ts
  • templates/components/vectordbs/typescript/qdrant/index.ts
  • templates/components/loaders/typescript/llama_parse/loader.ts
⏰ 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: typescript (18, 3.11, macos-latest, nextjs, --example-file)
  • GitHub Check: python (20, 3.11, windows-latest, fastapi, --no-files)
  • GitHub Check: typescript (18, 3.11, macos-latest, nextjs, --no-files)
  • GitHub Check: python (20, 3.11, macos-latest, fastapi, --llamacloud)
  • GitHub Check: python (20, 3.11, macos-latest, fastapi, --example-file)
  • GitHub Check: python (20, 3.11, macos-latest, fastapi, --no-files)
🔇 Additional comments (30)
templates/components/loaders/typescript/file/loader.ts (1)

1-4: LGTM!

The import path update to use the scoped package @llamaindex/readers/directory is consistent with the LITS version bump and follows good package organization practices.

templates/components/loaders/typescript/llama_parse/loader.ts (1)

1-5: LGTM!

The changes improve code organization:

  1. Import path update to use the scoped package is consistent with other files
  2. Separating the LlamaParseReader import improves readability
templates/components/vectordbs/typescript/astra/index.ts (2)

1-16: LGTM! Clean package restructuring.

The change to use the scoped package @llamaindex/astra is part of a clean package restructuring. The rest of the implementation remains unchanged and maintains its functionality.


2-2:

✅ Verification successful

Verify package compatibility with LITS 0.9

The import path change to use the scoped package @llamaindex/astra looks good, but let's verify its compatibility.


🏁 Script executed:

#!/bin/bash
# Check if @llamaindex/astra package exists and get its version info
npm view @llamaindex/astra version

# Check if it's listed as a dependency
cat package.json | jq '.dependencies["@llamaindex/astra"], .devDependencies["@llamaindex/astra"]'

Length of output: 187


Import update verified: Using scoped package is correct.

The update to import AstraDBVectorStore from @llamaindex/astra aligns with the LITS 0.9 upgrade requirements. Our verification confirms that the package exists (version 0.0.5), and despite the absence of a package.json in the root (which may be expected given the project’s structure), no further dependency issues are apparent. Please ensure that the dependency is declared in the appropriate manifest if required.

templates/components/vectordbs/typescript/weaviate/index.ts (1)

1-1:

✅ Verification successful

LGTM! Verify package availability.

The import change from path-based to scoped package is consistent with the LITS 0.9 update.

Let's verify the package availability and version:


🏁 Script executed:

#!/bin/bash
# Description: Check if @llamaindex/weaviate package exists and its version.
npm view @llamaindex/weaviate version

Length of output: 45


LGTM – Import change verified.
The scoped package @llamaindex/weaviate is available at version 0.0.5, which aligns with the LITS 0.9 update. No further changes are required.

templates/components/vectordbs/typescript/weaviate/generate.ts (1)

2-4: LGTM! Import organization improved.

The changes improve code organization by:

  1. Moving WeaviateVectorStore to its scoped package
  2. Consolidating llamaindex imports
templates/components/vectordbs/typescript/milvus/index.ts (1)

1-1:

✅ Verification successful

LGTM! Verify the package version.

The import change from llamaindex/vector-store/MilvusVectorStore to @llamaindex/milvus is consistent with the LITS 0.9 upgrade.

Run the following script to verify the package version:


🏁 Script executed:

#!/bin/bash
# Description: Check if @llamaindex/milvus package exists and its version.
npm view @llamaindex/milvus version

Length of output: 43


LGTM – Import and package version verified.
The change to import MilvusVectorStore from @llamaindex/milvus aligns with the LITS 0.9 upgrade. The executed script confirmed that the package is at version 0.1.0, which meets our expectations.

templates/components/vectordbs/typescript/qdrant/index.ts (1)

1-1:

✅ Verification successful

LGTM! Verify the package version.

The import change from llamaindex/vector-store/QdrantVectorStore to @llamaindex/qdrant is consistent with the LITS 0.9 upgrade.

Run the following script to verify the package version:


🏁 Script executed:

#!/bin/bash
# Description: Check if @llamaindex/qdrant package exists and its version.
npm view @llamaindex/qdrant version

Length of output: 43


Package Import Verified and Approved

The import change to use @llamaindex/qdrant is consistent with the LITS 0.9 upgrade. The verification script confirmed that the package exists with version 0.1.0. No further changes are required.

templates/components/vectordbs/typescript/chroma/index.ts (1)

2-2:

✅ Verification successful

LGTM! Verify the package version.

The import change from llamaindex/vector-store/ChromaVectorStore to @llamaindex/chroma is consistent with the LITS 0.9 upgrade.

Run the following script to verify the package version:


🏁 Script executed:

#!/bin/bash
# Description: Check if @llamaindex/chroma package exists and its version.
npm view @llamaindex/chroma version

Length of output: 43


LGTM! Verified that the package change is consistent with the LITS 0.9 upgrade and confirmed that the installed version of @llamaindex/chroma is 0.0.5.

templates/components/vectordbs/typescript/pg/index.ts (1)

1-1:

✅ Verification successful

LGTM! Verify the package version.

The import change from llamaindex/vector-store/PGVectorStore to @llamaindex/postgres is consistent with the LITS 0.9 upgrade.

Run the following script to verify the package version:


🏁 Script executed:

#!/bin/bash
# Description: Check if @llamaindex/postgres package exists and its version.
npm view @llamaindex/postgres version

Length of output: 46


LGTM – Import and package version verified

The change to import PGVectorStore from @llamaindex/postgres aligns with the LITS 0.9 upgrade, and the package version (0.0.33) has been confirmed.

templates/components/vectordbs/typescript/mongo/index.ts (1)

2-2: LGTM! Import path updated correctly.

The import path has been updated to use the new scoped package @llamaindex/mongodb, which aligns with the LITS 0.9 update.

templates/components/vectordbs/typescript/qdrant/generate.ts (1)

2-2: LGTM! Import path updated correctly.

The import path has been updated to use the new scoped package @llamaindex/qdrant, which aligns with the LITS 0.9 update.

templates/components/vectordbs/typescript/milvus/generate.ts (1)

2-2: LGTM! Import path updated correctly.

The import path has been updated to use the new scoped package @llamaindex/milvus, which aligns with the LITS 0.9 update.

templates/components/vectordbs/typescript/chroma/generate.ts (1)

2-2: LGTM! Import path updated correctly.

The import path has been updated to use the new scoped package @llamaindex/chroma, which aligns with the LITS 0.9 update.

templates/components/vectordbs/typescript/pg/generate.ts (1)

1-1: LGTM! Import path updated to use scoped package.

The import statement has been updated to use the new scoped package @llamaindex/postgres, which is consistent with modern package management practices and the broader module restructuring.

templates/components/vectordbs/typescript/mongo/generate.ts (1)

2-2: LGTM! Import path updated to use scoped package.

The import statement has been updated to use the new scoped package @llamaindex/mongodb, which is consistent with modern package management practices and the broader module restructuring.

templates/components/settings/typescript/settings.ts (2)

1-2: Good use of dedicated imports for maintainability.
No concerns here; importing setupProvider from a dedicated file helps keep the settings initialization cleaner and modular.


17-18: Consider awaiting the provider setup if it's asynchronous.
If setupProvider() involves any asynchronous operations, calling it without await could lead to race conditions where initSettings() returns before the provider is fully configured.

helpers/typescript.ts (6)

9-9: Importing model-related types helps clarify usage.
These additional imports ensure clearer type definitions for model providers and vector databases.


30-30: Expanding function signature with modelConfig improves flexibility.
Adding modelConfig makes the template installation process more adaptable to different model providers and configurations.


250-251: Passing backend and modelConfig for package creation is a good modular design.
Ensuring these parameters flow through allows for more flexible configuration when generating the package.json.


261-287: Confirm version consistency for provider dependencies.
Pinned versions help avoid conflicts, but please verify they are up-to-date and compatible with each other as new versions of @llamaindex/* are released.


289-321: Double-check pinned versions for vector database dependencies.
Similar to provider dependencies, ensure these pinned versions align with current stable releases and consider updating them if needed.


333-334: Expanding updatePackageJson signature is appropriate.
Adding backend and modelConfig as parameters supports more dynamic handling of environment and model settings.

templates/components/vectordbs/typescript/pinecone/index.ts (1)

2-2: Updated import path for PineconeVectorStore is appropriate.
Using @llamaindex/pinecone directly is more canonical and likely aligns with the new library structure.

templates/components/vectordbs/typescript/pinecone/generate.ts (1)

2-2: LGTM! Import path updated to use scoped package.

The change correctly updates the import path to use the new scoped package @llamaindex/pinecone.

templates/components/providers/typescript/azure-openai/provider.ts (3)

26-37: LGTM! Proper model fallback and type handling.

The LLM configuration is well-structured with:

  • Appropriate model fallback to "gpt-35-turbo"
  • Proper type conversion for maxTokens

39-48: LGTM! Proper embedding model configuration.

The embedding model setup is well-implemented with:

  • Optional dimensions parameter
  • Proper type conversion using parseInt

6-17:

❓ Verification inconclusive

Verify model mapping completeness and accuracy.

The model mapping appears comprehensive, but some model names reference future dates (e.g., gpt-4o-2024-05-13, gpt-4-turbo-2024-04-09) that might not be currently available.


🌐 Web query:

What are the currently available Azure OpenAI model deployments and their corresponding OpenAI model names?

💡 Result:

Azure OpenAI Service offers a diverse range of model deployments with varying capabilities and regional availability. Here’s an overview of key deployments and their corresponding underlying OpenAI models:

Available Model Deployments

O-Series Models

Specialized for advanced reasoning tasks like coding and mathematics:

Azure Deployment Name Corresponding OpenAI Model Key Features
o3-mini Limited-access reasoning Structured outputs; text-only input
o1 Limited-access multimodal Text/image input; expanded token support
o1-preview Older preview version Legacy support
o1-mini Global standard deployment Faster coding tasks; lower latency

GPT Series

General-purpose language and multimodal capabilities:

Azure Deployment Name Corresponding OpenAI Model Capabilities
gpt‑35‑turbo Open-source base General language tasks
gpt‑35‑turbo-instruct Instruction-following variant Task-specific responses
Multimodal Models
gpt‑40 Latest multimodal Text/image input; low latency
gpt‑40‑mini Compact version Cost-efficient inference
gpt‑turbo-with-vision Vision integration Image understanding/analysis

Specialized Models

For niche applications:

Category Azure Deployment Names
Embeddings Text similarity vectorization
DALL-E Image generation from text
Whisper Speech-to-text transcription
Text-to-Speech Audio synthesis (preview)

Regional Availability

Availability varies significantly by region:

eastus2: Full O-Series + latest GPT variants  
swedencentral: Broadest coverage  
westus/northcentralus: Partial O-Series access  

Most O-Series require explicit access requests except global-standard o1-mini.

Deployment Types

Two primary infrastructure options:

# Standard Deployments
openai.api_type = "azure_standard"  # Global routing

# Provisioned Deployments  
openapi.deployment_type = "provisioned_managed"  # Dedicated capacity

For code integration using Python SDK:

from openai import AzureOpenAI

client = AzureOpenAI(
    api_key="YOUR_KEY",
    api_version="2025年02月19日",
    base_url="https://<resource>.openai.azure.com"
)

models = client.models.list()
print([model.id for model in models])

Key considerations when deploying:

  1. Verify regional availability via Microsoft Learn documentation[2][7]
  2. Check content filtering requirements[2]
  3. Use auto-update settings where possible[7]

Recent updates include expanded vision capabilities through multimodal O-Series/GPT integrations[1][10].

Citations:


Verify Azure OpenAI model mapping consistency and intent.

The current mapping in templates/components/providers/typescript/azure-openai/provider.ts (lines 6–17) looks comprehensive overall. However, please double-check the entries that include date-specific identifiers:

  • gpt-4-turbo-2024-04-09gpt-4-turbo
  • gpt-4o-2024-05-13gpt-4o-2024-05-13

Recent Azure OpenAI documentation and deployments do not clearly list models with these date suffixes. Confirm whether:

  • These date-tagged entries are intentionally reserved for future or pre-release deployments.
  • They should instead be aligned with the currently documented model deployments (e.g., gpt‑35‑turbo, gpt‑35‑turbo-instruct, gpt‑40, etc.).

Please review and update if necessary to ensure the provider’s configuration accurately reflects the active Azure OpenAI service offerings.

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

19-20:

❓ Verification inconclusive

Verify dependency compatibility with LITS 0.9.

The addition of new dependencies and version update align with the PR objective to bump LITS to 0.9.

Also applies to: 26-26


🏁 Script executed:

#!/bin/bash
# Check for any peer dependency warnings with the new versions
npm install --package-lock-only
npm ls llamaindex @aws-crypto/sha256-js pathe

Length of output: 544


Below is an updated review comment. Note that the original dependency check ran from the repository root instead of the package directory. Please verify manually by re-running the checks from within the proper location (i.e. templates/types/streaming/express) to confirm that no peer dependency issues exist.


Ensure dependency checks run from the correct directory

The dependency bump and new additions for LITS 0.9 appear aligned with the PR objective. However, the initial verification command failed because it ran from the repository root instead of the package's directory. Please re-run the following command from within templates/types/streaming/express:

  • Command to run:

    cd templates/types/streaming/express
    npm install --package-lock-only && npm ls llamaindex @aws-crypto/sha256-js pathe
  • Action required:
    Manually verify that this command produces no peer dependency warnings before merging.

Also applies to: 26-26

@marcusschiesser
Copy link
Collaborator

beautiful @thucpn !

@marcusschiesser marcusschiesser merged commit 61204a1 into main Feb 20, 2025
47 checks passed
@marcusschiesser marcusschiesser deleted the tp/bump-lits-0.9 branch February 20, 2025 03:33
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