mirror of
https://ghfast.top/https://github.com/discourse/discourse-ai.git
synced 2026-07-15 11:27:11 +08:00
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. |
||
|---|---|---|
| .. | ||
| dialects | ||
| endpoints | ||
| anthropic_message_processor.rb | ||
| cancel_manager.rb | ||
| json_stream_decoder.rb | ||
| json_streaming_parser.rb | ||
| json_streaming_tracker.rb | ||
| llm.rb | ||
| nova_message_processor.rb | ||
| open_ai_message_processor.rb | ||
| prompt.rb | ||
| prompt_messages_builder.rb | ||
| report.rb | ||
| structured_output.rb | ||
| thinking.rb | ||
| tool_call.rb | ||
| tool_definition.rb | ||
| upload_encoder.rb | ||
| xml_tag_stripper.rb | ||
| xml_tool_processor.rb | ||