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

Update ReAct prompt for multilingual support #11464

Merged

Conversation

leehuwuj
Copy link
Contributor

@leehuwuj leehuwuj commented Feb 28, 2024

Description

In my experiment with the multilingual models Mistral and Llama2, the response from the ReAct agent always comes in English, even when I ask in a different language.

I made some minor changes in the prompt of ReAct agent and it then able to response in the same language of the question. It's just a minor change and should not break other things so i think it's worth an update in LlamaIndex.

Please have a look: https://colab.research.google.com/drive/1-lA4_I5tnHBHe0uCmhoxODlhKcIqTNWA?usp=sharing

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Added new unit/integration tests
  • Added new notebook (that tests end-to-end)
  • I stared at the code and made sure it makes sense

Suggested Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added Google Colab support for the newly added notebooks.
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I ran make format; make lint to appease the lint gods

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Feb 28, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 28, 2024

```
Thought: I need to use a tool to help me answer the question.
Thought: The current language of the user is: (user's language). I need to use a tool to help me answer the question.
Copy link
Contributor

Choose a reason for hiding this comment

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

is user's language passed as a parameter?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nope. In our tests, the LLM (we used Mixtral) generated a thought with the language of the user.

@nerdai nerdai merged commit a430aba into run-llama:main Mar 9, 2024
8 checks passed
bdonkey added a commit to bdonkey/gpt_index that referenced this pull request Mar 11, 2024
* main: (63 commits)
  Add LogProb type to core.base.llms module (run-llama#11795)
  Add Passio Nutrition AI Food Search Tool to LLAMA_index (run-llama#11621)
  Create new RTF integration (run-llama#11466)
  SearChain package reproduced using Llama_index library ​ (run-llama#11649)
  Update ReAct prompt for multilingual support (run-llama#11464)
  Integration in Google Sheets Reader to load the Sheets into Pandas Dataframes (run-llama#11640)
  add claude3 benchmarks  (run-llama#11685)
  nit: add link to code hierarchy notebook  (run-llama#11769)
  feat: nested metadata filters (PGVectorStore) (run-llama#11778)
  [BUG] llama-index-tools-finance (run-llama#11772)
  docs: Updated Qdrant usage examples (run-llama#11768)
  update toml for code hierarchy (run-llama#11776)
  remove unneeded chroma deps (run-llama#11775)
  Minor improvement for TiDB Vector (run-llama#11766)
  The PrivateAttr should be imported from llama_index.core.bridge.pydantic instead of pydantic (run-llama#11765)
  Logan/v0.10.18 (run-llama#11763)
  Code Hierarchy Node Parser v0.10 (run-llama#10671)
  bug fixed in OpenInference log that cause error with importing (run-llama#11751)
  Feat/mymagic-return-output (run-llama#11761)
  Add Initial Support for TiDB Vector Store (run-llama#11635)
  ...
Izukimat pushed a commit to Izukimat/llama_index that referenced this pull request Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants