Closed michel-heon closed 3 weeks ago
@michel-heon please tag me or click the re-request review button if you'd like me to have a look.
(Note I noticed the file base.py_new
which is probably not relevant?)
@charles-marion In fact, the base.py_new file is an error that I've deleted. And indeed, the code is ready for revision.
I've just finished making the corrections and pushed the updated changes. No worries about the time involved—it's genuinely a pleasure to contribute to this effort.
The i18n mechanism works for Bedrock, but not for azureopenai. This fix could be part of a future PR?
The i18n mechanism works for Bedrock, but not for azureopenai. This fix could be part of a future PR?
Do you mean it breaks the azureopenai
flow or just always use english prompts?
Yes it could be a future PR if it does not break capabilities.
Happy to merge today/tomorrow if that's not the case.
In fact, the use of azureopenai
refers to the default system-prompt in langchain
, which must be overloaded. The same applies to Mistral. I agree with deferring this development to another PR and merging the current work.
Build is blocked until the following is merged. #598 I will merge this PR when the above is merged.
Pull Request: Centralize and Internationalize System Prompts
This pull request addresses the issue of scattered system prompts across the codebase and the lack of support for internationalization, as described in the corresponding Git issue https://github.com/aws-samples/aws-genai-llm-chatbot/issues/571.
Changes:
256279db811d17f6c558ccf469bfbec0e0d93583
system_prompts.py
: A new module created to centralize all system prompts and support multiple languages (English and Canadian French).base.py
: Refactored methods (get_prompt
,get_condense_question_prompt
,get_qa_prompt
) to retrieve prompts fromsystem_prompts.py
.__init__.py
: Updated to import system prompts for simplified access.Key Improvements:
system_prompts.py
), improving manageability and scalability.azure-openai
,mistral
,claude
,titan
, andllama
are updated to use the new prompt management system, ensuring consistency and reducing code duplication.Testing Instructions:
system_prompts.py
.GenAIChatBotStack-LangchainInterfaceReques
Lambda function.prompt
field of the metadata variable in the AWS GenAI Chatbot console for further analysis.Expected Outcome: