Default tool seems to have some encoding issue on version 0.3.13 #1785

Closed
opened 2025-11-11 14:53:10 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @Taluen79 on GitHub (Aug 15, 2024).

I was trying to add a new tool. When you click on the "+" sign to add a new tool, you'll get the default tool for checking time and whether. I you try to save this tool, you get an error once you have read the warning about using untrusted tools. The log for this looks like this:

An error occurred: 'utf-8' codec can't decode byte 0xb0 in position 3469: invalid start byte
No requirements found in frontmatter.
Error loading module: test_tools_2
(unicode error) 'utf-8' codec can't decode byte 0xb0 in position 0: invalid start byte (test_tools_2.py, line 98)
DEBUG [main] Commit session after request
INFO: 192.168.1.23:59153 - "POST /api/v1/tools/create HTTP/1.1" 400 Bad Request

This issue is seems to be related to the line 98 in the python code for the default tool that looks like this:

return f"Weather in {city}: {temperature}°C"

If you remove the degree symbol and make it into:

return f"Weather in {city}: {temperature}C"

It will work save without errors.

Not very serious, but still annoying.

Originally created by @Taluen79 on GitHub (Aug 15, 2024). I was trying to add a new tool. When you click on the "+" sign to add a new tool, you'll get the default tool for checking time and whether. I you try to save this tool, you get an error once you have read the warning about using untrusted tools. The log for this looks like this: An error occurred: 'utf-8' codec can't decode byte 0xb0 in position 3469: invalid start byte No requirements found in frontmatter. Error loading module: test_tools_2 (unicode error) 'utf-8' codec can't decode byte 0xb0 in position 0: invalid start byte (test_tools_2.py, line 98) DEBUG [main] Commit session after request INFO: 192.168.1.23:59153 - "POST /api/v1/tools/create HTTP/1.1" 400 Bad Request This issue is seems to be related to the line 98 in the python code for the default tool that looks like this: return f"Weather in {city}: {temperature}°C" If you remove the degree symbol and make it into: return f"Weather in {city}: {temperature}C" It will work save without errors. Not very serious, but still annoying.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#1785