open-notebook/open_notebook
danrush777 1a6fe4723b fix: handle structured content format in LLM response parsing
Some LLM providers (notably Gemini, DeepSeek via OpenAI-compatible
proxies) return ai_message.content as a list of content parts:
[{'type': 'text', 'text': '...', 'extras': {...}}]

The current code uses str() on non-string content, which produces the
Python repr of the entire list — not valid JSON. This breaks
PydanticOutputParser.parse() with OutputParserException.

This adds extract_text_content() to properly unwrap text from both
string and structured content formats, applied in ask.py, chat.py,
and prompt.py.

Fixes #329
2026-02-08 22:29:45 +01:00
..
ai fix: improve error logging for chat model configuration issues (#458) 2026-01-23 16:45:13 -03:00
database Fix re-embedding issues and improve retry strategy (#515) 2026-01-31 18:55:01 -03:00
domain fix: async insight creation to prevent transaction conflicts (#512) 2026-01-31 15:51:27 -03:00
graphs fix: handle structured content format in LLM response parsing 2026-02-08 22:29:45 +01:00
podcasts Feat/localization tests docker (#371) 2026-01-15 13:51:05 -03:00
utils fix: handle structured content format in LLM response parsing 2026-02-08 22:29:45 +01:00
__init__.py refactor: move environment variables loading to application entry point (#283) 2025-12-01 14:59:50 -03:00
CLAUDE.md feat: content-type aware chunking and unified embedding (#444) 2026-01-21 23:49:08 -03:00
config.py feat: add persistent tiktoken cache to reduce re-downloads (#171) 2025-10-19 14:50:52 -03:00
exceptions.py refactor database module and migrations 2024-10-30 16:33:07 -03:00