discourse-ai/lib/personas
Roman Rizzi ff2e18f9ca
FIX: Structured output discrepancies. (#1340)
This change fixes two bugs and adds a safeguard.

The first issue is that the schema Gemini expected differed from the one sent, resulting in 400 errors when performing completions.

The second issue was that creating a new persona won't define a method
for `response_format`. This has to be explicitly defined when we wrap it inside the Persona class. Also, There was a mismatch between the default value and what we stored in the DB. Some parts of the code expected symbols as keys and others as strings.

Finally, we add a safeguard when, even if asked to, the model refuses to reply with a valid JSON. In this case, we are making a best-effort to recover and stream the raw response.
2025-05-15 11:32:10 -03:00
..
artifact_update_strategies FEATURE: forum researcher persona for deep research (#1313) 2025-05-14 12:36:16 +10:00
tools FEATURE: allow researcher to also research specific topics (#1339) 2025-05-15 17:48:21 +10:00
artist.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
bot.rb FIX: Structured output discrepancies. (#1340) 2025-05-15 11:32:10 -03:00
bot_context.rb FEATURE: forum researcher persona for deep research (#1313) 2025-05-14 12:36:16 +10:00
creative.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
dall_e_3.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
designer.rb FEATURE: add OpenAI image generation and editing capabilities (#1293) 2025-04-29 17:38:54 +10:00
discourse_helper.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
forum_researcher.rb FEATURE: forum researcher persona for deep research (#1313) 2025-05-14 12:36:16 +10:00
general.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
github_helper.rb FEATURE: ensure researcher and github helper know the date (#1312) 2025-05-06 14:39:30 +10:00
persona.rb FEATURE: forum researcher persona for deep research (#1313) 2025-05-14 12:36:16 +10:00
question_consolidator.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
researcher.rb FEATURE: ensure researcher and github helper know the date (#1312) 2025-05-06 14:39:30 +10:00
settings_explorer.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
short_summarizer.rb FIX: Structured output discrepancies. (#1340) 2025-05-15 11:32:10 -03:00
sql_helper.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
summarizer.rb FIX: Structured output discrepancies. (#1340) 2025-05-15 11:32:10 -03:00
tool_runner.rb FEATURE: allow tools to amend personas (#1250) 2025-04-09 15:48:25 +10:00
web_artifact_creator.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00