Skip to content

Commit

Permalink
feat: upgrade llamaindex to 0.12.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Mini256 committed Jan 10, 2025
1 parent 39319ed commit f266da9
Show file tree
Hide file tree
Showing 32 changed files with 570 additions and 1,122 deletions.
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
11 changes: 7 additions & 4 deletions backend/app/api/admin_routes/embedding_model/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@
)
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__)
Expand All @@ -24,8 +27,8 @@
@router.get("/admin/embedding-models/options")
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
7 changes: 3 additions & 4 deletions backend/app/api/admin_routes/llm/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@
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.rag.llms import get_llm, LLMProviderOption, llm_provider_options
from app.repositories.llm import llm_repo

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


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


@router.get("/admin/llms")
Expand Down
12 changes: 7 additions & 5 deletions backend/app/api/admin_routes/reranker_model/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,21 @@
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,
from app.repositories.reranker_model import reranker_model_repo
from app.rag.rerankers import (
get_reranker_model,
admin_reranker_model_options,
RerankerProviderOption,
)
from app.repositories.reranker_model import reranker_model_repo

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


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


Expand Down
Loading

0 comments on commit f266da9

Please sign in to comment.