OpenAI-DotNet
OpenAI-DotNet copied to clipboard
Enable Assistant Tool Function Methods to be updated
@StephenHodgson do you know how to assign local methods to Assistant functions when using the RetrieveAssistantAsync()
method, where the OpenAI server-side assistant already has defined functions?
I find the documentation unclear on this, and so far been unable to find a way to assign a method to an existing list of tools.
E.g. I would have expected something like:
_assistant = await _openai.AssistantsEndpoint.RetrieveAssistantAsync(assistantId);
foreach (var tool in _assistant.Tools){
tool.Function.Method = myLocalMethod;
}
I'll add this along with ability to update tools to fix https://github.com/RageAgainstThePixel/OpenAI-DotNet/discussions/298 and https://github.com/RageAgainstThePixel/OpenAI-DotNet/discussions/303
Ok, after looking into this more closely I don't feel like it is appropriate to be able to update the method to call.
I did add the ability to unregister a tool, and register a new one if you need to update it for some reason like this.
Don't forget you can always parse out the args/params yourself and then invoke it on the target/method directly.