Function with empty Request parameter/record and OpenAI 400 Bad Request #2045
Unanswered
henningSaulCM
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
we have functions that don't require any request parameter input. This is because we are relying solely on ToolContext information in these cases, but one can easily imagine other functions (RandomNumber, QuoteOfTheDay) that might not require any input at all.
Since we don't require any input, the Request parameter for the function is an empty record:
However, this will lead to the following errors being returned by OpenAI/gpt-40 for any chat request:
400 Bad Request from POST https://api.openai.com/v1/chat/completions
If we add an optional dummy parameter to the Request record, the issue does not occur:
Has anybody else run into this issue before? What was your solution?
Not sure how other Chat Models behave and if this can/should be handled by the Spring AI/OpenAI integration.
Thanks for your thoughts and feedback
--Henning
Beta Was this translation helpful? Give feedback.
All reactions