Commit Graph

258 Commits

Author SHA1 Message Date
Rafael dos Santos Silva 7174fff7f0
FEATURE: Automatic embeddings backfill 2023-10-23 16:54:24 -03:00
Rafael dos Santos Silva 0a76bea076
FEATURE: Skip embeddings persistence on digest match 2023-10-23 16:51:18 -03:00
Rafael dos Santos Silva 9a23eaf99a
FEATURE: Move embeddings on topic visit to sidekig low queue 2023-10-23 16:50:50 -03:00
Rafael dos Santos Silva a69d158695
pass object 2023-10-23 11:27:32 -03:00
Rafael dos Santos Silva 1a88e63284
Update assets/javascripts/discourse/connectors/post-text-buttons/ai-helper-options-menu.gjs
Co-authored-by: Roman Rizzi <roman@discourse.org>
2023-10-23 11:19:30 -03:00
Rafael dos Santos Silva 23bb552059
Update assets/javascripts/discourse/connectors/post-text-buttons/ai-helper-options-menu.gjs
Co-authored-by: Roman Rizzi <roman@discourse.org>
2023-10-23 11:19:23 -03:00
Rafael dos Santos Silva 949d721a9a
Update assets/javascripts/discourse/connectors/post-text-buttons/ai-helper-options-menu.gjs
Co-authored-by: Roman Rizzi <roman@discourse.org>
2023-10-23 11:19:15 -03:00
Rafael dos Santos Silva d3d11fec4d
Update assets/javascripts/discourse/connectors/post-text-buttons/ai-helper-options-menu.gjs
Co-authored-by: Roman Rizzi <roman@discourse.org>
2023-10-23 11:19:08 -03:00
Rafael dos Santos Silva d7639bd9ec
fix hardcoded post_id 2023-10-20 18:10:45 -03:00
Rafael dos Santos Silva 1a6a3854c1
make it work with other models too 2023-10-20 17:34:48 -03:00
Keegan George ae453067a0
DEV: Skip difficult to handle specs for now
Will revisit later when doing llm interface work
2023-10-20 10:54:23 -07:00
Keegan George db05bae9fd
DEV: Add prompt mode to before 2023-10-18 15:24:11 -07:00
Keegan George 807067f1a4
DEV: Add location attribute to prompts data
To separate prompts shown on composer, post, or both
2023-10-18 13:13:16 -07:00
Keegan George c3bc5822d9
DEV: Add specs 2023-10-12 16:09:00 -07:00
Keegan George 76c356dba9
DEV: Make post/composer AI helper dependant on different settings 2023-10-12 14:06:42 -07:00
Keegan George 143f4fe989
DEV: Outlet wrapper name 2023-10-11 13:26:59 -07:00
Keegan George 76332ad4ca
DEV: Outlet wrapper name update 2023-10-06 16:47:14 -07:00
Keegan George ca7c41f0f0
DEV: Update to reflect core PR changes 2023-10-06 16:42:11 -07:00
Keegan George f19f00d14a
DEV: Updates to reflect core PR changes 2023-10-06 11:08:38 -07:00
Keegan George d68c586b91
DEV: Add front-end and lint 2023-10-04 15:56:20 -07:00
Rafael dos Santos Silva cd46825057
adds explain 2023-10-04 18:42:05 -03:00
Rafael dos Santos Silva 84cc369552
FEATURE: Bge-large-en embeddings via Cloudflare Workers AI API (#241)
* FEATURE: Bge-large-en embeddings via Cloudflare Workers AI API

* forgot a file

* lint
2023-10-04 13:47:51 -03:00
Discourse Translator Bot 05c256f65b
Update translations (#239) 2023-10-04 09:54:32 +02:00
Rafael dos Santos Silva 4df258ce7d
FIX: Follow fix for missing claude tags in a7adce0 (#242) 2023-10-03 19:56:29 -03:00
Rafael dos Santos Silva a7adce0cf7
FIX: Fallback to whole response when Claude forgets tags (#240) 2023-10-03 15:39:30 -03:00
Sam 0cbf14e343
FEATURE: automation rule for triaging posts using LLM (#236)
The new automation rule can be used to perform llm based classification and categorization of topics. 

You specify a system prompt (which has %%POST%% as an input), if it returns a particular piece of text then we will apply rules such as tagging, hiding, replying or categorizing.

This can be used as a spam filter, a "oops you are in the wrong place" filter and so on. 

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2023-10-03 08:55:30 +11:00
Rafael dos Santos Silva 453928e7bb
FIX: Improvment to embeddings index task (#238) 2023-10-02 16:37:13 -03:00
Rafael dos Santos Silva 9d96c4d242
FIX: Suggest category/tag was broken since 2e5a393 (#237) 2023-10-02 16:36:56 -03:00
Rafael dos Santos Silva 102f47c1c4
FEATURE: Allow Anthropic inference via AWS Bedrock (#235)
If a module LLM model is set to claude-2 and the ai_bedrock variables are all present we will use AWS Bedrock instead of Antrhopic own APIs.

This is quite hacky, but will allow us to test the waters with AWS Bedrock early access with every module.

This situation of "same module, completely different API" is quite a bit far from what we had in the OpenAI/Azure separation, so it's more food for thought for when we start working on the LLM abstraction layer soon this year.
2023-10-02 12:58:36 -03:00
Sam ed7d1f06d1
FIX: improve token counting (#234)
We were running out of tokens under certain conditions (really long
chains)

Add more buffer.
2023-09-28 15:32:22 +10:00
Keegan George 237e9478df
UX: Use disable/enable state for custom prompt button (#233) 2023-09-27 14:27:16 -07:00
Keegan George 0c50d7d553
DEV: Improvements to context menu (#232) 2023-09-27 11:39:51 -07:00
Discourse Translator Bot 782600e64f
Update translations (#229) 2023-09-27 11:03:11 +02:00
Sam aa463d64f1
FEATURE: Add creative persona (#231)
This adds a new creative persona that has access to the underlying
model and no external integrations.

It allows people to use Claude/GPT models in a Discourse agnostic
way.
2023-09-27 10:48:38 +10:00
Rafael dos Santos Silva 525be42aa5
FIX: AIHelper custom prompts with OpenAI had wrong type (#230) 2023-09-25 17:26:00 -03:00
Keegan George 2e5a39360a
FEATURE: Create custom prompts with composer AI helper (#214)
* DEV: Add icon support

* DEV: Add basic setup for custom prompt menu

* FEATURE: custom prompt backend

* fix custom prompt param check

* fix custom prompt replace

* WIP

* fix custom prompt usage

* fixes

* DEV: Update front-end

* DEV: No more custom prompt state

* DEV: Add specs

* FIX: Title/Category/Tag suggestions

Suggestion dropdowns broke because it `messages_with_user_input(user_input)` expects a hash now.

* DEV: Apply syntax tree

* DEV: Restrict custom prompts to configured groups

* oops

* fix tests

* lint

* I love tests

* lint is cool tho

---------

Co-authored-by: Rafael dos Santos Silva <xfalcox@gmail.com>
2023-09-25 15:12:54 -03:00
Sam 316ea9624e
FIX: properly truncate !command prompts (#227)
* FIX: properly truncate !command prompts

### What is going on here?

Previous to this change where a command was issued by the LLM it
could hallucinate a continuation eg:

```
This is what tags are

!tags

some nonsense here
```

This change introduces safeguards so `some nonsense here` does not
creep in to the prompt history, poisoning the llm results

This in effect grounds the llm a lot better and results in the llm
forgetting less about results.

The change only impacts Claude at the moment, but will also improve
stuff for llama 2 in future.

Also, this makes it significantly easier to test the bot framework
without an llm cause we avoid a whole bunch of complex stubbing

* blank is not a valid bot response, do not inject into prompt
2023-09-15 07:02:37 +10:00
Roman Rizzi f57c1bb0f6
FEATURE: AI Helper endpoint to generate a thumbnail from text. (#224)
We pass the text to the current LLM and ask them to generate a StableDifussion prompt.
We'll use that to generate 4 samples, temporarily creating uploads and returning their short URLs.
2023-09-14 12:53:44 -03:00
Jarek Radosz 1eb70c4f0a
DEV: Fix rspec-expectations warnings (#228) 2023-09-14 17:50:13 +02:00
Sam 9e94457154
FIX: Made bot more robust (#226)
* FIX: Made bot more robust

This is a collection of small fixes

- Display "Searching for: ..." while searching instead of showing found 0 results.
- Only allow 5 commands in lang chain - 6 feels like too much
- On the 5th command stop informing the engine about functions, so it is forced to complete
- Add another 30 tokens of buffer and explain why
- Typo in command prompt


Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
2023-09-14 16:46:56 +10:00
Keegan George d35c8d5eca
FIX: Conditionally render AI suggestion buttons (#225) 2023-09-13 14:18:48 -07:00
Keegan George cf6a6ed9b8
FIX: AI Helper UX bugs (#223) 2023-09-13 09:53:19 -07:00
Sam cdd6faa648
FEATURE: add filter support to ai bot semantic search (#222)
Previously we would bypass semantic search if any filters were
present

Also shows progress now.
2023-09-13 14:59:45 +10:00
Rafael dos Santos Silva d1642533fb
FIX: Use "Related Topics" label consistently (#221) 2023-09-12 16:23:24 -03:00
Rafael dos Santos Silva 2c87bb0d99
FEATURE: Respect search filters in semantic search (#220)
* FEATURE: Respect search filters in semantic search

* lint
2023-09-12 16:16:33 -03:00
Roman Rizzi 50d7289623
FIX: Trigger initial semantic search. (#219)
I thought this wasn't neccessary and we could safely rely on the appEvent during the initial search.
It only fires if #searchEnabled is true, meaning the search term is valid.
2023-09-12 10:28:07 -03:00
Discourse Translator Bot 0d761f4305
Update translations (#218) 2023-09-12 15:27:58 +02:00
Sam d75e3ca82b
FEATURE: include tag and category context in search (#217)
Previous to this we just included title/body.. tags and category
structure can be very critical for decision making.
2023-09-12 16:09:28 +10:00
Sam b0310f90d3
FEATURE: add tags and categories to read context (#215)
Note, we perform permission checks on tag list against anon
to ensure we do not disclose information about private tags
to the llm which could get extracted.
2023-09-12 11:06:55 +10:00
Roman Rizzi 156931e1f4
FIX: Perform semantic search only when searchTerm is valid (#216) 2023-09-11 11:32:05 -03:00