The best overload for 'ChatRequest' does not have a parameter named 'functions' #291
-
Bug ReportOverviewI have not updated the NuGet package for Core 7.0 in a while and when I did from 7.3.3 to 7.7.7, I got the error in the title when calling ChatRequest: var functions = new List<Function>
{
new Function(
"CategoryIdentification",
"Identify a specific category that best described the type of question that was just created from text.",
new JsonObject
{
["type"] = "object",
["properties"] = new JsonObject
{
["categoryText"] = new JsonObject
{
["type"] = "string",
["description"] = "The category description itself."
}
},
["required"] = new JsonArray { "categoryText" }
})
};
var chatRequest = new ChatRequest(messages, functions: functions, functionCall: "auto", model: modelString ); ChatRequest used to have the "functions" parameter. What was it replaced with? To Reproduce
Expected behaviorExpected ChatRequest to have the functions parameter or something like it. I can't find any mention of how to deal with functions in the new documentation |
Beta Was this translation helpful? Give feedback.
Answered by
StephenHodgson
Apr 30, 2024
Replies: 1 comment 3 replies
-
Functions were deprecated by OpenAI in favor of tools. You can simply wrap your functions into a new list of Tools: var tools = new List<Tool>
{
new Function(
"CategoryIdentification",
"Identify a specific category that best described the type of question that was just created from text.",
new JsonObject
{
["type"] = "object",
["properties"] = new JsonObject
{
["categoryText"] = new JsonObject
{
["type"] = "string",
["description"] = "The category description itself."
}
},
["required"] = new JsonArray { "categoryText" }
})
};
var chatRequest = new ChatRequest(messages, tools: tools, toolChoice: "auto", model: modelString); |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
StephenHodgson
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Functions were deprecated by OpenAI in favor of tools.
You can simply wrap your functions into a new list of Tools: