Open bossjones opened 2 months ago
another example:
from typing import Optional
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
model: str = 'gpt-3.5-turbo'
embedding_model: str = 'text-embedding-3-large'
dimensionality: int = 1024
API_ID: Optional[str] = None
API_HASH: Optional[str] = None
BOT_TOKEN: Optional[str] = None
OPENAI_API_KEY: str
POSTGRES_URI: str
settings = Settings(_env_file='.env')
from langchain_openai import OpenAIEmbeddings
embed = OpenAIEmbeddings(
model="text-embedding-3-large"
# With the `text-embedding-3` class
# of models, you can specify the size
# of the embeddings you want returned.
# dimensions=1024
)
eg: https://github.com/vintoniuk/anadeabot/blob/945fb9f998eaf2cf609f9d9f61c467cf05c865ba/anadeabot/database.py#L23