Commit Graph
41 Commits
Author SHA1 Message Date
Keegan George 0733ff7e67 UX: Show suggestion buttons only if sufficient content is present (#204) 2023-09-06 12:20:08 -07:00
Roman Rizzi 4d854e9232 FIX: Invalidate semantic search cache entries when hyde or embedding model changes (#202) 2023-09-05 18:39:39 -03:00
Keegan George 3a00c38fc5 UX: Change AI Helper toggle icon to sparkles (#201) 2023-09-05 13:21:05 -07:00
Rafael dos Santos SilvaandRoman Rizzi 2c0f535bab FEATURE: HyDE-powered semantic search. (#136)
* FEATURE: HyDE-powered semantic search.

It relies on the new outlet added on discourse/discourse#23390 to display semantic search results in an unobtrusive way.

We'll use a HyDE-backed approach for semantic search, which consists on generating an hypothetical document from a given keywords, which gets transformed into a vector and used in a asymmetric similarity topic search.

This PR also reorganizes the internals to have less moving parts, maintaining one hierarchy of DAOish classes for vector-related operations like transformations and querying.

Completions and vectors created by HyDE will remain cached on Redis for now, but we could later use Postgres instead.

* Missing translation and rate limiting

---------

Co-authored-by: Roman Rizzi <[email protected]>
2023-09-05 11:08:23 -03:00
Rafael dos Santos Silva 43e485cbd9 FEATURE: Additional AI suggestion options (#176) 2023-09-01 17:10:58 -07:00
Sam db19e37748 FEATURE: add initial support for personas (#172)
This splits out a bunch of code that used to live inside bots
into a dedicated concept called a Persona.

This allows us to start playing with multiple personas for the bot

Ships with:

artist - for making images
sql helper - for helping with data explorer
general - for everything and anything
 
Also includes a few fixes that make the generic LLM function implementation  more robust
2023-08-30 16:15:03 +10:00
Keegan George 4da4b5609f FIX: Show warning when trying to generate suggestions without content (#175) 2023-08-29 11:58:45 -07:00
Keegan George 494964c51d DEV: Dynamically set popper placement (#174) 2023-08-29 11:19:25 -07:00
Keegan George 7457feced8 FEATURE: Show suggested title prompt in new location (#171) 2023-08-29 09:45:53 -07:00
Keegan George fba419f864 UX: Clicking outside editor should close context menu (#170) 2023-08-28 15:08:51 -07:00
Keegan George 2c50791f26 UX: Prevent context menu overflow outside of container (#168) 2023-08-28 13:31:21 -07:00
Keegan George b470692409 DEV: Preload prompt list on component initialization (#165) 2023-08-28 12:22:44 -07:00
Keegan George 7790313b1b DEV: Add review menu state (#159) 2023-08-24 17:49:24 -07:00
Keegan George 65c6b5e16c DEV: Add keybindings (#157)
- Ability to Esc to close context menu
- Ability to Ctrl/Cmd + Z to undo results
2023-08-24 08:35:53 +10:00
Keegan George 78558b9cf5 DEV: Remove context menu timeout (#156) 2023-08-23 15:12:07 -07:00
Keegan George 3cf316fb62 FIX: Context menu not appearing in Firefox (#154) 2023-08-23 14:20:31 -07:00
Keegan George 45b7b57726 FIX: Pages with small composers breaking (#155) 2023-08-23 14:20:14 -07:00
Keegan George 1289ae1c57 FIX: Add check for PMs before showing AI helper context menu (#153) 2023-08-23 11:24:51 -07:00
Keegan George 4a00b7eb0e FIX: Show AI helper only if in allowed groups (#152) 2023-08-23 11:06:04 -07:00
Keegan George 6df850d473 FEATURE: AI Helper Context Menu (#148) 2023-08-23 10:35:40 -07:00
Roman Rizzi f111bcb35b FIX: Display related topics when scrolling to the bottom of a topic. (#150)
Besides updating the connector using the new tracking preference service interface, this PR fixes a bug where due to `ai_embeddings_semantic_related_topics_enabled` not having `client: true` the initializer never ran, and we didn't show the related topics list when scrolling to the bottom of a long topic.
2023-08-22 14:10:21 -03:00
Roman Rizzi c0415bb7eb UX: Pill design is the default on both mobile and desktop (#142) 2023-08-17 14:37:14 -03:00
Sam 3e46250f3f UX: Adjust bot warning so it looks better (#141)
This moves the bot warning from `composer-after-composer-editor` to
`after-d-editor` (with a minor adjustment for outlet args to match new name)
2023-08-17 14:43:14 +10:00
Sam b4477ecdcd FEATURE: support 16k and 32k variants for Azure GPT (#140)
Azure requires a single HTTP endpoint per type of completion.

The settings: `ai_openai_gpt35_16k_url` and `ai_openai_gpt4_32k_url` can be
used now to configure the extra endpoints

This amends token limit which was off a bit due to function calls and fixes
a minor JS issue where we were not testing for a property
2023-08-17 11:00:11 +10:00
SamandRafael dos Santos Silva 01f833f86e FEATURE: optional warning attached to all AI bot conversations (#137)
* FEATURE: optional warning attached to all AI bot conversations

This commit introduces `ai_bot_enable_chat_warning` which can be used
to warn people prior to starting a chat with the bot.

In particular this is useful if moderators are regularly reading chat
transcripts as it sets expectations early.

By default this is disabled.

Also:

- Stops making ajax call prior to opening composer
- Hides PM title when starting a bot PM

Co-authored-by: Rafael dos Santos Silva <[email protected]>
2023-08-17 06:29:58 +10:00
Roman Rizzi c8de9495c8 UX: Update related-topics to follow <MoreTopics/> conventions (#118) 2023-07-31 18:33:37 -03:00
David TaylorandRafael dos Santos Silva 48d880d3c8 FIX: Rerender related topics correctly when topic changes (#100)
* FIX: Rerender related topics correctly when topic changes


Co-authored-by: Rafael dos Santos Silva <[email protected]>
2023-07-13 16:34:02 -03:00
Roman Rizzi 3364fec425 DEV: Remove the summarization feature (#83)
* DEV: Remove the summarization feature

Instead, we'll register summarization implementations for OpenAI, Anthropic, and Discourse AI using the API defined in discourse/discourse#21813.

Core and chat will implement features on top of these implementations instead of this plugin extending them.

* Register instances that contain the model, requiring less site settings
2023-06-13 14:32:26 -03:00
David Taylor 261fe13599 DEV: Tweaks for drop-down implementation (#69)
- Remove unused 'toggleAiBotPanel' widget action

- Switch from appEvents to closure actions

- Convert widget definition to native class syntax, so that we can use `@action` decorator. (alternatively, we could have done `{ closePanel: this.hideAiBotPanel.bind(this) }` in `RenderGlimmer`
2023-05-18 09:28:43 +01:00
Sam deb34bb52f UX: improve drop down menu for enabled bots (#68)
Previously we were not using using HeaderPanel for drop down, which caused
it not to properly act like a header panel.

- Not styled right
- Not hidden when other buttons clicked

Etc...

Header is sadly full of legacy so this is somewhat hacky weaving widgets.
2023-05-18 16:10:08 +10:00