You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Confirm this is a feature request for the .NET library and not the underlying OpenAI API
This is a feature request for the .NET library
Describe the feature or improvement you are requesting
When creating an Assistant Run for a specific thread a tool constraint can be defined: auto, none or required.
However, when the run is retrieved, it is impossible to tell which type was deserialized as the instance contains no public properties and ToString() is not writing something special.
I tried to compare it with the static options (e.g. ToolConstraint.Auto) but the result is false, and no property is exposed to identify that specific tool constraint.
Here is some code sample:
var assistantsClient = new AssistantsClient("someApiKey");
var runResponse = await assistantsClient.GetRunAsync("thread_gA...kv2", "run_ecofR9n2oxKh...dWjM");
if (runResponse.Value.ToolConstraint == ToolConstraint.Auto)
{
Console.WriteLine("ToolConstraint is Auto");
}
else if(runResponse.Value.ToolConstraint == ToolConstraint.None)
{
Console.WriteLine("ToolConstraint is None");
}
else if (runResponse.Value.ToolConstraint == ToolConstraint.Required)
{
Console.WriteLine("ToolConstraint is Required");
}
else
{
Console.WriteLine("ToolConstraint is Unknown");
}
Console.WriteLine(runResponse.Value.ToolConstraint);
The above code will display
ToolConstraint is Unknown
OpenAI.Assistants.ToolConstraint
``
There is no way to unbox that information as type is private.
### Additional context
Same behavior is observed for other enum-like types: (e.g. `FileChunkingStrategy`)
The text was updated successfully, but these errors were encountered:
sandrohanea
changed the title
ToolConstraint is not unboxable after calling the API
ToolConstraint Type Cannot Be Identified or Unboxed After API Call
Nov 13, 2024
Confirm this is a feature request for the .NET library and not the underlying OpenAI API
Describe the feature or improvement you are requesting
When creating an Assistant Run for a specific thread a tool constraint can be defined: auto, none or required.
However, when the run is retrieved, it is impossible to tell which type was deserialized as the instance contains no public properties and ToString() is not writing something special.
I tried to compare it with the static options (e.g.
ToolConstraint.Auto
) but the result is false, and no property is exposed to identify that specific tool constraint.Here is some code sample:
The above code will display
The text was updated successfully, but these errors were encountered: