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
Issue: Customizing 'structured_format_instructions' for Non-English Languages #5203
Comments
Hi, @luc-kalaora! I'm Dosu, and I'm here to help the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale. From what I understand, the issue you raised is about customizing the format instructions for non-English languages in the However, there hasn't been any activity on this issue yet, and it remains unresolved. Could you please let us know if this issue is still relevant to the latest version of the LangChain repository? If it is, please comment on the issue to let us know. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you for your understanding and contribution to the LangChain project! |
Yes this issue is still relevant. |
@baskaryan Could you please help @luc-kalaora with the issue they raised about customizing the format instructions for non-English languages in the |
I need to change the format instructions to fix the ReAct prompt. So I think it will be really helpful if this can be customized. I also don't understand why you want to hardcode this, format instructions are so important for the good working of your total prompt. |
We've created a subclass of the ConvoOutputParser and that way it is possible to edit the get_format_instructions() method to load your custom format instructions. |
Thanks
Le mer. 11 oct. 2023, 20:38, Guido Rietbroek ***@***.***> a
écrit :
… We've created a subclass of the ConvoOutputParser and that way it is
possible to edit the get_format_instructions() method to load your custom
format instructions.
—
Reply to this email directly, view it on GitHub
<#5203 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKWIRZQXUDAEUDWN7DWK3LX63RTNANCNFSM6AAAAAAYNUMOGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Is there any guide on how to do this? I also have this problem, but for the pydantic json formatter. Wouldn't it be possible to add something like a language code when the parser is defined? e.g. like this PydanticOutputParser(pydantic_object=my_format_template, language="german") |
HI, I have a requirement to customize the format instructions for multiple languages.
Specifically, I need to make modifications to the output_parser.get_format_instructions() string. This function currently utilizes the following structured format instructions:
To modify this value, I have considered the following approach:
However, please note that this approach is not thread-safe. If multiple users are simultaneously using my application with different languages, there is a risk of interference between their settings.
Could you please advise on the appropriate solution for this issue?
How i can do? May i miss something?
Thanks for your help
Suggestion:
A solution could be to change get_format_instructions(self) -> str function by adding a string params def get_format_instructions(self, cust_str_format_instructions) -> str:
Another solution is to create a class inherited from StructuredOutputParser
The problem is that if you are modifying the code, I have to maintain it.
The text was updated successfully, but these errors were encountered: