Commit Graph
1332 Commits
Author SHA1 Message Date
Keegan George 64587967c9 DEV: Cook streamed suggestion (#354) 2023-12-13 12:24:22 -08:00
Roman Rizzi 031c2a6b46 Revert "FIX: Recover from Bedrock returning invalid base64 payloads during streaming (#352)" (#353)
This reverts commit ef7d4cc509.
2023-12-12 17:22:44 -03:00
Roman Rizzi ef7d4cc509 FIX: Recover from Bedrock returning invalid base64 payloads during streaming (#352) 2023-12-12 17:06:53 -03:00
6aaf1f002e FEATURE: Add streaming to post AI helper's explain option (#344)
Co-authored-by: Rafael dos Santos Silva <[email protected]>
Co-authored-by: Roman Rizzi <[email protected]>
2023-12-12 09:28:39 -08:00
Discourse Translator Bot d4357c29c7 Update translations (#350) 2023-12-12 14:24:01 +01:00
Sam 605445831f FEATURE: try including views/username/likes in search results (#349)
This is somewhat experimental, but the context of likes/view/username
can help the llm find out what content is more important or even
common users that produce great content

This inflates the amount of tokens somewhat, but given it is all numbers
and search columns titles are only included once this is not severe
2023-12-12 12:22:28 +11:00
Roman Rizzi 2798e4c86d FIX: Custom instructions where missing when generating custom prompt input (#348) 2023-12-11 19:26:56 -03:00
Keegan George a89549919d FIX: Missing closing > in input tag (#347) 2023-12-11 12:09:17 -08:00
Sam a66b1042cc FEATURE: scale up result count for search depending on model (#346)
We were limiting to 20 results unconditionally cause we had to make
sure search always fit in an 8k context window.

Models such as GPT 3.5 Turbo (16k) and GPT 4 Turbo / Claude 2.1 (over 150k)
allow us to return a lot more results.

This means we have a much richer understanding cause context is far
larger.

This also allows a persona to tweak this number, in some cases admin
may want to be conservative and save on tokens by limiting results

This also tweaks the `limit` param which GPT-4 liked to set to tell
model only to use it when it needs to (and describes default behavior)
2023-12-11 16:54:16 +11:00
SamandMartin Brennan 3c9901d43a FEATURE: implement GPT-4 turbo support (#345)
Keep in mind:

- GPT-4 is only going to be fully released next year - so this hardcodes preview model for now
- Fixes streaming bugs which became a big problem with GPT-4 turbo
- Adds Azure endpoing for turbo as well

Co-authored-by: Martin Brennan <[email protected]>
2023-12-11 14:59:57 +11:00
Sam 6380ebd829 FEATURE: allow personas to provide command options (#331)
Personas now support providing options for commands.

This PR introduces a single option "base_query" for the SearchCommand. When supplied all searches the persona will perform will also include the pre-supplied filter.

This can allow personas to search a subset of the forum (such as documentation)

This system is extensible we can add options to any command trivially.
2023-12-08 08:42:56 +11:00
Rafael dos Santos Silva 381b0d74ca FIX: Handle truncation in HyDE search (#342) 2023-12-07 10:36:56 -03:00
Roman Rizzi 450ec915d8 FIX: Make FoldContent strategy more resilient when using models with low token count. (#341)
We'll recursively summarize  the content into smaller chunks until we are sure we can concatenate
them without going over the token limit.
2023-12-06 19:00:24 -03:00
Rafael dos Santos Silva c8352f21ce FIX: Fallback to whole LLM response when XML fail (#340) 2023-12-06 18:58:26 -03:00
Rafael dos Santos Silva 7ac1dbb6b6 FEATURE: Llama2 support in AiHelper (#339) 2023-12-06 17:47:53 -03:00
Rafael dos Santos Silva 252efdf142 FIX: Don't echo prompt back on HF/TGI (#338)
* FIX: Don't echo prompt back on HF/TGI

* teeeeests
2023-12-06 16:06:26 -03:00
Rafael dos Santos Silva d8267d8da0 FIX: Many fixes for huggingface and llama2 inference (#335) 2023-12-06 11:22:42 -03:00
Martin Brennan 24370a9ca6 Revert "FIX: Use Guardian.basic_user instead of new (anon) (#332)" (#337)
This reverts commit a3a1285dc5.

c.f. https://github.com/discourse/discourse/pull/24742
2023-12-06 16:26:43 +10:00
Mal Curtis 525ba801ff s/Azuer/Azure (#336) 2023-12-06 17:00:10 +11:00
Martin Brennan a3a1285dc5 FIX: Use Guardian.basic_user instead of new (anon) (#332)
c.f. de983796e1b66aa2ab039a4fb6e32cec8a65a098

There will soon be additional login_required checks
for Guardian, and the intent of many checks by automated
systems is better fulfilled by using BasicUser, which
simulates a logged in TL0 forum user, rather than an
anon user.
2023-12-06 12:01:41 +10:00
Jordan Vidrine 92286ad0c4 UX: Add title to button (#334) 2023-12-05 14:33:10 -06:00
Discourse Translator Bot 5f464c7b1b Update translations (#333) 2023-12-05 14:39:18 +01:00
Rafael dos Santos SilvaandKeegan George 71c5077228 FEATURE: User sentiment on profile summary page (#329)
* FEATURE: User sentiment on profile summary page

This introduces a new user stat in a user profile summary page.

It will show either neutral/positive/negative according to the dominant
sentiment in the user last interactions.

The user-stat widget is only rendered for staff.


Co-authored-by: Keegan George <[email protected]>
2023-12-04 18:17:43 -03:00
Sam c8cd38cdda FIX: command selector behavior stopped working (#330)
When moving ai-command-selector from gjs to js the underlying
behavior changed, this corrects it and adds a test case.
2023-12-02 14:20:26 +11:00
Roman Rizzi 3bc010b686 FIX: call the right method to summarize with truncation (#328) 2023-12-01 10:17:24 -03:00
Sam 7f36175ad3 FIX: allow selection of persona when list gets too long (#327) 2023-12-01 08:29:10 +11:00
Jarek Radosz f973fafc33 DEV: Update linting (#326) 2023-11-29 23:01:48 +01:00
Discourse Translator Bot 4ccb98fdcd Update translations (#320) 2023-11-29 10:41:32 +01:00
Sam a0b9fb9721 FIX: explicitly load embedding strategies (#325)
If not, sometimes during tests these constants may not be loaded
leading to flaky tests
2023-11-29 16:36:56 +11:00
Sam 6ddc17fd61 DEV: port directory structure to Zeitwerk (#319)
Previous to this change we relied on explicit loading for a files in Discourse AI.

This had a few downsides:

- Busywork whenever you add a file (an extra require relative)
- We were not keeping to conventions internally ... some places were OpenAI others are OpenAi
- Autoloader did not work which lead to lots of full application broken reloads when developing.

This moves all of DiscourseAI into a Zeitwerk compatible structure.

It also leaves some minimal amount of manual loading (automation - which is loading into an existing namespace that may or may not be there)

To avoid needing /lib/discourse_ai/... we mount a namespace thus we are able to keep /lib pointed at ::DiscourseAi

Various files were renamed to get around zeitwerk rules and minimize usage of custom inflections

Though we can get custom inflections to work it is not worth it, will require a Discourse core patch which means we create a hard dependency.
2023-11-29 15:17:46 +11:00