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

fix(#1100): apply language config to Introduction and Conclusion sections #1101

Conversation

DAAE-Na-Yunchae
Copy link
Contributor

@DAAE-Na-Yunchae DAAE-Na-Yunchae commented Feb 4, 2025

First, thank you for considering my contribution to the GPT Researcher project. This PR addresses the issue #1100 where the Introduction and Conclusion sections of research reports do not respect the LANGUAGE configuration setting.

Issue Description

When LANGUAGE is set to a non-English value in the configuration (e.g., "japanese"), the Introduction and Conclusion sections remain in English while the rest of the report is generated in the configured language. This creates inconsistency in the report output.

Changes Made

  • Modified report generation to pass language configuration to Introduction and Conclusion generation prompts
  • Ensures consistent language usage throughout the entire report
  • Maintains existing config system behavior while extending its reach to previously missed sections

Testing

I have tested these changes by:

  1. Setting LANGUAGE: "japanese" in the configuration
  2. Generating a "Detailed" report which includes Introduction/Conclusion sections
  3. Verifying that all sections, including Introduction and Conclusion, are now generated in Japanese
  4. Confirming that other functionalities remain unaffected
    Screenshot 2025-02-04 at 11 26 04
    Screenshot 2025-02-04 at 11 25 58
    Screenshot 2025-02-04 at 11 25 50

Steps to Reproduce (Original Issue)

  1. Set LANGUAGE: "japanese" in the config
  2. Run the researcher
  3. Select "Detailed - In depth and longer(~5min)" when prompted
  4. Observe that Introduction and Conclusion remain in English despite Japanese config

Current Config Example

python
DEFAULT_CONFIG: BaseConfig = {
   "LANGUAGE": "japanese",
   # ... other settings
}

- Pass language config to write_introduction and write_conclusion prompts
- Ensure consistent language throughout entire report
- Fix issue where these sections remained in English
@DAAE-Na-Yunchae DAAE-Na-Yunchae changed the title fix: apply language config to Introduction and Conclusion sections fix(#1100): apply language config to Introduction and Conclusion sections Feb 4, 2025
Copy link
Owner

@assafelovic assafelovic left a comment

Choose a reason for hiding this comment

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

Thanks super helpful!

@assafelovic assafelovic merged commit b79e9f5 into assafelovic:master Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants