Skip to content

Commit

Permalink
Delay import
Browse files Browse the repository at this point in the history
  • Loading branch information
mahaloz committed Jan 30, 2025
1 parent 7dbded9 commit 9ee097b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 39 deletions.
2 changes: 1 addition & 1 deletion dailalib/api/litellm/config_dialog.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
from typing import Optional

from .configuration import DAILAConfig
from dailalib.configuration import DAILAConfig
from .prompt_type import ALL_STYLES
from . import MODEL_TO_TOKENS

Expand Down
31 changes: 0 additions & 31 deletions dailalib/api/litellm/configuration.py

This file was deleted.

7 changes: 4 additions & 3 deletions dailalib/api/litellm/litellm_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

from . import DEFAULT_MODEL, LLM_COST, OPENAI_MODELS
from ..ai_api import AIAPI
from .configuration import DAILAConfig
from .config_dialog import DAILAConfigDialog
from dailalib.configuration import DAILAConfig

active_model = None
active_prompt_style = None
Expand Down Expand Up @@ -266,7 +265,9 @@ def get_model(self):

# single function to ask for all the settings
def ask_settings(self, *args, **kwargs):
# attempts to ask for all the configurations by the user.
# delay import
from .config_dialog import DAILAConfigDialog
# attempts to ask for all the configurations by the user.
dialog = DAILAConfigDialog(self.config)
new_config = dialog.config_dialog_exec()
if new_config:
Expand Down
8 changes: 4 additions & 4 deletions dailalib/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
from typing import Optional, Dict
from platformdirs import user_config_dir
import logging
import os

_l = logging.getLogger(__name__)

class DAILAConfig(BSConfig):
'''

class DAILAConfig(BSConfig):
"""
Configuration class for LLM API, model, prompt style, and probably other things in the future.
'''
"""
__slots__ = (
"save_location",
"_config_lock",
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ console_scripts =
[options.extras_require]
full =
varbert>=2.3.0
"PySide6-Essentials>=6.4.2,!=6.7.0"

0 comments on commit 9ee097b

Please sign in to comment.