Go to file
Roman Rizzi 0a8195242b
FIX: Limit system message size to 60% of available tokens. (#714)
Using RAG fragments can lead to considerably big system messages, which becomes problematic when models have a smaller context window.

Before this change, we only look at the rest of the conversation to make sure we don't surpass the limit, which could lead to two unwanted scenarios when having large system messages:

All other messages are excluded due to size.
The system message already exceeds the limit.

As a result, I'm putting a hard-limit of 60% of available tokens. We don't want to aggresively truncate because if rag fragments are included, the system message contains a lot of context to improve the model response, but we also want to make room for the recent messages in the conversation.
2024-07-12 15:09:01 -03:00
.github/workflows Initial commit 2023-02-17 11:33:47 -03:00
admin/assets/javascripts/discourse DEV: Clean up after #677 (#694) 2024-06-28 08:59:51 +10:00
app FIX: Flaky SRV-backed model seeding. (#708) 2024-07-08 18:47:10 -03:00
assets FEATURE: Show post helper as bottom modal on mobile (#704) 2024-07-10 11:01:05 -07:00
config FEATURE: Show post helper as bottom modal on mobile (#704) 2024-07-10 11:01:05 -07:00
db DEV: More topic title prompt tweaks (#712) 2024-07-11 10:14:53 +10:00
discourse_automation DEV: Use LlmModels as options in automation rules (#676) 2024-06-21 08:07:17 +10:00
lib FIX: Limit system message size to 60% of available tokens. (#714) 2024-07-12 15:09:01 -03:00
public/ai-share UX: improve appearance of attributed quote when sharing (#665) 2024-06-11 12:06:57 -04:00
spec FIX: Limit system message size to 60% of available tokens. (#714) 2024-07-12 15:09:01 -03:00
test/javascripts DEV: Add summarization logic from core (#658) 2024-07-02 08:51:59 -07:00
tokenizers FEATURE: Set endpoint credentials directly from LlmModel. (#625) 2024-05-16 09:50:22 -03:00
.discourse-compatibility FIX: uses getByIdentifier of d-menu (#611) 2024-05-10 12:01:02 +02:00
.eslintrc.cjs DEV: Update linting configs (#280) 2023-11-03 11:30:09 +00:00
.gitignore Initial commit 2023-02-17 11:33:47 -03:00
.prettierignore FEATURE: UI to update ai personas on admin page (#290) 2023-11-21 16:56:43 +11:00
.prettierrc.cjs DEV: Update linting configs (#280) 2023-11-03 11:30:09 +00:00
.rubocop.yml DEV: Update linting configs (#280) 2023-11-03 11:30:09 +00:00
.streerc DEV: Update linting configs (#280) 2023-11-03 11:30:09 +00:00
.template-lintrc.cjs DEV: Update linting (#326) 2023-11-29 23:01:48 +01:00
Gemfile DEV: Update linting configs (#280) 2023-11-03 11:30:09 +00:00
Gemfile.lock FEATURE: move summary to use llm_model (#699) 2024-07-04 10:48:18 +10:00
LICENSE Initial commit 2023-02-17 11:33:47 -03:00
README.md CHORE: Update Readme (#185) 2023-09-04 15:46:35 -03:00
package.json DEV: Update rubocop-discourse to version 3.8.0 (#641) 2024-05-28 11:15:42 +02:00
plugin.rb FIX: Flaky SRV-backed model seeding. (#708) 2024-07-08 18:47:10 -03:00
translator.yml UX: Display the indexing progress for RAG uploads (#557) 2024-04-09 11:03:07 -03:00
yarn.lock Build(deps): Bump braces from 3.0.2 to 3.0.3 (#683) 2024-06-22 16:50:25 +02:00

README.md

Discourse AI Plugin

Plugin Summary

For more information, please see: https://meta.discourse.org/t/discourse-ai/259214?u=falco