Commit Graph
353 Commits
Author SHA1 Message Date
Roman Rizzi e0bf6adb5b DEV: Tool support for the LLM service. (#366)
This PR adds tool support to available LLMs. We'll buffer tool invocations and return them instead of making users of this service parse the response.

It also adds support for conversation context in the generic prompt. It includes bot messages, user messages, and tool invocations, which we'll trim to make sure it doesn't exceed the prompt limit, then translate them to the correct dialect.

Finally, It adds some buffering when reading chunks to handle cases when streaming is extremely slow.:M
2023-12-18 18:06:01 -03:00
Roman Rizzi 203906be65 FIX: Bedrock was complaining input was too long (#365) 2023-12-18 16:06:06 -03:00
Rafael dos Santos Silva 4d7ccdda2f FEATURE: DNS SRV support for TEI (#363) 2023-12-18 13:21:21 -03:00
Keegan George ba09582d7c UX: Hide suggest edit button in fast edit when triggering from AI (#364) 2023-12-15 15:19:04 -08:00
Keegan George 19a2949914 UX: Improve focus state of post options item by making full width (#362) 2023-12-15 12:11:29 -08:00
Keegan George d674e47ca4 FEATURE: AI suggestion buttons in move-to-topic modal (#360) 2023-12-15 12:11:14 -08:00
Rafael dos Santos Silva 83744bf192 FEATURE: Support for Gemini in AiHelper / Search / Summarization (#358) 2023-12-15 14:32:01 -03:00
Osama Sayegh 831559662e UX: Automatically detect text direction for AI generated text (#361) 2023-12-15 13:51:47 -03:00
Keegan George 408d9f68eb FEATURE: Proofread with post AI helper (#359) 2023-12-14 19:30:52 -08:00
Keegan George 74a7ac4a3d FEATURE: Add custom prompts to post helper options (#355)
* FEATURE: Add custom prompts to post helper options

* 💄Make pretty

* 💄Make pretty!
2023-12-14 13:47:20 -03:00
Krzysztof Kotlarek 6de9b9c274 DEV: Replace deprecated min_trust_to_create_post (#356)
In https://github.com/discourse/discourse/pull/24740, `min_trust_to_create_topic` site setting was replaced by `create_topic_allowed_groups`. This PR replaces the former, deprecated one, with the latter.
2023-12-14 14:07:28 +11:00
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