microsoft / autogen

A programming framework for agentic AI 🤖
https://microsoft.github.io/autogen/
Creative Commons Attribution 4.0 International
34.84k stars 5.05k forks source link

assistant_agent's system prompt contains an invalid escape character #4169

Closed qcloop closed 1 week ago

qcloop commented 1 week ago

Backlash character in the prompt needs to be escaped, otherwise it causes issues when sending it as JSON payload.

i.e. from current

{ "content": "You are a helpful AI assistant. Solve tasks using your tools. Reply with \'TERMINATE\' when the task has been completed.", "role": "system" }

to

{ "content": "You are a helpful AI assistant. Solve tasks using your tools. Reply with \'TERMINATE\' when the task has been completed.", "role": "system" }

victordibia commented 1 week ago

Thanks for the note @qcloop . Can you show a concrete example of the errors you are seeing?

@ekzhu .. thoughts .. any side effects to escaping special characters?

qcloop commented 1 week ago

We have a propriatery LLM which we are trying to leverage with Autogen. I was getting an 400 error that could not decipher. So I decided to get the actual request to an LLM and try it out using Postman REST API tool. Attached is the Postman with the JSON payload, and Postman complaining about "Invalid Escape CharaImage cter"

ekzhu commented 1 week ago

This seems very LLM specific. Let's just remove the quotes for now.

ekzhu commented 1 week ago

Resolved by #4231

ekzhu commented 1 week ago

Resolved by #4231