aws-samples / aws-genai-llm-chatbot

A modular and comprehensive solution to deploy a Multi-LLM and Multi-RAG powered chatbot (Amazon Bedrock, Anthropic, HuggingFace, OpenAI, Meta, AI21, Cohere, Mistral) using AWS CDK on AWS
https://aws-samples.github.io/aws-genai-llm-chatbot/
MIT No Attribution
1.11k stars 332 forks source link

Centralize and Internationalize System Prompts Across Adapter #571

Open michel-heon opened 2 months ago

michel-heon commented 2 months ago

Description :

Currently, system prompts are scattered throughout the codebase and are only available in English. This setup makes it difficult to manage and internationalize prompts, especially when scaling to new languages or integrating multiple adapters. We propose centralizing the system prompts into a single module for easier management and allowing for internationalization.


Objective :


Affected Adapters:


Proposed Solution:

These methods will fetch the system prompts from the new system_prompts.py class to centralize and simplify prompt management.


Steps for Implementation:

  1. Create a new module system_prompts.py to store all system prompts.
  2. Refactor the aforementioned methods to pull prompts from the system_prompts.py class.
  3. Add support for multiple languages by enabling the selection of language-specific prompts in system_prompts.py.
  4. Update all adapters to use the new prompt management system.

Expected Outcome:


Environment Information:


Additional Information:


Cela permet d'expliquer clairement la problématique, l'objectif, et la solution envisagée pour les contributeurs du projet.

charles-marion commented 2 months ago

Hi @michel-heon , Thank you for the details.

I recently merged the following which reduces the prompts for Bedrock by using a common solution for various models. It might help your use case in the short term https://github.com/aws-samples/aws-genai-llm-chatbot/pull/569 https://github.com/aws-samples/aws-genai-llm-chatbot/blob/main/lib/model-interfaces/langchain/functions/request-handler/adapters/bedrock/base.py#L49

Regarding the update of prompts. An other issue is also suggesting a way to modify the prompts but using a registry: https://github.com/aws-samples/aws-genai-llm-chatbot/issues/334

michel-heon commented 2 months ago

Hello @charles-marion I've just noticed the change. I'm going to migrate to the latest commit for my work. I will also take this change into account for https://github.com/aws-samples/aws-genai-llm-chatbot/issues/572

michel-heon commented 2 months ago

Hi @charles-marion see PR https://github.com/aws-samples/aws-genai-llm-chatbot/pull/576

github-actions[bot] commented 2 days ago

This issue is stale because it has been open for 60 days with no activity.