-
Notifications
You must be signed in to change notification settings - Fork 71
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
Make llama-cpp-python an optional dependency #94
Comments
A workaround I found, is to pin @cli.command()
def chainlit(ctx: typer.Context) -> None:
"""Serve a Chainlit frontend."""
# Set the environment variables for the Chainlit frontend.
os.environ["RAGLITE_DB_URL"] = ctx.obj["db_url"]
os.environ["RAGLITE_LLM"] = ctx.obj["llm"]
os.environ["RAGLITE_EMBEDDER"] = ctx.obj["embedder"]
# Import Chainlit here as it's an optional dependency.
try:
from chainlit.cli import run_chainlit
except ImportError as error:
error_message = "To serve a Chainlit frontend, please install the `chainlit` extra."
raise ImportError(error_message) from error
# Serve the frontend.
run_chainlit(__file__.replace("_cli.py", "_chainlit.py")) This is trickier with Note: """RAGLite CLI."""
import json
import os
from typing import ClassVar
import typer
from pydantic_settings import BaseSettings, SettingsConfigDict
from raglite._config import RAGLiteConfig
class RAGLiteCLIConfig(BaseSettings):
"""RAGLite CLI config."""
model_config: ClassVar[SettingsConfigDict] = SettingsConfigDict(
env_prefix="RAGLITE_", env_file=".env", extra="allow"
)
mcp_server_name: str = "RAGLite"
db_url: str = str(RAGLiteConfig().db_url)
llm: str = RAGLiteConfig().llm
embedder: str = RAGLiteConfig().embedder This issue is resolved by #86 but we should make sure that this issue doesn't pop up somewhere else as well. |
@sipalstermans I will shortly work on making |
I get the following when running
poetry add raglite
The text was updated successfully, but these errors were encountered: