I have a bot that has a custom tool function with the following schema:
{
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string",
"description": "You must include the company name of the user and their company role. You must format it like this: 'Company name: [INSERT_COMPANY_NAME], Company Role: [INSET_COMPANY_ROLE]"
}
}
}
The reason for doing it this way is because I can only send a 'message' to the API I'm connecting to, when running the bot in production (after publishing), the tool call always works as expected, for example:
tool_call_id: 18206f52d5a4d92b
{
"message": "Demo request from Jack Example. Company name: Example Ltd, Company Role: Founder. Email: jack@example.com, Phone: 07123123123."
}
However, when running the tests around this bot, the bot consistently ignores this JSON schema and calls the tools with this payload:
tool_call_id: 66311391b2c68319
{
"message": "Demo request from Jack Example, Founder at Example Ltd. Interested in automating internal admin processes such as onboarding, project workflows, and recurring communications. Contact details: jack@example.com, +447123123123. Please arrange a personalised demo and follow up with Jack.",
"Company name": "Example Ltd",
"Company Role": "Founder"
}
I've ran the tests 10 times and had 10 production chats and every time, this happens
The model is GPT 4.1, which is the same in my test cases
Is anyone else having this issue? How do I solve this?
I'd like to be able to test the structure within the test-cases to validate the right information is being sent