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

docs(fix): fixed warnings from griffe #3381

Merged
merged 1 commit into from
Oct 16, 2024
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,4 @@ backend/core/examples/chatbot/.chainlit/translations/en-US.json
.tox
Pipfile
*.pkl
backend/docs/site/*
3 changes: 2 additions & 1 deletion backend/core/quivr_core/base_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import yaml
from pydantic import BaseModel, ConfigDict
from typing import Self


class QuivrBaseConfig(BaseModel):
Expand All @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions backend/core/quivr_core/brain/brain.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def load(cls, folder_path: str | Path) -> Self:
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.

Expand Down Expand Up @@ -324,7 +324,7 @@ async def afrom_files(
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.

Expand Down
2 changes: 1 addition & 1 deletion backend/core/quivr_core/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self, chat_id: UUID, brain_id: UUID | None) -> None:
# 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.

Expand Down
5 changes: 0 additions & 5 deletions backend/core/quivr_core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,6 @@ def __init__(self, **data):
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()
Expand Down Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions backend/docs/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/"]
Expand Down
Loading