openai / openai-openapi

OpenAPI specification for the OpenAI API
https://platform.openai.com/docs/api-reference/introduction
MIT License
1.28k stars 371 forks source link

AssistantToolsCode is missing file_search and function #277

Closed bojake closed 4 months ago

bojake commented 4 months ago

The AssistantToolsCode enum (line 10233 in the yaml) is missing "file_search" and "function".

benadamdev commented 4 months ago

AssistantToolsCode is one of the three possible schemas that can be included in the tools array property that is present in multiple schemas like: AssistantObject, CreateAssistantRequest, ModifyAssistantRequest, RunObject and many others. The other two possible values are: AssistantToolsFileSearch and AssistantToolsFunction.

bojake commented 4 months ago

understood, the code generator from microsoft visual studio seems to be confused by your yaml and the "Tools" enum for the assistant only has "CodeInterpreter" as a member because it binds the AssistantToolsCode type to that field.

bojake commented 4 months ago

The result from VS today:

    [Newtonsoft.Json.JsonProperty("tools", Required = Newtonsoft.Json.Required.Always)]
    [System.ComponentModel.DataAnnotations.Required]
    [System.ComponentModel.DataAnnotations.MaxLength(128)]
    public System.Collections.Generic.ICollection<**AssistantToolsCode**> Tools { get; set; } = new System.Collections.ObjectModel.Collection<AssistantToolsCode>();

This is the "Tools" created for the "AssistantObject"

benadamdev commented 4 months ago

I myself use a Swift code generator and I see a lot of weirdness when it comes to these enums that have only one case such as AssistantToolsCode. This API has its own ways of modeling data and there are lots of details and inconsistencies that I still can't figure out.