mirror of
https://github.com/VectifyAI/PageIndex.git
synced 2026-07-24 21:41:04 +02:00
fix: drop remaining guessed-key fallback in cloud chat response parsing
The chat completions response is strictly OpenAI-shaped; top-level 'content'/'answer' keys never existed. Same cleanup as the tree/OCR parsing fix.
This commit is contained in:
parent
1790e0cf2c
commit
4ffc6b5c0c
1 changed files with 1 additions and 2 deletions
|
|
@ -424,11 +424,10 @@ class CloudBackend:
|
|||
"doc_id": doc_id,
|
||||
"stream": False,
|
||||
})
|
||||
# Extract answer from response
|
||||
choices = resp.get("choices", [])
|
||||
if choices:
|
||||
return choices[0].get("message", {}).get("content", "")
|
||||
return resp.get("content", resp.get("answer", ""))
|
||||
return ""
|
||||
|
||||
async def query_stream(self, collection: str, question: str,
|
||||
doc_ids: str | list[str] | None = None) -> AsyncIterator[QueryEvent]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue