discourse-ai/lib/completions/endpoints
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
..
anthropic.rb DEV: Use structured responses for summaries (#1252) 2025-05-06 10:09:39 -03:00
aws_bedrock.rb DEV: Use structured responses for summaries (#1252) 2025-05-06 10:09:39 -03:00
base.rb DEV: use a proper object for tool definition (#1337) 2025-05-15 17:32:39 +10:00
canned_response.rb FEATURE: forum researcher persona for deep research (#1313) 2025-05-14 12:36:16 +10:00
cohere.rb FEATURE: improve tool support (#904) 2024-11-12 08:14:30 +11:00
fake.rb FEATURE: forum researcher persona for deep research (#1313) 2025-05-14 12:36:16 +10:00
gemini.rb FIX: Structured output discrepancies. (#1340) 2025-05-15 11:32:10 -03:00
hugging_face.rb FEATURE: improve tool support (#904) 2024-11-12 08:14:30 +11:00
mistral.rb FEATURE: Add support for Mistral models (#919) 2024-11-19 17:28:09 +11:00
ollama.rb FEATURE: improve tool support (#904) 2024-11-12 08:14:30 +11:00
open_ai.rb FEATURE: forum researcher persona for deep research (#1313) 2025-05-14 12:36:16 +10:00
open_router.rb FEATURE: allow disabling of top_p and temp for thinking models (#1184) 2025-03-11 16:54:02 +11:00
samba_nova.rb DEV: Use structured responses for summaries (#1252) 2025-05-06 10:09:39 -03:00
vllm.rb FEATURE: improve tool support (#904) 2024-11-12 08:14:30 +11:00