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

YamlModel is deprecated class #137

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
7 changes: 4 additions & 3 deletions embedbase/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from functools import lru_cache
import typing
import os
from pydantic_yaml import YamlModel
from pydantic import BaseModel
from pydantic_yaml import parse_yaml_file_as


class VectorDatabaseEnum(str, Enum):
Expand All @@ -18,7 +19,7 @@ class EmbeddingProvider(str, Enum):
COHERE = "cohere"


class Settings(YamlModel):
class Settings(BaseModel):
openai_api_key: typing.Optional[str] = None
openai_organization: typing.Optional[str] = None
supabase_url: typing.Optional[str] = None
Expand All @@ -33,7 +34,7 @@ def get_settings_from_file(path: str = "config.yaml"):
"""
Read settings from a file, only supports yaml for now
"""
settings = Settings.parse_file(path)
settings = parse_yaml_file_as(Settings, path)

# TODO: move
# if firebase, init firebase
Expand Down