Skip to content

UTF-8 encoding issues in tool calling params with GPT-4o model #315

Closed
@jackien1

Description

@jackien1

Describe the bug

The gpt-4o agent encodes the str argument to a tool call in latin-1 encoding instead of utf-8 whenever smart / curly quotes are involved. If another tool uses the same text, the memory of the argument as latin-1 causes subsequent double encoding issues.

Debug information

  • Agents SDK version: v0.0.6
  • Python version Python 3.12

Repro steps

Have a gpt-4o agent use a tool that writes a script and uses any unicode characters like smart / curly quotes.

Expected behavior

String parameters should be in utf-8 encoding unless I fundamentally misunderstand tool calling.

Alright, now let�s break it down! instead of "Alright, now let's break it down!"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions