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

Handle action code that exceeds the max_tokens by truncating code after last full action and adding three backticks. #563

Open
lyie28 opened this issue Aug 9, 2024 · 1 comment
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@lyie28
Copy link
Contributor

lyie28 commented Aug 9, 2024

If the LLM generates an action that is longer than max tokens it will be cut off and not have the final three ticks to end the yaml code, which leads to an error.

To handle this, we can:

In extractors.py:

  1. Change the DynamicExtractor get_type to return the type yaml, json, etc. not only where there is yaml , but also when there is ```yaml and at least one action - even if there is not three ending backticks

  2. In at least YamlFromMarkdownExtractor - as this is the most frequently used extractor - but logic could be applied to others as well:

Modify extract method so that if there is three opening backticks but not three ending ones - it will truncate the text after the last full action & then add three backticks, before continuing as normal to return the action text.

@lyie28 lyie28 added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Aug 9, 2024
@stanikeva
Copy link

Hello @lyie28 ! I would really like to contribute on the project. Could you please share more information about the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants