feat: complete production hardening implementation, specialty canonicalization, google-genai migration, voice reliability, sqlite concurrency, and test suite consolidation
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
"""
|
||||
OpenAI LLM Provider.
|
||||
"""
|
||||
|
||||
from typing import Optional
|
||||
from app.ai.providers.base import LLMProvider
|
||||
from app.ai.openai_client import OpenAIClient
|
||||
|
||||
|
||||
class OpenAIProvider(LLMProvider):
|
||||
def __init__(self, timeout_seconds: float = 4.0):
|
||||
super().__init__(timeout_seconds=timeout_seconds)
|
||||
self.client = OpenAIClient()
|
||||
|
||||
async def _generate_internal(self, system_prompt: str, user_message: str) -> Optional[str]:
|
||||
api_key = getattr(self.client, "api_key", None)
|
||||
if not api_key or api_key in ["your_openai_key", "your_openai_api_key", ""]:
|
||||
return None
|
||||
return await self.client.generate_response(system_prompt, user_message)
|
||||
Reference in New Issue
Block a user