feat: OpenAI Ingredient Parsing (#3581)

This commit is contained in:
Michael Genson
2024-05-22 04:45:07 -05:00
committed by GitHub
parent 4c8bbdcde2
commit 5c57b3dd1a
28 changed files with 789 additions and 274 deletions

View File

@@ -207,6 +207,31 @@ class AppSettings(BaseSettings):
return self.OIDC_AUTH_ENABLED and not_none and valid_group_claim
# ===============================================
# OpenAI Configuration
OPENAI_BASE_URL: str | None = None
"""The base URL for the OpenAI API. Leave this unset for most usecases"""
OPENAI_API_KEY: str | None = None
"""Your OpenAI API key. Required to enable OpenAI features"""
OPENAI_MODEL: str = "gpt-4o"
"""Which OpenAI model to send requests to. Leave this unset for most usecases"""
OPENAI_WORKERS: int = 2
"""
Number of OpenAI workers per request. Higher values may increase
processing speed, but will incur additional API costs
"""
OPENAI_SEND_DATABASE_DATA: bool = True
"""
Sending database data may increase accuracy in certain requests,
but will incur additional API costs
"""
@property
def OPENAI_ENABLED(self) -> bool:
"""Validates OpenAI settings are all set"""
return bool(self.OPENAI_API_KEY and self.OPENAI_MODEL)
# ===============================================
# Testing Config