-
Notifications
You must be signed in to change notification settings - Fork 113
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
feat: Use poetry run generate to generate embeddings for FastAPI #41
Conversation
🦋 Changeset detectedLatest commit: b693118 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
WalkthroughThe recent updates streamline command execution and improve code organization across several components. By adopting Changes
Recent Review StatusConfiguration used: CodeRabbit UI Files selected for processing (13)
Files skipped from review as they are similar to previous changes (4)
Additional comments not posted (10)
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this 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
Review Status
Configuration used: CodeRabbit UI
Files selected for processing (11)
- helpers/index.ts (2 hunks)
- helpers/typescript.ts (1 hunks)
- templates/components/engines/python/chat/init.py (1 hunks)
- templates/components/vectordbs/python/astra/generate.py (1 hunks)
- templates/components/vectordbs/python/milvus/generate.py (1 hunks)
- templates/components/vectordbs/python/mongo/generate.py (1 hunks)
- templates/components/vectordbs/python/none/generate.py (1 hunks)
- templates/components/vectordbs/python/pg/generate.py (1 hunks)
- templates/components/vectordbs/python/pinecone/generate.py (1 hunks)
- templates/types/streaming/fastapi/README-template.md (2 hunks)
- templates/types/streaming/fastapi/pyproject.toml (1 hunks)
Additional comments not posted (10)
templates/components/engines/python/chat/__init__.py (1)
12-12
: Update the command in the exception message topoetry run generate
aligns with the PR's goal of standardizing script execution commands. This change enhances consistency and simplifies the command execution process across the project.templates/types/streaming/fastapi/pyproject.toml (1)
8-10
: Adding thegenerate
script undertool.poetry.scripts
is a positive change that standardizes script execution within the project. This addition makes it easier to manage and execute the script across different environments, aligning with the PR's goal of improving the generation of context data.templates/components/vectordbs/python/none/generate.py (1)
30-30
: Moving the main execution logic to amain()
function is a good practice that enhances the script's organization and readability. This change facilitates better code management and aligns with the PR's objective of improving code structure across the project.templates/components/vectordbs/python/astra/generate.py (1)
35-35
: Moving the main execution logic into amain()
function improves the script's organization and readability. This restructuring aligns with the PR's goal of enhancing code management and readability across the project.templates/components/vectordbs/python/milvus/generate.py (1)
37-37
: Moving the main execution logic into amain()
function is a commendable change that enhances the script's organization and readability. This restructuring supports the PR's objective of improving code management and readability across the project.templates/components/vectordbs/python/mongo/generate.py (1)
41-41
: Moving the main execution logic into amain()
function is an effective way to improve the script's organization and readability. This change aligns with the PR's goal of enhancing code management and readability across the project.templates/types/streaming/fastapi/README-template.md (2)
27-27
: Standardizing the command execution topoetry run generate
enhances consistency and simplifies the process. Good change.
87-87
: Consistent use ofpoetry run generate
within Docker commands aligns with the project's standardization efforts. Well done.helpers/index.ts (1)
33-39
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [36-49]
Simplifying the command for generating context data to
poetry run generate
for thefastapi
framework enhances readability and consistency. The conditional logic used here is a good practice for maintainability.helpers/typescript.ts (1)
203-203
: Simplifying the condition for adding thegenerate
script inpackageJson
could make the process more straightforward. Ensure that the new condition accurately reflects all scenarios where the script is needed.
5331e02
to
99bf33b
Compare
There was a problem hiding this 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
Actionable comments outside the diff hunks (3)
templates/components/vectordbs/python/none/generate.py (1)
Line range hint
1-11
: Move module level imports to the top of the file to conform to PEP 8 guidelines.+ from dotenv import load_dotenv + import logging + from llama_index.core.indices import VectorStoreIndex + from app.engine.constants import STORAGE_DIR + from app.engine.loaders import get_documents + from app.settings import init_settings + load_dotenv() - from dotenv import load_dotenv - load_dotenv()templates/components/vectordbs/python/pg/generate.py (1)
Line range hint
1-11
: Move module level imports to the top of the file to conform to PEP 8 guidelines.+ from dotenv import load_dotenv + import logging + from llama_index.core.indices import VectorStoreIndex + from llama_index.core.storage import StorageContext + from app.engine.loaders import get_documents + from app.settings import init_settings + from app.engine.utils import init_pg_vector_store_from_env + load_dotenv() - from dotenv import load_dotenv - load_dotenv()templates/components/vectordbs/python/astra/generate.py (1)
Line range hint
1-11
: Move module level imports to the top of the file to conform to PEP 8 guidelines.+ from dotenv import load_dotenv + import os + import logging + from llama_index.core.storage import StorageContext + from llama_index.core.indices import VectorStoreIndex + from llama_index.vector_stores.astra_db import AstraDBVectorStore + from app.settings import init_settings + from app.engine.loaders import get_documents + load_dotenv() - from dotenv import load_dotenv - load_dotenv()
99bf33b
to
b693118
Compare
There was a problem hiding this 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
Actionable comments outside the diff hunks (2)
templates/components/vectordbs/python/astra/generate.py (1)
Line range hint
33-33
: Remove the f-string as it does not contain any placeholders, simplifying the logging statement.- logger.info(f"Successfully created embeddings in the AstraDB") + logger.info("Successfully created embeddings in the AstraDB")templates/components/vectordbs/python/milvus/generate.py (1)
Line range hint
35-35
: Remove the f-string as it does not contain any placeholders, simplifying the logging statement.- logger.info(f"Successfully created embeddings in the Milvus") + logger.info("Successfully created embeddings in the Milvus")
poetry run generate
Summary by CodeRabbit
fastapi
framework.