Skip to content

Commit

Permalink
Fix pylint and mypy errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
patryk-wyzgowski committed Sep 11, 2024
1 parent e35d8e2 commit 69d90b5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ jobs:
run: |
# run with coverage to not execute tests twice
source venv/bin/activate
coverage run -m pytest -v -p no:warnings --junitxml=report.xml
coverage run -m pytest -v -p no:warnings --junitxml=report.xml
coverage report
coverage xml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from typing import Optional

from ragnarok_common.embeddings.exceptions import EmbeddingConnectionError, EmbeddingStatusError, EmbeddingResponseError

try:
import litellm

Expand All @@ -10,6 +8,7 @@
HAS_LITELLM = False

from ragnarok_common.embeddings.base import Embeddings
from ragnarok_common.embeddings.exceptions import EmbeddingConnectionError, EmbeddingResponseError, EmbeddingStatusError


class LiteLLMEmbeddings(Embeddings):
Expand Down
8 changes: 4 additions & 4 deletions packages/ragnarok-dev-kit/src/ragnarok_dev_kit/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import jinja2
import typer
from pydantic import BaseModel
from ragnarok_dev_kit.discovery.prompt_discovery import PromptDiscovery

from ragnarok_common.llms import LiteLLM
from ragnarok_common.llms.clients import LiteLLMOptions
from ragnarok_dev_kit.discovery.prompt_discovery import PromptDiscovery


class PromptState:
Expand All @@ -26,7 +26,7 @@ class PromptState:
"Render Prompt" button and reflects in the "Rendered Prompt" field.
It is used for communication with the LLM.
llm_model_name (str): The name of the selected LLM model.
llm_api_key (str): The API key for the chosen LLM model.
llm_api_key (str | None): The API key for the chosen LLM model.
temp_field_name (str): Temporary field name used internally.
"""

Expand All @@ -35,7 +35,7 @@ class PromptState:
dynamic_tb: dict = {}
current_prompt = None
llm_model_name: str = ""
llm_api_key: str = ""
llm_api_key: str | None = ""
temp_field_name: str = ""


Expand Down Expand Up @@ -170,7 +170,7 @@ def get_input_type_fields(obj: BaseModel) -> list[dict]:


@typer_app.command()
def run_app(prompts_paths: str, llm_model: str, llm_api_key: str = None) -> None:
def run_app(prompts_paths: str, llm_model: str, llm_api_key: str | None = None) -> None:
"""
Launches the interactive application for working with Large Language Models (LLMs).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,3 @@ def discover(self) -> dict:
)._asdict()

return result_dict

0 comments on commit 69d90b5

Please sign in to comment.