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

feat: upgrade llamaindex to 0.12.10 and some deps #586

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/app/api/admin_routes/embedding_model/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from pydantic import BaseModel, field_validator
from typing_extensions import Optional
from app.types import EmbeddingProvider
from app.rag.embeddings.provider import EmbeddingProvider


class EmbeddingModelCreate(BaseModel):
Expand Down
20 changes: 15 additions & 5 deletions backend/app/api/admin_routes/embedding_model/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,29 @@
)
from app.api.deps import CurrentSuperuserDep, SessionDep
from app.exceptions import EmbeddingModelNotFound, InternalServerError
from app.rag.chat_config import get_embed_model
from app.rag.embed_model_option import EmbeddingModelOption, admin_embed_model_options
from app.repositories.embedding_model import embed_model_repo
from app.rag.embeddings import (
get_embed_model,
EmbeddingProviderOption,
embedding_provider_options,
)

router = APIRouter()
logger = logging.getLogger(__name__)


@router.get("/admin/embedding-models/options")
@router.get("/admin/embedding-models/provider/options")
def list_embedding_model_provider_options(
user: CurrentSuperuserDep,
) -> List[EmbeddingProviderOption]:
return embedding_provider_options


@router.get("/admin/embedding-models/options", deprecated=True)
def get_embedding_model_options(
user: CurrentSuperuserDep,
) -> List[EmbeddingModelOption]:
return admin_embed_model_options
) -> List[EmbeddingProviderOption]:
return embedding_provider_options


@router.post("/admin/embedding-models")
Expand Down
18 changes: 13 additions & 5 deletions backend/app/api/admin_routes/llm/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,25 @@
from app.api.deps import CurrentSuperuserDep, SessionDep
from app.exceptions import InternalServerError, LLMNotFound
from app.models import AdminLLM, LLM, ChatEngine, KnowledgeBase
from app.rag.chat_config import get_llm
from app.rag.llm_option import LLMOption, admin_llm_options
from app.repositories.llm import llm_repo
from app.rag.llms import (
get_llm,
LLMProviderOption,
llm_provider_options,
)

router = APIRouter()
logger = logging.getLogger(__name__)


@router.get("/admin/llms/options")
def get_llm_options(user: CurrentSuperuserDep) -> List[LLMOption]:
return admin_llm_options
@router.get("/admin/llms/provider/options")
def list_llm_provider_options(user: CurrentSuperuserDep) -> List[LLMProviderOption]:
return llm_provider_options


@router.get("/admin/llms/options", deprecated=True)
def get_llm_options(user: CurrentSuperuserDep) -> List[LLMProviderOption]:
return llm_provider_options


@router.get("/admin/llms")
Expand Down
25 changes: 17 additions & 8 deletions backend/app/api/admin_routes/reranker_model/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,29 @@
from app.api.deps import CurrentSuperuserDep, SessionDep
from app.exceptions import RerankerModelNotFound, InternalServerError
from app.models import RerankerModel, AdminRerankerModel, ChatEngine
from app.rag.chat_config import get_reranker_model
from app.rag.reranker_model_option import (
RerankerModelOption,
admin_reranker_model_options,
)
from app.repositories.reranker_model import reranker_model_repo
from app.rag.rerankers import (
get_reranker_model,
reranker_provider_options,
RerankerProviderOption,
)

router = APIRouter()
logger = logging.getLogger(__name__)


@router.get("/admin/reranker-models/options")
def get_reranker_model_options(user: CurrentSuperuserDep) -> List[RerankerModelOption]:
return admin_reranker_model_options
@router.get("/admin/reranker-models/provider/options")
def list_reranker_model_provider_options(
user: CurrentSuperuserDep,
) -> List[RerankerProviderOption]:
return reranker_provider_options


@router.get("/admin/reranker-models/options", deprecated=True)
def get_reranker_model_options(
user: CurrentSuperuserDep,
) -> List[RerankerProviderOption]:
return reranker_provider_options


@router.post("/admin/reranker-models/test")
Expand Down
3 changes: 1 addition & 2 deletions backend/app/models/llm.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from typing import Optional, Any

from sqlmodel import Field, Column, JSON, String

from app.rag.llms.provider import LLMProvider
from .base import UpdatableBaseModel, AESEncryptedColumn
from app.types import LLMProvider


class BaseLLM(UpdatableBaseModel):
Expand Down
Loading
Loading