Skip to content

Commit

Permalink
docs(fix): fixed warnings from griffe (#3381)
Browse files Browse the repository at this point in the history
# 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):
  • Loading branch information
StanGirard authored Oct 16, 2024
1 parent 029625e commit 1a38798
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
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

0 comments on commit 1a38798

Please sign in to comment.