discourse-ai/spec
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
..
fabricators FEATURE: custom user defined tools (#677) 2024-06-27 17:27:40 +10:00
fixtures FIX: Load categories from search response (#612) 2024-05-14 17:13:25 +03:00
jobs FEATURE: move summary to use llm_model (#699) 2024-07-04 10:48:18 +10:00
lib FIX: Limit system message size to 60% of available tokens. (#714) 2024-07-12 15:09:01 -03:00
models FIX: Flaky SRV-backed model seeding. (#708) 2024-07-08 18:47:10 -03:00
requests FEATURE: move summary to use llm_model (#699) 2024-07-04 10:48:18 +10:00
serializers DEV: Fix new Rubocop offenses 2024-03-06 15:23:29 +01:00
services/discourse_ai FEATURE: move summary to use llm_model (#699) 2024-07-04 10:48:18 +10:00
shared FEATURE: Set endpoint credentials directly from LlmModel. (#625) 2024-05-16 09:50:22 -03:00
support FIX: typo causing text_embedding_3_large to fail (#460) 2024-02-05 11:16:36 +11:00
system FEATURE: Show post helper as bottom modal on mobile (#704) 2024-07-10 11:01:05 -07:00
tasks FIX: Filter soft-deleted topics when backfilling sentiment (#527) 2024-03-12 21:01:24 -03:00
plugin_helper.rb DEV: Transition "Select model" settings to only use LlmModels (#675) 2024-06-19 18:01:35 -03:00
plugin_spec.rb DEV: Transition "Select model" settings to only use LlmModels (#675) 2024-06-19 18:01:35 -03:00