Skip to content

Commit

Permalink
Change method names.
Browse files Browse the repository at this point in the history
  • Loading branch information
milistu committed Jun 1, 2024
1 parent cd639e5 commit e9dc48d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/test_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@

from router.query_router import semantic_query_router
from router.router_prompt import ROUTER_PROMPT
from utils import load_config_from_yaml
from utils import load_config


class RouterTest(unittest.TestCase):

def setUp(self) -> None:
# Load configuration
config_path = Path("./config.yaml")
self.config = load_config_from_yaml(yaml_file_path=config_path)
self.config = load_config(yaml_file_path=config_path)

# Initialize OpenAI client
self.openai_client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])
Expand Down
4 changes: 2 additions & 2 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ class Config(BaseModel):
openai: OpenAIConfig


def load_config_from_yaml(yaml_file_path: str = "./config.yaml") -> Config:
def load_config(yaml_file_path: str = "./config.yaml") -> Config:
with open(yaml_file_path, "r") as file:
yaml_content = yaml.safe_load(file)
return Config(**yaml_content)


@st.cache_resource
def init_clients() -> Tuple[OpenAI, QdrantClient]:
def initialize_clients() -> Tuple[OpenAI, QdrantClient]:
"""
Initializes and returns the clients for OpenAI and Qdrant services.
Expand Down

0 comments on commit e9dc48d

Please sign in to comment.