mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-01-23 01:02:56 -05:00
feat: Make OpenAI Request Timeout Configurable (#3808)
This commit is contained in:
@@ -233,6 +233,11 @@ class AppSettings(BaseSettings):
|
||||
but will incur additional API costs
|
||||
"""
|
||||
|
||||
OPENAI_REQUEST_TIMEOUT: int = 10
|
||||
"""
|
||||
The number of seconds to wait for an OpenAI request to complete before cancelling the request
|
||||
"""
|
||||
|
||||
# ===============================================
|
||||
# Web Concurrency
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ class OpenAIService(BaseService):
|
||||
self.get_client = lambda: AsyncOpenAI(
|
||||
base_url=settings.OPENAI_BASE_URL,
|
||||
api_key=settings.OPENAI_API_KEY,
|
||||
timeout=settings.OPENAI_REQUEST_TIMEOUT,
|
||||
)
|
||||
|
||||
super().__init__()
|
||||
|
||||
Reference in New Issue
Block a user