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: unreadable text in console and potentially over the max token #2050

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

tzengyuxio
Copy link
Contributor

@tzengyuxio tzengyuxio commented Apr 17, 2023

Background

In the process of google command, it convert google_result to safe_message by encode('utf-8'), then return it by just str(). This will cause the google_result becomes a series of hex escaped string, it's hard to read in the process (see fig1), and COULD cause exception due to the token size of hex-escaped string usually larger than unicode string (see fig2).

截圖 2023-04-17 上午8 58 59
(fig1: the response of process is hard to read)

截圖 2023-04-17 上午8 59 59
(fig2: InvalidRequestError: token oversize)

Changes

return unicode string (ex.: 宋江(演員)) instead of hex-escaped sequence (ex.: \xe5\xae\×8b\xe6\xb1\x9f)

截圖 2023-04-17 上午9 00 27
(fig3: expected output)

Documentation

Test Plan

PR Quality Checklist

  • My pull request is atomic and focuses on a single change.
  • I have thoroughly tested my changes with multiple different prompts.
  • I have considered potential risks and mitigations for my changes.
  • I have documented my changes clearly and comprehensively.
  • I have not snuck in any "extra" small tweaks changes

@richbeales richbeales merged commit e40d6f3 into Significant-Gravitas:master Apr 17, 2023
sindlinger pushed a commit to Orgsindlinger/Auto-GPT-WebUI that referenced this pull request Sep 25, 2024
fix: unreadable text in console and potentially over the max token
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