Commit Graph

1365 Commits

Author SHA1 Message Date
Rafael dos Santos Silva 2958417d18
Update app/controllers/discourse_ai/ai_bot/bot_controller.rb
Co-authored-by: Keegan George <kgeorge13@gmail.com>
2025-05-30 15:46:39 -03:00
Rafael Silva 849acd0bd6 feature tests 2025-05-30 14:56:08 -03:00
Rafael Silva b73fec4238 annotation 2025-05-30 14:43:19 -03:00
Rafael Silva a8e19182ce fix table name for rails convention 2025-05-30 14:39:24 -03:00
Rafael Silva d9fc621626 fix area name 2025-05-30 14:10:46 -03:00
Rafael Silva fcce5edb81 post review follow up 2025-05-30 14:03:08 -03:00
Rafael Silva 9a8207dec1 remove settings area for now 2025-05-30 13:58:19 -03:00
Rafael Silva 5d9613bb46 review fixes 2025-05-30 13:46:33 -03:00
Rafael Silva e8d83402fc rubocop 2025-05-30 11:35:28 -03:00
Rafael Silva 23530a9584 make it simpler 2025-05-30 11:09:24 -03:00
Rafael Silva 34c28e6d5b simplify persona tests 2025-05-30 10:59:21 -03:00
Rafael Silva 1485e46888 fix tests 2025-05-30 10:45:32 -03:00
Rafael Silva cd3fd8a35d linter 2025-05-29 21:32:49 -03:00
Rafael Silva 016f8be20b moar tests 2025-05-29 21:32:22 -03:00
Rafael Silva 2b52ea5fd6 job test 2025-05-29 21:24:19 -03:00
Rafael Silva 8355a23766 tests 2025-05-29 20:55:27 -03:00
Rafael Silva 491691f230 annoying fixes 2025-05-29 19:14:30 -03:00
Rafael Silva 6cb7b4dd04 stree 2025-05-29 18:54:09 -03:00
Rafael Silva 2d6f4eab0b rubocop 2025-05-29 18:53:14 -03:00
Rafael Silva 5500b1c2ff tests 2025-05-29 18:10:56 -03:00
Roman Rizzi a73e9e6724
Add proper support for array types in structured outputs 2025-05-29 18:06:20 -03:00
Rafael Silva 5682e8db0d loooooooong 2025-05-29 16:05:15 -03:00
Rafael Silva f42af996d3 create/add 2025-05-29 15:59:30 -03:00
Rafael Silva 3a691332fe rubocop 2025-05-29 15:58:13 -03:00
Rafael Silva c1fc3c706c cleanup 2025-05-29 14:42:50 -03:00
Rafael Silva 2312a6fc43 post rebase fixes 2025-05-29 14:42:50 -03:00
Rafael Silva 0e817a71ac cleaning up 2025-05-29 14:42:50 -03:00
Rafael Silva 6ad2f7b83f Working deduplication 2025-05-29 14:42:50 -03:00
Rafael Silva ad94cb7509 Dedup concepts 2025-05-29 14:42:50 -03:00
Rafael Silva 5fe78aa1ff dots are not commas 2025-05-29 14:42:50 -03:00
Rafael Silva 7fdd67fe78 pass context 2025-05-29 14:42:50 -03:00
Rafael Silva 990a17a9ab tests 2025-05-29 14:42:50 -03:00
Rafael Silva 170c657672 small fixes 2025-05-29 14:42:50 -03:00
Rafael Silva 446e6e7366 lint 2025-05-29 14:42:50 -03:00
Rafael Silva 1fec8dc6be FEATURE: Extend inferred concepts to include posts
* Adds support for concepts to be inferred from and applied to posts
* Replaces daily task with one that handles both topics and posts
* Adds database migration for posts_inferred_concepts join table
* Updates PersonaContext to include inferred concepts
2025-05-29 14:42:50 -03:00
Rafael Silva 04c6e55371 FEATURE: add inferred concepts system
This commit adds a new inferred concepts system that:
- Creates a model for storing concept labels that can be applied to topics
- Provides AI personas for finding new concepts and matching existing ones
- Adds jobs for generating concepts from popular topics
- Includes a scheduled job that automatically processes engaging topics
2025-05-29 14:42:48 -03:00
Natalie Tay 373e2305d6
FEATURE: Automatic translation and localization of posts, topics, categories (#1376)
Related: https://github.com/discourse/discourse-translator/pull/310

This commit includes all the jobs and event hooks to localize posts, topics, and categories.

A few notes:
- `feature_name: "translation"` because the site setting is `ai-translation` and module is `Translation`
- we will switch to proper ai-feature in the near future, and can consider using the persona_user as `localization.localizer_user_id`
- keeping things flat within the module for now as we will be moving to ai-feature soon and have to rearrange
- Settings renamed/introduced are:
  - ai_translation_backfill_rate (0)
  - ai_translation_backfill_limit_to_public_content (true)
  - ai_translation_backfill_max_age_days (5)
  - ai_translation_verbose_logs (false)
2025-05-29 17:28:06 +08:00
Guhyoun Nam ad5c48d9ae
DEV: Add appEvents trigger for AI New Question button (#1379)
* DEV: Add appEvents trigger for AI New Question button

* appEvent name update
2025-05-28 13:26:37 -05:00
Keegan George d99c335dab
DEV: Ensure enabling/disabling spam is set and logged (#1378)
Since we enable/disable `ai_spam_detection_enabled` setting in a custom Spam tab UI in AI, we want to ensure we retain the setting and logging features. To preserve that, we want to update the controller to use `SiteSetting.set_and_log` instead of setting the value directly.
2025-05-28 10:12:21 -07:00
Roman Rizzi 01e29ca5d8
FIX: Bump persona's examples length (#1377) 2025-05-28 14:01:44 -03:00
Keegan George 297c64c3b8
DEV: Unhide spam detection setting (#1374)
## 🔍 Overview
We want to unhide `ai_spam_detection_enabled` setting so that we can retain staff action log features. However, we also want to ensure users cannot enable spam detection without having `AiModerationSetting.spam` present in the database.

In this update we unhide the setting, but also add a validator to ensure the necessary configuration is in place before allowing the setting to be enabled.
2025-05-28 07:50:56 -07:00
David Taylor ca78b1a1c5
DEV: Patch `Net::BufferedIO` to help debug spec flakes (#1375)
Internal `/t/154170`
2025-05-28 10:24:07 +01:00
Discourse Translator Bot 39653aed22
Update translations (#1371) 2025-05-27 22:11:32 +02:00
Sam 6781ecd02e
DEV: cleanup diff streaming (#1370)
This simplifies some of the internal logic and ensures it is a
bit more robust
2025-05-27 18:12:02 +10:00
Keegan George e264572597
FIX: Closing AI menu stops post audio from playing (#1369)
## 🔍 Overview
When you have a post with audio being played and you open and close the AI post helper menu, it re-renders the entire post DOM, causing the audio to be interrupted and stop playing.

The reason for this is because we highlight the selected text when opening the AI post helper menu and we replace the entire post back with the original post HTML when closing the menu. This fix ensures that we do not re-render the entire post DOM and instead only remove the highlighted section that was added.

## 🔗 Context
https://meta.discourse.org/t/ai-helper-interrupting-uploaded-mp3-audio-stream/366817?u=keegan
2025-05-26 10:24:06 -07:00
Sam 70b0db2871
FIX: improve researcher tool - fix topic filters (#1368)
* Small fix, reasoning is now available on Claude 4 models

* fix invalid filters should raise, topic filter not working

* fix spec so we are consistent
2025-05-26 16:00:44 +10:00
Sam 2d6ec5e1e6
FIX: apply diffs more consistently (#1367)
* FIX: apply diffs more consistently

1. Do escaping direct in diff streamer, that way HTML tags and other unsafe chars can be displayed and fixed
2. Add safeguard to ensure streaming always stops when it was terminated elsewhere

* lint

* bug unsubscribe should unsubscribe
2025-05-24 15:19:48 +10:00
Mark VanLandingham cead887480
FIX: Don't error when navigating from AI Bot topic to regular (#1366)
We were getting an error in this logic causing Ember to fail to render the non-bot-topic that we navigate to.

I believe this is because the getter of participants is re-calculating (due to this.header.topicInfo being updated) before the args to this connector changes. Adding some safe navigation here fixes the issue.
2025-05-23 13:30:08 -05:00
Jordan Vidrine adc92e1e75
UX: Allow rounded corners (#1365) 2025-05-23 10:42:55 -05:00
Roman Rizzi 0ce17a122f
FIX: Correctly pass tool_choice when using Claude models. (#1364)
The `ClaudePrompt` object couldn't access the original prompt's tool_choice attribute, affecting both Anthropic and Bedrock.
2025-05-23 10:36:52 -03:00