1254 Commits

Author SHA1 Message Date
Keegan George
ab67299acb
FIX: Invalid access error should be populated to user (#1303)
Invalid access error should be populated to user when trying to search for something they do not have permissions for (i.e. anons searching `in:messages`
2025-04-30 12:10:10 -07:00
Mark VanLandingham
1e32416eaa
UX: Empty state for AI conversations sidebar & btn changes (#1297)
This commit adds an empty state when the user doesn't have any PM history. It ALSO retains the new conversation button in the sidebar so it no longer jumps. The button is disabled, icon, and text are all updated.
2025-04-30 11:33:41 -05:00
Kris
81a664b3da
UX: put full page search discoveries in sidebar (#1289) 2025-04-30 12:01:21 -04:00
Sam
7dc3c30fa4
FEATURE: correctly decorate AI bots (#1300)
AI bots come in 2 flavors

1. An LLM and LLM user, in this case we should decorate posts with persona name
2. A Persona user, in this case, in PMs we decorate with LLM name

(2) is a significant improvement, cause previously when creating a conversation
you could not tell which LLM you were talking to by simply looking at the post, you would
have to scroll to the top of the page.

* lint

* translation missing
2025-04-30 16:36:38 +10:00
Sam
8b90ce7c86
FIX: llm selector memory broken (#1299)
llm selector for bot was no longer remembering selected item.
2025-04-30 14:15:28 +10:00
Sérgio Saquetim
ede65c971f
DEV: Add compatibility with the Glimmer Post Stream (#1230) 2025-04-29 23:55:54 -03:00
Sam
09a6841480
FIX: s3 was missing a const (#1298) 2025-04-30 07:58:24 +10:00
Mark VanLandingham
06ab446e47
UX: Adjust bot conversation header and sidebar on hamburger mode (#1295)
Context in dev conversation -- in hamburger mode we don't need the robot icon to swap to shuffle, AND we don't need back to forum link.
2025-04-29 10:10:44 -05:00
Kris
541e6d7437
UX: increase composer action z-index above ai suggestion (#1296) 2025-04-29 10:42:51 -04:00
Sam
17f04c76d8
FEATURE: add OpenAI image generation and editing capabilities (#1293)
This commit enhances the AI image generation functionality by adding support for:

1. OpenAI's GPT-based image generation model (gpt-image-1)
2. Image editing capabilities through the OpenAI API
3. A new "Designer" persona specialized in image generation and editing
4. Two new AI tools: CreateImage and EditImage

Technical changes include:
- Renaming `ai_openai_dall_e_3_url` to `ai_openai_image_generation_url` with a migration
- Adding `ai_openai_image_edit_url` setting for the image edit API endpoint
- Refactoring image generation code to handle both DALL-E and the newer GPT models
- Supporting multipart/form-data for image editing requests

* wild guess but maybe quantization is breaking the test sometimes

this increases distance

* Update lib/personas/designer.rb

Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>

* simplify and de-flake code

* fix, in chat we need enough context so we know exactly what uploads a user uploaded.

* Update lib/personas/tools/edit_image.rb

Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>

* cleanup downloaded files right away

* fix implementation

---------

Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
2025-04-29 17:38:54 +10:00
Renato Atilio
8669e8ae59
Revert "UX: keep composer actions above AI input icons (#1291)" (#1292)
This reverts commit 51a0516aa8c4caa13b01e47a6e8655659a9648ba.
2025-04-29 08:57:20 +10:00
Kris
51a0516aa8
UX: keep composer actions above AI input icons (#1291)
* UX: keep composer actions above AI input icons

* update comment
2025-04-28 10:45:28 -04:00
Discourse Translator Bot
de0a52a0d9
Update translations (#1265) 2025-04-28 13:41:53 +02:00
Isaac Janzen
b6630b670f
DEV: Update sidebar grouping date labels (#1290)
- Add `Today` label
- Make some minor UX changes
- Add specs
2025-04-26 15:31:22 -05:00
Isaac Janzen
81ef532268
UX: Only scroll when we surpass max input height (#1288) 2025-04-25 13:20:34 -05:00
Isaac Janzen
cd0cfc0bfc
DEV: Group PMs by date (#1287)
# Preview

https://github.com/user-attachments/assets/3fe3ac8f-c938-4df4-9afe-11980046944d

# Details

- Group pms by `last_posted_at`. In this first iteration we are group by `7 days`, `30 days`, then by month beyond that. 
- I inject a sidebar section link with the relative (last_posted_at) date and then update a tracked value to ensure we don't do it again. Then for each month beyond the first 30days, I add a value to the `loadedMonthLabels` set and we reference that (plus the year) to see if we need to load a new month label.
- I took the creative liberty to remove the `Conversations` section label - this had no purpose
- I hid the _collapse all sidebar sections_ carrot. This had no purpose. 
- Swap `BasicTopicSerializer` to `ListableTopicSerializer` to get access to `last_posted_at`
2025-04-25 13:20:18 -05:00
Joffrey JAFFEUX
60ea590ba5
DEV: invalid selector (#1286)
Playwright is going to be less permissive to this in the future.
2025-04-25 16:56:09 +02:00
Kris
10748015fd
UX: minor alignment adjustments for experiemental bot UI (#1285)
* UX: minor alignment adjustments for experiemental bot UI

* account for powered by discourse badge

* breakpoint lint
2025-04-24 17:27:31 -04:00
Mark VanLandingham
797d727a20
UX: Bring back New Conversation button on mobile sidebar (#1283) 2025-04-24 13:47:11 -05:00
Isaac Janzen
1a0d1d6e84
DEV: Add ai-bot-conversations-above-input plugin outlet and update loading animation (#1284)
Update loading animation 

https://github.com/user-attachments/assets/f3bb6ca7-5d84-4231-8ea1-fa49fa402eae


- Add plugin outlet 
- update `updateInputValue` so that it can be used by plugins to update the input value
2025-04-24 13:33:33 -05:00
Mark VanLandingham
298ebee7dd
DEV: Migration to backfill bot PM custom field (#1282)
In the last commit, I introduced a topic_custom_field to determine if a PM is indeed a bot PM.

This commit adds a migration to backfill any PM that is between 1 real user, and 1 bot. The correct topic_custom_field is added for these, so they will appear on the bot conversation sidebar properly.

We can also drop the joining to topic_users in the controller for sidebar conversations, and the isPostFromAiBot logic from the sidebar.
2025-04-24 13:02:43 -05:00
Mark VanLandingham
b7b9179bc8
FEATURE: Allow for persona & llm selection in bot conversations page (#1276) 2025-04-24 11:17:24 -05:00
Rafael dos Santos Silva
18dda31412
DEV: Update gems for Ruby 3.4 compatibility (#1281) 2025-04-24 13:02:51 -03:00
Sam
65718f6dbe
FIX: eat all leading spaces llms provide when they stream them (#1280)
* FIX: eat all leading spaces llms provide when they stream them

* improve so we don't stop replying...
2025-04-24 22:07:26 +10:00
Sam
2060426709
FIX: guard against situations where there is no reply, pass thread id (#1279) 2025-04-24 20:31:14 +10:00
Sam
2a5c60db10
FEATURE: display more places where AI is used / Chat streamer (#1278)
* FEATURE: display more places where AI is used

- Usage was not showing automation or image caption in llm list.
- Also: FIX - reasoning models would time out incorrectly after 60 seconds (raised to 10 minutes)

* correct enum not to enumerate non configured models

* FEATURE: implement chat streamer

This implements a basic chat streamer, it provides 2 things:

1. Gives feedback to the user when LLM is generating
2. Streams stuff much more efficiently to client (given it may take 100ms or so per call to update chat)
2025-04-24 16:22:19 +10:00
Jordan Vidrine
e1731dc3df
UX: Align styling with conventions (#1275) 2025-04-23 14:14:55 -05:00
Rafael dos Santos Silva
4470e8af9b
FIX: Tables should group only per their key on usage page (#1277) 2025-04-23 15:47:34 -03:00
Mark VanLandingham
86f82ea4d3
FIX: Do not re-render conversations sidebar on navigation (#1274) 2025-04-23 15:37:15 +10:00
Joffrey JAFFEUX
d2002f81a7
DEV: migrates tools form to form-kit (#1204)
This PR is a retry of: #1135, where we migrate AiTools form to FormKit. The previous PR accidentally removed code related to setting enum values, and as a result was reverted. This update includes enums correctly along with the previous updates.
2025-04-22 09:23:25 -07:00
Isaac Janzen
e8b0f86300
FEATURE: Bot Conversation Homepage (#1273) 2025-04-22 10:22:03 -05:00
Mark VanLandingham
244ec9d61e
REVERT: "FEATURE: Experimental Private Message Bot Homepage (#1159)" (#1272)
This reverts commit 5fec8fe79eeac7dae40013ff05f07ef18b568e38.
2025-04-21 16:42:05 -05:00
Mark VanLandingham
5fec8fe79e
FEATURE: Experimental Private Message Bot Homepage (#1159)
Overview
This PR introduces a Bot Homepage that was first introduced at https://ask.discourse.org/.

Key Features:
Add a bot homepage: /discourse-ai/ai-bot/conversations
Display a sidebar with previous bot conversations
Infinite scroll for large counts
Sidebar still visible when navigation mode is header_dropdown
Sidebar visible on homepage and bot PM show view
Add New Question button to the bottom of sidebar on bot PM show view
Add persona picker to homepage
2025-04-21 15:17:10 -05:00
Keegan George
d26c7ac48d
FEATURE: Add spending metrics to AI usage (#1268)
This update adds metrics for estimated spending in AI usage. To make use of it, admins must add cost details to the LLM config page (input, output, and cached input costs per 1M tokens). After doing so, the metrics will appear in the AI usage dashboard as the AI plugin is used.
2025-04-17 15:09:48 -07:00
Keegan George
e2b0287333
FEATURE: Enhance LLM context window settings (#1271)
### 🔍 Overview
This update performs some enhancements to the LLM configuration screen. In particular, it renames the UI for the number of tokens for the prompt to "Context window" since the naming can be confusing to the user. Additionally, it adds a new optional field called "Max output tokens".
2025-04-17 14:44:15 -07:00
Martin Brennan
0c8718e0d5
DEV: Update spec for topic tag suggester (#1269)
This second post was not used and is making the topic scroll
down to post 2, which can mess with editing the OP sometimes
2025-04-17 14:06:45 +10:00
Kris
3440395623
DEV: include excerpt-expanded class when gists are enabled (#1267) 2025-04-16 15:26:04 -04:00
Martin Brennan
b5d42f373b
DEV: Re-introduce proofreading specs (#1263)
Followup fe7e73a6a436795c053a611884431f663f4bdd27 and
1300cc8a36dc33870f0d3c81e1e1a21a93e1f1de

Reintroduces proofreader specs and unskips ones skipped when
streaming composer suggestions were added. We just need to make sure
the jobs run immediately in specs because the job is what sends the
MessageBus event to the UI.

Also adds a pageobject method to confirm a diff is shown
in the modal before pressing Confirm button.
2025-04-16 11:11:43 +10:00
Sam
0f34ce999f
FIX: omit thinking tokens from chat (#1264)
* FIX: omit thinking tokens from chat

Thinking tokens cause a lot of confusion in chat, get rid of them

* also catch partial tool just in case
2025-04-15 17:13:20 +10:00
Sam
274a54a324
FEATURE: Update model names and specs (#1262)
* FEATURE: Update model names and specs

- not a bug, but made it explicit that tools and thinking are not a chat thing
- updated all models to latest in presets (Gemini and OpenAI)

* allow larger context windows
2025-04-15 16:33:44 +10:00
Martin Brennan
fe7e73a6a4
Revert "DEV: Add test to cover proofreading in rich editor (#1259)" (#1261)
This reverts commit e81108abb6819d36eb3c6b9f539c56eb47d34e59.
2025-04-15 15:58:09 +10:00
Martin Brennan
e81108abb6
DEV: Add test to cover proofreading in rich editor (#1259)
This core PR must be merged for this to work
https://github.com/discourse/discourse/pull/32280

We want to make sure we don't have regressions with this
functionality in the rich editor, which uses contendeditable
and other APIs than the old composer.
2025-04-15 14:05:09 +10:00
Keegan George
1300cc8a36
FEATURE: Add streaming to composer helper (#1256)
This update adding streaming to the AI helper inside the composer.
2025-04-14 08:18:50 -07:00
Sam
38b492529f
FEATURE: improve context management (#1260)
1. Add age of post to topic context (1 month ago, 1 year ago, etc)
2. Refactor code for simplicity
3. Fix handling of post context in DMs which was not using new handling of uploads
2025-04-14 21:45:48 +10:00
Sam
67e3a610cb
FIX: invalid context construction for responders (#1257)
Previous to this fix we assumed the name field contained usernames
when in fact it was stored in the id field.

This fixes the context contruction and also adds some basic user
information to the context to assist responders in understanding
the cast of chars
2025-04-12 08:15:31 +10:00
Roman Rizzi
df63e36ad8
FEATURE: Make Mixtral tokenizer available for embeddings (#1258) 2025-04-11 12:01:38 -03:00
Keegan George
0024f2d264
FIX: Discovery shouldn't re-trigger when no search (#1255)
This update fixes an issue where discobot discoveries was re-triggering when search menu was opened with no query present.
2025-04-10 10:01:53 -07:00
Keegan George
ef08e5ea45
UX: Improve groups list in feature table when many groups (#1254)
This update improves the displaying of groups in the features table when there are many groups for a particular persona.
2025-04-10 09:14:51 -07:00
Keegan George
4de39a07e5
FEATURE: Configure persona backed features in admin panel (#1245)
In this feature update, we add the UI for the ability to easily configure persona backed AI-features. The feature will still be hidden until structured responses are complete.
2025-04-10 08:16:31 -07:00
Keegan George
129ced9088
FIX: Split topic suggester fixes (#1253)
This update fixes a few issues in the split topic suggester. It fixes an issue where not all the category suggestions were appearing in the client. It also fixes an issue where the `move-post` request fails when creating a new topic with only one tag suggestion.
2025-04-09 13:12:34 -07:00