mirror of
https://github.com/StanGirard/quivr.git
synced 2024-11-29 14:57:03 +03:00
docs(fix): fixed warnings from griffe (#3381)
# Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate):
This commit is contained in:
parent
029625e322
commit
1a3879839a
1
.gitignore
vendored
1
.gitignore
vendored
@ -103,3 +103,4 @@ backend/core/examples/chatbot/.chainlit/translations/en-US.json
|
||||
.tox
|
||||
Pipfile
|
||||
*.pkl
|
||||
backend/docs/site/*
|
||||
|
@ -2,6 +2,7 @@ from pathlib import Path
|
||||
|
||||
import yaml
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from typing import Self
|
||||
|
||||
|
||||
class QuivrBaseConfig(BaseModel):
|
||||
@ -23,7 +24,7 @@ class QuivrBaseConfig(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
@classmethod
|
||||
def from_yaml(cls, file_path: str | Path):
|
||||
def from_yaml(cls, file_path: str | Path) -> Self:
|
||||
"""
|
||||
Create an instance of the class from a YAML file.
|
||||
|
||||
|
@ -217,7 +217,7 @@ class Brain:
|
||||
vector_db=vector_db,
|
||||
)
|
||||
|
||||
async def save(self, folder_path: str | Path):
|
||||
async def save(self, folder_path: str | Path) -> str:
|
||||
"""
|
||||
Save the brain to a folder path.
|
||||
|
||||
@ -324,7 +324,7 @@ class Brain:
|
||||
embedder: Embeddings | None = None,
|
||||
skip_file_error: bool = False,
|
||||
processor_kwargs: dict[str, Any] | None = None,
|
||||
):
|
||||
) -> Self:
|
||||
"""
|
||||
Create a brain from a list of file paths.
|
||||
|
||||
|
@ -30,7 +30,7 @@ class ChatHistory:
|
||||
# TODO(@aminediro): maybe use a deque() instead ?
|
||||
self._msgs: list[ChatMessage] = []
|
||||
|
||||
def get_chat_history(self, newest_first: bool = False):
|
||||
def get_chat_history(self, newest_first: bool = False) -> List[ChatMessage]:
|
||||
"""
|
||||
Retrieves the chat history, optionally sorted in reverse chronological order.
|
||||
|
||||
|
@ -255,8 +255,6 @@ class LLMEndpointConfig(QuivrBaseConfig):
|
||||
This method sets up the initial configuration, including setting the LLM model
|
||||
config and API key.
|
||||
|
||||
Args:
|
||||
**data: Keyword arguments for initializing the config.
|
||||
"""
|
||||
super().__init__(**data)
|
||||
self.set_llm_model_config()
|
||||
@ -369,9 +367,6 @@ class RerankerConfig(QuivrBaseConfig):
|
||||
def __init__(self, **data):
|
||||
"""
|
||||
Initialize the RerankerConfig.
|
||||
|
||||
Args:
|
||||
**data: Keyword arguments for initializing the config.
|
||||
"""
|
||||
super().__init__(**data)
|
||||
self.validate_model()
|
||||
|
@ -31,6 +31,7 @@ venv_sync= "uv pip sync --python ./.venv/bin/python ./requirements.lock"
|
||||
venv_create_sync = {chain = ["venv_create", "venv_sync"]}
|
||||
check_deps = "basedpyright --project ./pyproject.toml"
|
||||
docs = "mkdocs serve"
|
||||
build_docs = "mkdocs build --strict"
|
||||
|
||||
[tool.basedpyright]
|
||||
include = ["src/"]
|
||||
|
Loading…
Reference in New Issue
Block a user