fix: dynamic loading status during AI gen; navigator.clipboard copy; competitor analysis fallback
This commit is contained in:
@@ -82,7 +82,10 @@ class OpenAIProvider(AIProvider):
|
||||
system = SYSTEM_PROMPTS["extract"]
|
||||
schema_str = json.dumps(schema, indent=2)
|
||||
prompt = f"Schema:\n{schema_str}\n\nText:\n{text}\n\nExtracted JSON:"
|
||||
content = await self._call(system, prompt, response_format={"type": "json_object"})
|
||||
try:
|
||||
content = await self._call(system, prompt, response_format={"type": "json_object"})
|
||||
except Exception:
|
||||
content = await self._call(system, prompt)
|
||||
try:
|
||||
data = json.loads(content)
|
||||
return {"data": data, "confidence": 0.9, "provider": self.name}
|
||||
|
||||
Reference in New Issue
Block a user