discourse-ai/app/models
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
..
ai_api_audit_log.rb FEATURE: track duration of AI calls (#1082) 2025-01-23 11:32:12 +11:00
ai_artifact.rb DEV: artifact system update (#1096) 2025-02-04 16:27:27 +11:00
ai_artifact_version.rb DEV: improve artifact editing and eval system (#1130) 2025-02-19 15:44:33 +11:00
ai_moderation_setting.rb FEATURE: Add AI-powered spam detection for new user posts (#1004) 2024-12-12 09:17:25 +11:00
ai_persona.rb FIX: Structured output discrepancies. (#1340) 2025-05-15 11:32:10 -03:00
ai_spam_log.rb FIX: Check post action creator result when flagging spam (#1119) 2025-02-11 13:29:27 +10:00
ai_summary.rb FIX: Set default for existing records. (#1073) 2025-01-16 10:38:53 -03:00
ai_tool.rb REFACTOR: Move personas into its own module. (#1233) 2025-03-31 14:42:33 -03:00
chat_message_custom_prompt.rb DEV: Rewire AI bot internals to use LlmModel (#638) 2024-06-18 14:32:14 -03:00
classification_result.rb DEV: Updates to sentiment analysis reports (#1161) 2025-03-05 13:53:56 -08:00
completion_prompt.rb FIX: regression, no longer sending examples to AI helper (#993) 2024-12-03 16:03:46 +11:00
embedding_definition.rb FEATURE: Make Mixtral tokenizer available for embeddings (#1258) 2025-04-11 12:01:38 -03:00
llm_model.rb FEATURE: support configurable thinking tokens for Gemini (#1322) 2025-05-08 07:39:50 +10:00
llm_quota.rb FEATURE: llm quotas (#1047) 2025-01-14 15:54:09 +11:00
llm_quota_usage.rb FEATURE: llm quotas (#1047) 2025-01-14 15:54:09 +11:00
model_accuracy.rb DEV: Update rubocop-discourse to version 3.8.0 (#641) 2024-05-28 11:15:42 +02:00
post_custom_prompt.rb FEATURE: AI Bot RAG support. (#537) 2024-04-01 13:43:34 -03:00
rag_document_fragment.rb DEV: Robust check for embeddings enabled (#1116) 2025-02-06 12:18:55 -03:00
reviewable_ai_chat_message.rb DEV: Update annotations for models using Core tables (#1140) 2025-02-20 11:49:50 -03:00
reviewable_ai_post.rb DEV: Update annotations for models using Core tables (#1140) 2025-02-20 11:49:50 -03:00
shared_ai_conversation.rb SECURITY: Fix XSS on Shared AI Conversations local Onebox (#1069) 2025-01-14 18:05:37 -03:00