Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DERCBOT-919] Add question condensing LLM and prompt template #1827

Merged

Conversation

assouktim
Copy link
Contributor

@assouktim assouktim commented Jan 17, 2025

Use Case / Functionnal

Let the user configure in it's RAG chain the condensation prompt, this prompt is used to reformulate user's query using the latest messages in the dialog history including chatbot messaged. It's use to contextualize the user query.

For each bot using Rag Settings we can also now configure :

  • Debugging of the rag messages that can be enabled for each call or disabled using debugEnabled
  • the maximum number of retrieved document from the vector db using maxDocumentsRetrieved, earlier it was only possible using a specific VectorDB setting configuration in the studio.
  • the number of message used from the dialog history to contextualise the user query using maxMessagesFromHistory

Technical changes

This pull request includes significant changes to the BotAdminService and related models, primarily focused on enhancing the RAG (Retrieval-Augmented Generation) configuration and sentence generation functionalities. The most important changes include the addition of new settings for question condensing and answering, updates to the data transfer objects (DTOs), and modifications to the validation and deletion processes.

Enhancements to RAG Configuration:

  • Added new settings for questionCondensingLlmSetting, questionCondensingPrompt, questionAnsweringLlmSetting, and questionAnsweringPrompt in BotRAGConfigurationDTO to support more granular control over RAG processes. [1] [2] [3]
  • Updated the deletion logic in BotAdminService to handle the new LLM settings for question condensing and answering. [1] [2]

Sentence Generation Updates:

  • Introduced prompt as a new field in BotSentenceGenerationConfigurationDTO to allow customizable prompts for sentence generation. [1] [2] [3]
  • Modified CompletionService to utilize the new prompt field for generating sentences. [1] [2]

Validation and Testing:

  • Enhanced the validation logic in RAGValidationService to include checks for both question condensing and answering LLM settings. [1] [2] [3]
  • Updated test cases in RAGServiceTest and RAGValidationServiceTest to reflect the new configuration fields and validation logic. [1] [2] [3] [4] [5]

These changes collectively improve the flexibility and robustness of the BotAdminService, particularly in handling complex RAG configurations and sentence generation scenarios.

Breaking changes

  • tock_gen_ai_orchestrator_rag_debug_enabled is no longer used. Debug mode can only be activated directly from the RAG configuration.
  • tock_gen_ai_orchestrator_dialog_number_messages is no longer used. The number of dialog messages to be taken can be specified directly from the RAG configuration.
  • The VectorStoreSettingBase::k attribute is removed, as this information is now carried by the RAG configuration.

@assouktim assouktim force-pushed the feature/dercbot-919 branch 3 times, most recently from 7c6ddda to 0ac80d7 Compare January 27, 2025 09:44
@assouktim assouktim marked this pull request as ready for review January 27, 2025 09:45
@assouktim assouktim self-assigned this Jan 28, 2025
@assouktim assouktim changed the title [DERCBOT-919] Add condenseQuestion LLM and Prompt [DERCBOT-919] Add question condensing LLM and prompt template Jan 29, 2025
Copy link
Member

@Benvii Benvii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok for me but some breaking changes need to be documented as we don't have any issue put them on the PR description the release script will be able to catch them.

Also we need to open an issue on tock helm repository to reference the environment variable changes.

Some conflicting files, rebase need to be done.

Copy link
Member

@Benvii Benvii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks 😀

@scezen scezen self-requested a review February 14, 2025 14:32
Copy link
Member

@Benvii Benvii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry changes need to be done as the documentation as moved, can you check it please ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc is also present in french please update it, sorry I forgot it during the first review

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doc doesn't exist at this location anymore I don't understand why it's not generating a conflict can you update the new file FR and EN ?

Copy link
Member

@Benvii Benvii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes

Copy link

Website is published: https://doc.tock.ai/tock/feature/dercbot-919/

@Benvii Benvii merged commit 02dd9e7 into theopenconversationkit:master Feb 24, 2025
2 of 3 checks passed
@Benvii Benvii deleted the feature/dercbot-919 branch February 24, 2025 09:53
Copy link

🚀 Cleanup completed for PR and associated branch: feature/dercbot-919

@vsct-jburet vsct-jburet added this to the 24.9.8 milestone Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

4 participants