diff --git a/OpenApiGenerator.sln b/OpenApiGenerator.sln index 8ef96073e6..7734d8e9e4 100644 --- a/OpenApiGenerator.sln +++ b/OpenApiGenerator.sln @@ -30,6 +30,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenApiGenerator.Helpers", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenApiGenerator.Core", "src\libs\OpenApiGenerator.Core\OpenApiGenerator.Core.csproj", "{3A3F5EE3-0076-4822-B3BA-2955EC802E25}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenApiGenerator.UnitTests", "src\tests\OpenApiGenerator.UnitTests\OpenApiGenerator.UnitTests.csproj", "{88BE4AC5-6E7B-46FA-B656-5CCE8BF9F18E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -56,6 +58,10 @@ Global {3A3F5EE3-0076-4822-B3BA-2955EC802E25}.Debug|Any CPU.Build.0 = Debug|Any CPU {3A3F5EE3-0076-4822-B3BA-2955EC802E25}.Release|Any CPU.ActiveCfg = Release|Any CPU {3A3F5EE3-0076-4822-B3BA-2955EC802E25}.Release|Any CPU.Build.0 = Release|Any CPU + {88BE4AC5-6E7B-46FA-B656-5CCE8BF9F18E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {88BE4AC5-6E7B-46FA-B656-5CCE8BF9F18E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {88BE4AC5-6E7B-46FA-B656-5CCE8BF9F18E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {88BE4AC5-6E7B-46FA-B656-5CCE8BF9F18E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -66,6 +72,7 @@ Global {0EC09367-E7C5-4847-A9F3-DBC18A1C8395} = {9CAA231D-7BE1-46C9-ACD6-EB2E569CEBEA} {CF6126AF-6934-46EC-A0F2-B75C673EA8D8} = {6E5BF389-3D3F-4D74-9DD0-3B199CB529C5} {3A3F5EE3-0076-4822-B3BA-2955EC802E25} = {6E5BF389-3D3F-4D74-9DD0-3B199CB529C5} + {88BE4AC5-6E7B-46FA-B656-5CCE8BF9F18E} = {9CAA231D-7BE1-46C9-ACD6-EB2E569CEBEA} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {1493AEE4-9211-46E9-BFE6-8F629EAC5693} diff --git a/src/tests/OpenApiGenerator.UnitTests/ModelTests.cs b/src/tests/OpenApiGenerator.UnitTests/ModelTests.cs new file mode 100644 index 0000000000..4de8536a11 --- /dev/null +++ b/src/tests/OpenApiGenerator.UnitTests/ModelTests.cs @@ -0,0 +1,60 @@ +using System.Collections.Immutable; +using System.Runtime.CompilerServices; +using OpenApiGenerator.Core.Generators; +using OpenApiGenerator.Core.Models; + +namespace OpenApiGenerator.UnitTests; + +[TestClass] +public class ModelTests : + VerifyBase +{ + private Settings DefaultSettings => new( + TargetFramework: "netstandard2.0", + Namespace: "G", + ClassName: "Api", + NamingConvention: default, + IncludeOperationIds: [], + GenerateModels: true, + ModelStyle: default, + IncludeModels: [] + ); + + private Task VerifyAsync( + ImmutableArray models, + [CallerMemberName] string? callerName = null) + { + return Verify(models + .Select(x => x with { Parents = [] }) + .ToArray()) + .UseDirectory($"Snapshots/{callerName}") + .UseFileName("_") + //.AutoVerify() + ; + } + + [TestMethod] + public Task OpenAi() + { + var yaml = H.Resources.openai_yaml.AsString(); + var settings = DefaultSettings with + { + //IncludeModels = ["CreateCompletionResponse"], + }; + + var models = ModelGeneratorMethods.PrepareData((yaml, settings)); + + return VerifyAsync(models); + } + + [TestMethod] + public Task Ollama() + { + var yaml = H.Resources.ollamacurated_yaml.AsString(); + var settings = DefaultSettings; + + var models = ModelGeneratorMethods.PrepareData((yaml, settings)); + + return VerifyAsync(models); + } +} \ No newline at end of file diff --git a/src/tests/OpenApiGenerator.UnitTests/OpenApiGenerator.UnitTests.csproj b/src/tests/OpenApiGenerator.UnitTests/OpenApiGenerator.UnitTests.csproj new file mode 100644 index 0000000000..6120bd342d --- /dev/null +++ b/src/tests/OpenApiGenerator.UnitTests/OpenApiGenerator.UnitTests.csproj @@ -0,0 +1,41 @@ + + + + net8.0 + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/tests/OpenApiGenerator.UnitTests/Resources/ipinfo.yaml b/src/tests/OpenApiGenerator.UnitTests/Resources/ipinfo.yaml new file mode 100644 index 0000000000..2490fb02d4 --- /dev/null +++ b/src/tests/OpenApiGenerator.UnitTests/Resources/ipinfo.yaml @@ -0,0 +1,1205 @@ +openapi: 3.0.0 +info: + description: | + [https://ipinfo.io](https://ipinfo.io). + version: "1.0.0" + title: ipinfo.io + contact: + email: havendv@gmail.com + license: + name: Apache 2.0 + url: 'https://github.com/ipinfo/csharp/blob/master/LICENSE' + +servers: + - url: 'https://ipinfo.io/' + +tags: + - name: general + description: General API. + + - name: single + description: Single info API. + + - name: privacy detection + description: Privacy Detection API. + externalDocs: + description: Find more info here + url: https://ipinfo.io/developers/privacy + + - name: asn + description: ASN API. + externalDocs: + description: Find more info here + url: https://ipinfo.io/developers/asn + + - name: ranges + description: IP Ranges API. + externalDocs: + description: Find more info here + url: https://ipinfo.io/developers/ranges + + - name: domains + description: Hosted Domains API. + externalDocs: + description: Find more info here + url: https://ipinfo.io/developers/hosted-domains + + - name: abuse + description: Abuse Contact API. + externalDocs: + description: Find more info here + url: https://ipinfo.io/ip-abuse-contact-api + +paths: + /: + get: + tags: + - general + summary: Returns information about the current IP. + description: Returns information about the current IP. + operationId: getCurrentInformation + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + responses: + '200': + $ref: '#/components/responses/FullResponse' + + '404': + $ref: '#/components/responses/NotFound' + + /batch: + post: + tags: + - general + summary: Returns information about the selected values. + description: Returns information about the selected values. + operationId: batch + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + requestBody: + $ref: '#/components/requestBodies/Batch' + + responses: + '200': + $ref: '#/components/responses/Batch' + + '404': + $ref: '#/components/responses/NotFound' + + '/{ip}': + get: + tags: + - general + summary: Returns information about the selected IP. + description: Returns information about the selected IP. + operationId: getInformationByIp + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + parameters: + - $ref: '#/components/parameters/Ip' + + responses: + '200': + $ref: '#/components/responses/FullResponse' + + '404': + $ref: '#/components/responses/NotFound' + + '/AS{asn}/json': + get: + tags: + - asn + summary: Returns information about an ASN, such as the assigned prefixes, related domain, and more. + description: Returns information about an AS. + operationId: getAsn + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + parameters: + - $ref: '#/components/parameters/Asn' + + responses: + '200': + $ref: '#/components/responses/Asn' + + '404': + $ref: '#/components/responses/NotFound' + + '/ranges/{domain}': + get: + tags: + - ranges + summary: Our IP address ranges API returns a list of all of the IP addresses ranges assigned to or operated by a company, identified by the provided domain name. + description: Returns information about a domain ranges. + operationId: getRanges + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + parameters: + - $ref: '#/components/parameters/Domain' + + responses: + '200': + $ref: '#/components/responses/Ranges' + + '404': + $ref: '#/components/responses/NotFound' + + '/domains/{ip}': + get: + tags: + - domains + summary: Our Hosted Domains, or Reverse IP API returns a list of all of the domains hosted on the provided IP address. + description: Returns a list of all of the domains hosted on the provided IP address. + operationId: getDomains + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + parameters: + - $ref: '#/components/parameters/Ip' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/Limit' + + responses: + '200': + $ref: '#/components/responses/Domains' + + '404': + $ref: '#/components/responses/NotFound' + + + '/{ip}/abuse': + get: + tags: + - abuse + summary: Our abuse contact API returns data containing information belonging to the abuse contact of every IP address on the Internet. Fields included in this response are the abuse contact's email address, postal/ZIP code, city, state, country, name, network, and phone number. + description: Our abuse contact API returns data containing information belonging to the abuse contact of every IP address on the Internet. Fields included in this response are the abuse contact's email address, postal/ZIP code, city, state, country, name, network, and phone number. + operationId: getAbuse + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + parameters: + - $ref: '#/components/parameters/Ip' + + responses: + '200': + $ref: '#/components/responses/Abuse' + + '404': + $ref: '#/components/responses/NotFound' + + + '/{ip}/privacy': + get: + tags: + - privacy detection + summary: Returns privacy information about the selected IP. + description: Returns privacy information about the selected IP. + operationId: getPrivacyInformationByIp + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + parameters: + - $ref: '#/components/parameters/Ip' + + responses: + '200': + $ref: '#/components/responses/Privacy' + + '400': + $ref: '#/components/responses/TokenNotPassed' + + '404': + $ref: '#/components/responses/NotFound' + + '/ip': + get: + tags: + - single + summary: Returns the current IP. + description: Returns the current IP. + operationId: getCurrentIp + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + responses: + '200': + $ref: '#/components/responses/Ip' + + '404': + $ref: '#/components/responses/NotFound' + + '/{ip}/ip': + get: + tags: + - single + summary: Returns a ip for the selected IP. Yes, I know this is a pointless method. + description: Returns a ip for the selected IP. Yes, I know this is a pointless method. + operationId: getIpByIp + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + parameters: + - $ref: '#/components/parameters/Ip' + + responses: + '200': + $ref: '#/components/responses/Ip' + + '404': + $ref: '#/components/responses/NotFound' + + '/hostname': + get: + tags: + - single + summary: Returns the current hostname. + description: Returns the current hostname. + operationId: getCurrentHostname + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + responses: + '200': + $ref: '#/components/responses/Hostname' + + '404': + $ref: '#/components/responses/NotFound' + + '/{ip}/hostname': + get: + tags: + - single + summary: Returns a hostname for the selected IP. + description: Returns a hostname for the selected IP. + operationId: getHostnameByIp + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + parameters: + - $ref: '#/components/parameters/Ip' + + responses: + '200': + $ref: '#/components/responses/Hostname' + + '404': + $ref: '#/components/responses/NotFound' + + '/city': + get: + tags: + - single + summary: Returns the current city. + description: Returns the current city. + operationId: getCurrentCity + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + responses: + '200': + $ref: '#/components/responses/City' + + '404': + $ref: '#/components/responses/NotFound' + + '/{ip}/city': + get: + tags: + - single + summary: Returns a city for the selected IP. + description: Returns a city for the selected IP. + operationId: getCityByIp + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + parameters: + - $ref: '#/components/parameters/Ip' + + responses: + '200': + $ref: '#/components/responses/City' + + '404': + $ref: '#/components/responses/NotFound' + + '/region': + get: + tags: + - single + summary: Returns the current region. + description: Returns current region. + operationId: getCurrentRegion + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + responses: + '200': + $ref: '#/components/responses/Region' + + '404': + $ref: '#/components/responses/NotFound' + + '/{ip}/region': + get: + tags: + - single + summary: Returns a region for the selected IP. + description: Returns a region for the selected IP. + operationId: getRegionByIp + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + parameters: + - $ref: '#/components/parameters/Ip' + + responses: + '200': + $ref: '#/components/responses/Region' + + '404': + $ref: '#/components/responses/NotFound' + + '/country': + get: + tags: + - single + summary: Returns the current country. + description: Returns the current country. + operationId: getCurrentCountry + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + responses: + '200': + $ref: '#/components/responses/Country' + + '404': + $ref: '#/components/responses/NotFound' + + '/{ip}/country': + get: + tags: + - single + summary: Returns a country for the selected IP. + description: Returns a country for the selected IP. + operationId: getCountryByIp + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + parameters: + - $ref: '#/components/parameters/Ip' + + responses: + '200': + $ref: '#/components/responses/Country' + + '404': + $ref: '#/components/responses/NotFound' + + '/loc': + get: + tags: + - single + summary: Returns the current location. + description: Returns the current location. + operationId: getCurrentLocation + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + responses: + '200': + $ref: '#/components/responses/Location' + + '404': + $ref: '#/components/responses/NotFound' + + '/{ip}/loc': + get: + tags: + - single + summary: Get a location for the selected IP. + description: Returns a location for the selected IP. + operationId: getLocationByIp + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + parameters: + - $ref: '#/components/parameters/Ip' + + responses: + '200': + $ref: '#/components/responses/Location' + + '404': + $ref: '#/components/responses/NotFound' + + '/postal': + get: + tags: + - single + summary: Returns the current postal. + description: Returns the current postal. + operationId: getCurrentPostal + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + responses: + '200': + $ref: '#/components/responses/Postal' + + '404': + $ref: '#/components/responses/NotFound' + + '/{ip}/postal': + get: + tags: + - single + summary: Returns a postal for the selected IP. + description: Returns a postal for the selected IP. + operationId: getPostalByIp + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + parameters: + - $ref: '#/components/parameters/Ip' + + responses: + '200': + $ref: '#/components/responses/Postal' + + '404': + $ref: '#/components/responses/NotFound' + + '/timezone': + get: + tags: + - single + summary: Returns the current timezone. + description: Returns the current timezone. + operationId: getCurrentTimezone + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + responses: + '200': + $ref: '#/components/responses/Timezone' + + '404': + $ref: '#/components/responses/NotFound' + + '/{ip}/timezone': + get: + tags: + - single + summary: Returns a timezone for the selected IP. + description: Returns a timezone for the selected IP. + operationId: getTimezoneByIp + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + parameters: + - $ref: '#/components/parameters/Ip' + + responses: + '200': + $ref: '#/components/responses/Timezone' + + '404': + $ref: '#/components/responses/NotFound' + + '/org': + get: + tags: + - single + summary: Returns the current organization. + description: Returns the current organization. + operationId: getCurrentOrganization + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + responses: + '200': + $ref: '#/components/responses/Organization' + + '404': + $ref: '#/components/responses/NotFound' + + '/{ip}/org': + get: + tags: + - single + summary: Returns a organization for the selected IP. + description: Returns a organization for the selected IP. + operationId: getOrganizationByIp + security: + - BasicAuth: [] + - BearerAuth: [] + - ApiKeyAuth: [] + + parameters: + - $ref: '#/components/parameters/Ip' + + responses: + '200': + $ref: '#/components/responses/Organization' + + '404': + $ref: '#/components/responses/NotFound' + + +externalDocs: + description: Find out more about ipinfo.io + url: 'https://ipinfo.io/developers' + + +components: + schemas: + FullResponse: + type: object + required: + - ip + - city + - country + + properties: + ip: + type: string + example: '66.87.125.72' + + hostname: + type: string + example: 'ip-66-87-125-72.spfdma.spcsdns.net' + + city: + type: string + example: 'Springfield' + + region: + type: string + example: 'Massachusetts' + + country: + type: string + example: 'US' + + loc: + type: string + example: '42.0999,-72.5783' + + postal: + type: string + example: '01105' + + timezone: + type: string + example: 'America/New_York' + + org: + type: string + example: 'AS51501 Khabarovsk home networks Ltd' + + asn: + $ref: '#/components/schemas/AsnResponse' + + company: + $ref: '#/components/schemas/Company' + + carrier: + $ref: '#/components/schemas/Carrier' + + privacy: + $ref: '#/components/schemas/PrivacyResponse' + + domains: + $ref: '#/components/schemas/DomainsResponse' + + AsnResponse: + type: object + required: + - asn + - name + - domain + - type + + properties: + asn: + type: string + example: 'AS10507' + + name: + type: string + example: 'Sprint Personal Communications Systems' + + country: + type: string + example: 'US' + + allocated: + type: string + example: '1997-02-14' + + registry: + type: string + example: 'arin' + + domain: + type: string + example: 'sprint.net' + + num_ips: + type: integer + example: 71224576 + + route: + type: string + example: '66.87.125.0/24' + + type: + type: string + example: 'isp' + enum: + - isp + - business + - education + - hosting + + prefixes: + type: array + items: + $ref: '#/components/schemas/Prefix' + + prefixes6: + type: array + items: + $ref: '#/components/schemas/Prefix6' + + peers: + type: array + items: + type: string + example: '1299' + + upstreams: + type: array + items: + type: string + example: '1299' + + downstreams: + type: array + items: + type: string + example: '109' + + Prefix: + type: object + required: + - netblock + - id + - name + - country + + properties: + netblock: + type: string + example: '104.69.216.0/22' + + id: + type: string + example: 'AKAMAI' + + name: + type: string + example: 'Akamai Technologies, Inc.' + + country: + type: string + example: 'US' + + size: + type: string + example: '256' + + status: + type: string + example: 'ALLOCATION' + + domain: + type: string + nullable: true + example: 'quadranet.com' + + Prefix6: + type: object + required: + - netblock + - id + - name + - country + + properties: + netblock: + type: string + example: '2601::/20' + + id: + type: string + example: 'COMCAST6NET' + + name: + type: string + example: 'Comcast Cable Communications, LLC' + + country: + type: string + example: 'US' + + size: + type: string + example: '20282409603651670423947251286016' + + status: + type: string + example: 'ASSIGNMENT' + + domain: + type: string + example: 'comcast.com' + + RangesResponse: + type: object + required: + - domain + - num_ranges + - ranges + + properties: + domain: + type: string + example: 'comcast.net' + + num_ranges: + type: string + example: '37330' + + ranges: + type: array + items: + type: string + example: '23.24.240.0/29' + + DomainsResponse: + type: object + required: + - total + + properties: + ip: + type: string + example: '1.1.1.1' + + page: + type: integer + example: 1 + + total: + type: integer + example: 17939 + + domains: + type: array + items: + type: string + example: 'udemy.com' + + AbuseResponse: + type: object + + properties: + address: + type: string + example: 'US, CA, Mountain View, 1600 Amphitheatre Parkway, 94043' + + country: + type: string + example: 'US' + + email: + type: string + example: 'network-abuse@google.com' + + name: + type: string + example: 'Abuse' + + network: + type: string + example: '8.8.8.0/24' + + phone: + type: string + example: '+1-650-253-0000' + + Company: + type: object + required: + - name + - domain + - type + + properties: + name: + type: string + example: 'Sprint Springfield POP' + + domain: + type: string + example: 'sprint.com' + + type: + type: string + example: 'isp' + enum: + - isp + - business + - education + - hosting + + Carrier: + type: object + required: + - name + - mcc + - mnc + + properties: + name: + type: string + example: 'Sprint Corporation' + + mcc: + type: string + example: '310' + + mnc: + type: string + example: '120' + + PrivacyResponse: + type: object + required: + - vpn + - proxy + - tor + - hosting + + properties: + vpn: + type: boolean + example: true + + proxy: + type: boolean + example: false + + tor: + type: boolean + example: false + + hosting: + type: boolean + example: false + + Error: + type: object + required: + - error + + properties: + error: + type: object + required: + - title + - message + + properties: + title: + type: string + example: 'Wrong ip' + + message: + type: string + example: 'Please provide a valid IP address' + + requestBodies: + Batch: + description: A JSON array containing values. + required: true + content: + application/json: + schema: + type: array + items: + type: string + + parameters: + Ip: + name: ip + in: path + description: A single IPv4 or IPv6 IP address. + required: true + schema: + type: string + + Asn: + name: asn + in: path + description: an ASN number. + required: true + schema: + type: integer + + Domain: + name: domain + in: path + description: a domain. + required: true + schema: + type: string + + Page: + name: page + in: query + description: The page query parameter can be used to go through paginated records. page starts at 0 and the parameter is part of the response when included in request. + schema: + type: integer + minimum: 0 + + Limit: + name: limit + in: query + description: The API returns 100 domains per page and has a limit of 1000 domains per page. We return up to 10 million results. The limit parameter can be used to control the number of domains per page. + schema: + type: integer + minimum: 1 + maximum: 1000 + default: 100 + + responses: + FullResponse: + description: Full response object. + content: + application/json: + schema: + $ref: '#/components/schemas/FullResponse' + + Asn: + description: ASN response object. + content: + application/json: + schema: + $ref: '#/components/schemas/AsnResponse' + + Ranges: + description: Ranges response object. + content: + application/json: + schema: + $ref: '#/components/schemas/RangesResponse' + + Domains: + description: Domains response object. + content: + application/json: + schema: + $ref: '#/components/schemas/DomainsResponse' + + Abuse: + description: Abuse response object. + content: + application/json: + schema: + $ref: '#/components/schemas/AbuseResponse' + + Privacy: + description: Privacy response. + content: + application/json: + schema: + $ref: '#/components/schemas/PrivacyResponse' + + Batch: + description: Batch response object. + content: + application/json: + schema: + type: object + additionalProperties: + type: object + + example: + 8.8.8.8/city: Mountain View + 8.8.8.8: + ip: 8.8.8.8 + hostname: dns.google + city: Mountain View + region: California + country: US + loc: 37.4056,-122.0775 + org: AS15169 Google LLC + postal: 94043 + timezone: America/Los_Angeles + + + Ip: + description: An ip. + content: + text/plain: + schema: + type: string + example: '66.87.125.72' + + Hostname: + description: A hostname. + content: + text/plain: + schema: + type: string + example: 'ip-66-87-125-72.spfdma.spcsdns.net' + + City: + description: A city. + content: + text/plain: + schema: + type: string + example: 'Springfield' + + Region: + description: A region. + content: + text/plain: + schema: + type: string + example: 'Massachusetts' + + Country: + description: A country. + content: + text/plain: + schema: + type: string + example: 'US' + + Location: + description: A location. + content: + text/plain: + schema: + type: string + example: '42.0999,-72.5783' + + Postal: + description: A postal. + content: + text/plain: + schema: + type: string + example: '01105' + + Timezone: + description: A timezone. + content: + text/plain: + schema: + type: string + example: 'America/New_York' + + Organization: + description: A organization. + content: + text/plain: + schema: + type: string + example: 'AS51501 Khabarovsk home networks Ltd' + + TokenNotPassed: + description: Token not passed. Please pass a valid token to access this module. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + NotFound: + description: Wrong ip. Please provide a valid IP address. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + securitySchemes: + BasicAuth: + type: http + scheme: basic + + BearerAuth: + type: http + scheme: bearer + + ApiKeyAuth: + type: apiKey + in: query + name: token \ No newline at end of file diff --git a/src/tests/OpenApiGenerator.UnitTests/Resources/ollama-curated.yaml b/src/tests/OpenApiGenerator.UnitTests/Resources/ollama-curated.yaml new file mode 100644 index 0000000000..b8feb87d0e --- /dev/null +++ b/src/tests/OpenApiGenerator.UnitTests/Resources/ollama-curated.yaml @@ -0,0 +1,840 @@ +openapi: 3.0.3 + +info: + title: Ollama API + description: API Spec for Ollama API. Please see https://github.com/jmorganca/ollama/blob/main/docs/api.md for more details. + version: 0.1.9 + +servers: + - url: http://localhost:11434/api + description: Ollama server URL + +tags: + - name: Completions + description: Given a prompt, the model will generate a completion. + - name: Chat + description: Given a list of messages comprising a conversation, the model will return a response. + - name: Embeddings + description: Get a vector representation of a given input. + - name: Models + description: List and describe the various models available. + +paths: + /generate: + post: + operationId: generateCompletion + tags: + - Completions + summary: Generate a response for a given prompt with a provided model. + description: The final response object will include statistics and additional data from the request. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GenerateCompletionRequest' + responses: + '200': + description: Successful operation. + content: + application/x-ndjson: + schema: + $ref: '#/components/schemas/GenerateCompletionResponse' + /chat: + post: + operationId: generateChatCompletion + tags: + - Chat + summary: Generate the next message in a chat with a provided model. + description: This is a streaming endpoint, so there will be a series of responses. The final response object will include statistics and additional data from the request. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GenerateChatCompletionRequest' + responses: + '200': + description: Successful operation. + content: + application/x-ndjson: + schema: + $ref: '#/components/schemas/GenerateChatCompletionResponse' + /embeddings: + post: + operationId: generateEmbedding + tags: + - Embeddings + summary: Generate embeddings from a model. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GenerateEmbeddingRequest' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/GenerateEmbeddingResponse' + /create: + post: + operationId: createModel + tags: + - Models + summary: Create a model from a Modelfile. + description: It is recommended to set `modelfile` to the content of the Modelfile rather than just set `path`. This is a requirement for remote create. Remote model creation should also create any file blobs, fields such as `FROM` and `ADAPTER`, explicitly with the server using Create a Blob and the value to the path indicated in the response. + requestBody: + description: Create a new model from a Modelfile. + content: + application/json: + schema: + $ref: '#/components/schemas/CreateModelRequest' + responses: + '200': + description: Successful operation. + content: + application/x-ndjson: + schema: + $ref: '#/components/schemas/CreateModelResponse' + /tags: + get: + operationId: listModels + tags: + - Models + summary: List models that are available locally. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ModelsResponse' + /show: + post: + operationId: showModelInfo + tags: + - Models + summary: Show details about a model including modelfile, template, parameters, license, and system prompt. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ModelInfoRequest' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ModelInfo' + /copy: + post: + operationId: copyModel + tags: + - Models + summary: Creates a model with another name from an existing model. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CopyModelRequest' + responses: + '200': + description: Successful operation. + /delete: + delete: + operationId: deleteModel + tags: + - Models + summary: Delete a model and its data. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteModelRequest' + responses: + '200': + description: Successful operation. + /pull: + post: + operationId: pullModel + tags: + - Models + summary: Download a model from the ollama library. + description: Cancelled pulls are resumed from where they left off, and multiple calls will share the same download progress. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PullModelRequest' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PullModelResponse' + /push: + post: + operationId: pushModel + tags: + - Models + summary: Upload a model to a model library. + description: Requires registering for ollama.ai and adding a public key first. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PushModelRequest' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/PushModelResponse' + /blobs/{digest}: + head: + operationId: checkBlob + tags: + - Models + summary: Check to see if a blob exists on the Ollama server which is useful when creating models. + parameters: + - in: query + name: name + schema: + type: string + required: true + description: the SHA256 digest of the blob + example: sha256:c8edda1f17edd2f1b60253b773d837bda7b9d249a61245931a4d7c9a8d350250 + responses: + '200': + description: Blob exists on the server + '404': + description: Blob was not found + post: + operationId: createBlob + tags: + - Models + summary: Create a blob from a file. Returns the server file path. + parameters: + - in: query + name: name + schema: + type: string + required: true + description: the SHA256 digest of the blob + example: sha256:c8edda1f17edd2f1b60253b773d837bda7b9d249a61245931a4d7c9a8d350250 + requestBody: + content: + application/octet-stream: + schema: + type: string + format: binary + responses: + '201': + description: Blob was successfully created + +components: + schemas: + GenerateCompletionRequest: + type: object + description: Request class for the generate endpoint. + properties: + model: + type: string + description: &model_name | + The model name. + + Model names follow a `model:tag` format. Some examples are `orca-mini:3b-q4_1` and `llama2:70b`. The tag is optional and, if not provided, will default to `latest`. The tag is used to identify a specific version. + example: llama2:7b + prompt: + type: string + description: The prompt to generate a response. + example: Why is the sky blue? + images: + type: array + description: (optional) a list of Base64-encoded images to include in the message (for multimodal models such as llava) + items: + type: string + description: Base64-encoded image (for multimodal models such as llava) + example: iVBORw0KGgoAAAANSUhEUgAAAAkAAAANCAIAAAD0YtNRAAAABnRSTlMA/AD+APzoM1ogAAAAWklEQVR4AWP48+8PLkR7uUdzcMvtU8EhdykHKAciEXL3pvw5FQIURaBDJkARoDhY3zEXiCgCHbNBmAlUiyaBkENoxZSDWnOtBmoAQu7TnT+3WuDOA7KBIkAGAGwiNeqjusp/AAAAAElFTkSuQmCC + system: + type: string + description: The system prompt to (overrides what is defined in the Modelfile). + template: + type: string + description: The full prompt or prompt template (overrides what is defined in the Modelfile). + context: + type: array + description: The context parameter returned from a previous request to [generateCompletion], this can be used to keep a short conversational memory. + items: + type: integer + options: + $ref: '#/components/schemas/RequestOptions' + format: + $ref: '#/components/schemas/ResponseFormat' + raw: + type: boolean + description: | + If `true` no formatting will be applied to the prompt and no context will be returned. + + You may choose to use the `raw` parameter if you are specifying a full templated prompt in your request to the API, and are managing history yourself. + stream: + type: boolean + description: &stream | + If `false` the response will be returned as a single response object, otherwise the response will be streamed as a series of objects. + default: false + keep_alive: + type: integer + description: &keep_alive | + How long (in minutes) to keep the model loaded in memory. + + - If set to a positive duration (e.g. 20), the model will stay loaded for the provided duration. + - If set to a negative duration (e.g. -1), the model will stay loaded indefinitely. + - If set to 0, the model will be unloaded immediately once finished. + - If not set, the model will stay loaded for 5 minutes by default + required: + - model + - prompt + RequestOptions: + type: object + description: Additional model parameters listed in the documentation for the Modelfile such as `temperature`. + properties: + num_keep: + type: integer + description: | + Number of tokens to keep from the prompt. + seed: + type: integer + description: | + Sets the random number seed to use for generation. Setting this to a specific number will make the model generate the same text for the same prompt. (Default: 0) + num_predict: + type: integer + description: | + Maximum number of tokens to predict when generating text. (Default: 128, -1 = infinite generation, -2 = fill context) + top_k: + type: integer + description: | + Reduces the probability of generating nonsense. A higher value (e.g. 100) will give more diverse answers, while a lower value (e.g. 10) will be more conservative. (Default: 40) + top_p: + type: number + format: float + description: | + Works together with top-k. A higher value (e.g., 0.95) will lead to more diverse text, while a lower value (e.g., 0.5) will generate more focused and conservative text. (Default: 0.9) + tfs_z: + type: number + format: float + description: | + Tail free sampling is used to reduce the impact of less probable tokens from the output. A higher value (e.g., 2.0) will reduce the impact more, while a value of 1.0 disables this setting. (default: 1) + typical_p: + type: number + format: float + description: | + Typical p is used to reduce the impact of less probable tokens from the output. + repeat_last_n: + type: integer + description: | + Sets how far back for the model to look back to prevent repetition. (Default: 64, 0 = disabled, -1 = num_ctx) + temperature: + type: number + format: float + description: | + The temperature of the model. Increasing the temperature will make the model answer more creatively. (Default: 0.8) + repeat_penalty: + type: number + format: float + description: | + Sets how strongly to penalize repetitions. A higher value (e.g., 1.5) will penalize repetitions more strongly, while a lower value (e.g., 0.9) will be more lenient. (Default: 1.1) + presence_penalty: + type: number + format: float + description: | + Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + frequency_penalty: + type: number + format: float + description: | + Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + mirostat: + type: integer + description: | + Enable Mirostat sampling for controlling perplexity. (default: 0, 0 = disabled, 1 = Mirostat, 2 = Mirostat 2.0) + mirostat_tau: + type: number + format: float + description: | + Controls the balance between coherence and diversity of the output. A lower value will result in more focused and coherent text. (Default: 5.0) + mirostat_eta: + type: number + format: float + description: | + Influences how quickly the algorithm responds to feedback from the generated text. A lower learning rate will result in slower adjustments, while a higher learning rate will make the algorithm more responsive. (Default: 0.1) + penalize_newline: + type: boolean + description: | + Penalize newlines in the output. (Default: false) + stop: + type: array + description: Sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. + items: + type: string + numa: + type: boolean + description: | + Enable NUMA support. (Default: false) + num_ctx: + type: integer + description: | + Sets the size of the context window used to generate the next token. + num_batch: + type: integer + description: | + Sets the number of batches to use for generation. (Default: 1) + num_gqa: + type: integer + description: | + The number of GQA groups in the transformer layer. Required for some models, for example it is 8 for `llama2:70b`. + num_gpu: + type: integer + description: | + The number of layers to send to the GPU(s). On macOS it defaults to 1 to enable metal support, 0 to disable. + main_gpu: + type: integer + description: | + The GPU to use for the main model. Default is 0. + low_vram: + type: boolean + description: | + Enable low VRAM mode. (Default: false) + f16_kv: + type: boolean + description: | + Enable f16 key/value. (Default: false) + logits_all: + type: boolean + description: | + Enable logits all. (Default: false) + vocab_only: + type: boolean + description: | + Enable vocab only. (Default: false) + use_mmap: + type: boolean + description: | + Enable mmap. (Default: false) + use_mlock: + type: boolean + description: | + Enable mlock. (Default: false) + embedding_only: + type: boolean + description: | + Enable embedding only. (Default: false) + rope_frequency_base: + type: number + format: float + description: | + The base of the rope frequency scale. (Default: 1.0) + rope_frequency_scale: + type: number + format: float + description: | + The scale of the rope frequency. (Default: 1.0) + num_thread: + type: integer + description: | + Sets the number of threads to use during computation. By default, Ollama will detect this for optimal performance. It is recommended to set this value to the number of physical CPU cores your system has (as opposed to the logical number of cores). + ResponseFormat: + type: string + description: | + The format to return a response in. Currently the only accepted value is json. + + Enable JSON mode by setting the format parameter to json. This will structure the response as valid JSON. + + Note: it's important to instruct the model to use JSON in the prompt. Otherwise, the model may generate large amounts whitespace. + enum: + - json + GenerateCompletionResponse: + type: object + description: The response class for the generate endpoint. + properties: + model: + type: string + description: *model_name + example: llama2:7b + created_at: + type: string + format: date-time + description: Date on which a model was created. + example: 2023-08-04T19:22:45.499127Z + response: + type: string + description: The response for a given prompt with a provided model. + example: The sky appears blue because of a phenomenon called Rayleigh scattering. + done: + type: boolean + description: Whether the response has completed. + example: true + context: + type: array + description: | + An encoding of the conversation used in this response, this can be sent in the next request to keep a conversational memory. + items: + type: integer + example: [ 1, 2, 3 ] + total_duration: + type: integer + description: Time spent generating the response. + example: 5589157167 + load_duration: + type: integer + description: Time spent in nanoseconds loading the model. + example: 3013701500 + prompt_eval_count: + type: integer + description: Number of tokens in the prompt. + example: 46 + prompt_eval_duration: + type: integer + description: Time spent in nanoseconds evaluating the prompt. + example: 1160282000 + eval_count: + type: integer + description: Number of tokens the response. + example: 113 + eval_duration: + type: integer + description: Time in nanoseconds spent generating the response. + example: 1325948000 + GenerateChatCompletionRequest: + type: object + description: Request class for the chat endpoint. + properties: + model: + type: string + description: *model_name + example: llama2:7b + messages: + type: array + description: The messages of the chat, this can be used to keep a chat memory + items: + $ref: '#/components/schemas/Message' + format: + $ref: '#/components/schemas/ResponseFormat' + options: + $ref: '#/components/schemas/RequestOptions' + stream: + type: boolean + description: *stream + default: false + keep_alive: + type: integer + description: *keep_alive + required: + - model + - messages + GenerateChatCompletionResponse: + type: object + description: The response class for the chat endpoint. + properties: + message: + $ref: '#/components/schemas/Message' + model: + type: string + description: *model_name + example: llama2:7b + created_at: + type: string + format: date-time + description: Date on which a model was created. + example: 2023-08-04T19:22:45.499127Z + done: + type: boolean + description: Whether the response has completed. + example: true + total_duration: + type: integer + description: Time spent generating the response. + example: 5589157167 + load_duration: + type: integer + description: Time spent in nanoseconds loading the model. + example: 3013701500 + prompt_eval_count: + type: integer + description: Number of tokens in the prompt. + example: 46 + prompt_eval_duration: + type: integer + description: Time spent in nanoseconds evaluating the prompt. + example: 1160282000 + eval_count: + type: integer + description: Number of tokens the response. + example: 113 + eval_duration: + type: integer + description: Time in nanoseconds spent generating the response. + example: 1325948000 + Message: + type: object + description: A message in the chat endpoint + properties: + role: + type: string + description: The role of the message + enum: [ "system", "user", "assistant" ] + content: + type: string + description: The content of the message + example: Why is the sky blue? + images: + type: array + description: (optional) a list of Base64-encoded images to include in the message (for multimodal models such as llava) + items: + type: string + description: Base64-encoded image (for multimodal models such as llava) + example: iVBORw0KGgoAAAANSUhEUgAAAAkAAAANCAIAAAD0YtNRAAAABnRSTlMA/AD+APzoM1ogAAAAWklEQVR4AWP48+8PLkR7uUdzcMvtU8EhdykHKAciEXL3pvw5FQIURaBDJkARoDhY3zEXiCgCHbNBmAlUiyaBkENoxZSDWnOtBmoAQu7TnT+3WuDOA7KBIkAGAGwiNeqjusp/AAAAAElFTkSuQmCC + required: + - role + - content + GenerateEmbeddingRequest: + description: Generate embeddings from a model. + type: object + properties: + model: + type: string + description: *model_name + example: llama2:7b + prompt: + type: string + description: Text to generate embeddings for. + example: 'Here is an article about llamas...' + options: + $ref: '#/components/schemas/RequestOptions' + required: + - model + - prompt + GenerateEmbeddingResponse: + type: object + description: Returns the embedding information. + properties: + embedding: + type: array + description: The embedding for the prompt. + items: + type: number + format: double + example: [ 0.5670403838157654, 0.009260174818336964, ... ] + CreateModelRequest: + type: object + description: Create model request object. + properties: + name: + type: string + description: *model_name + example: mario + modelfile: + type: string + description: The contents of the Modelfile. + example: FROM llama2\nSYSTEM You are mario from Super Mario Bros. + stream: + type: boolean + description: *stream + default: false + required: + - name + - modelfile + CreateModelResponse: + description: Response object for creating a model. When finished, `status` is `success`. + type: object + properties: + status: + $ref: '#/components/schemas/CreateModelStatus' + CreateModelStatus: + type: string + description: Status creating the model + enum: + - creating system layer + - parsing modelfile + - success + ModelsResponse: + description: Response class for the list models endpoint. + type: object + properties: + models: + type: array + description: List of models available locally. + items: + $ref: '#/components/schemas/Model' + Model: + type: object + description: A model available locally. + properties: + name: + type: string + description: *model_name + example: llama2:7b + modified_at: + type: string + format: date-time + description: Model modification date. + example: 2023-08-02T17:02:23.713454393-07:00 + size: + type: integer + description: Size of the model on disk. + example: 7323310500 + ModelInfoRequest: + description: Request class for the show model info endpoint. + type: object + properties: + name: + type: string + description: *model_name + example: llama2:7b + required: + - name + ModelInfo: + description: Details about a model including modelfile, template, parameters, license, and system prompt. + type: object + properties: + license: + type: string + description: The model's license. + example: + modelfile: + type: string + description: The modelfile associated with the model. + example: 'Modelfile generated by \"ollama show\"\n# To build a new Modelfile based on this one, replace the FROM line with:\n# FROM llama2:latest\n\nFROM /Users/username/.ollama/models/blobs/sha256:8daa9615cce30c259a9555b1cc250d461d1bc69980a274b44d7eda0be78076d8\nTEMPLATE \"\"\"[INST] {{ if and .First .System }}<>{{ .System }}<>\n\n{{ end }}{{ .Prompt }} [/INST] \"\"\"\nSYSTEM \"\"\"\"\"\"\nPARAMETER stop [INST]\nPARAMETER stop [/INST]\nPARAMETER stop <>\nPARAMETER stop <>\n"' + parameters: + type: string + description: The model parameters. + example: 'stop [INST]\nstop [/INST]\nstop <>\nstop <>' + template: + type: string + description: The prompt template for the model. + example: '[INST] {{ if and .First .System }}<>{{ .System }}<>\n\n{{ end }}{{ .Prompt }} [/INST]' + CopyModelRequest: + description: Request class for copying a model. + type: object + properties: + source: + type: string + description: Name of the model to copy. + example: llama2:7b + destination: + type: string + description: Name of the new model. + example: llama2-backup + required: + - source + - destination + DeleteModelRequest: + description: Request class for deleting a model. + type: object + properties: + name: + type: string + description: *model_name + example: llama2:13b + required: + - name + PullModelRequest: + description: Request class for pulling a model. + type: object + properties: + name: + type: string + description: *model_name + example: llama2:7b + insecure: + type: boolean + description: | + Allow insecure connections to the library. + + Only use this if you are pulling from your own library during development. + default: false + stream: + type: boolean + description: *stream + default: false + required: + - name + PullModelResponse: + description: | + Response class for pulling a model. + + The first object is the manifest. Then there is a series of downloading responses. Until any of the download is completed, the `completed` key may not be included. + + The number of files to be downloaded depends on the number of layers specified in the manifest. + type: object + properties: + status: + $ref: '#/components/schemas/PullModelStatus' + digest: + type: string + description: The model's digest. + example: 'sha256:bc07c81de745696fdf5afca05e065818a8149fb0c77266fb584d9b2cba3711a' + total: + type: integer + description: Total size of the model. + example: 2142590208 + completed: + type: integer + description: Total bytes transferred. + example: 2142590208 + PullModelStatus: + type: string + description: Status pulling the model. + enum: + - pulling manifest + - downloading digestname + - verifying sha256 digest + - writing manifest + - removing any unused layers + - success + example: pulling manifest + PushModelRequest: + description: Request class for pushing a model. + type: object + properties: + name: + type: string + description: The name of the model to push in the form of /:. + example: 'mattw/pygmalion:latest' + insecure: + type: boolean + description: | + Allow insecure connections to the library. + + Only use this if you are pushing to your library during development. + default: false + stream: + type: boolean + description: *stream + default: false + required: + - name + PushModelResponse: + type: object + description: Response class for pushing a model. + properties: + status: + $ref: '#/components/schemas/PushModelStatus' + digest: + type: string + description: the model's digest + example: 'sha256:bc07c81de745696fdf5afca05e065818a8149fb0c77266fb584d9b2cba3711a' + total: + type: integer + description: total size of the model + example: 2142590208 + PushModelStatus: + type: string + description: Status pushing the model. + enum: + - retrieving manifest + - starting upload + - pushing manifest + - success diff --git a/src/tests/OpenApiGenerator.UnitTests/Resources/openai.yaml b/src/tests/OpenApiGenerator.UnitTests/Resources/openai.yaml new file mode 100644 index 0000000000..8ff3e97c93 --- /dev/null +++ b/src/tests/OpenApiGenerator.UnitTests/Resources/openai.yaml @@ -0,0 +1,9681 @@ +openapi: 3.0.0 +info: + title: OpenAI API + description: The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details. + version: "2.0.0" + termsOfService: https://openai.com/policies/terms-of-use + contact: + name: OpenAI Support + url: https://help.openai.com/ + license: + name: MIT + url: https://github.com/openai/openai-openapi/blob/master/LICENSE +servers: + - url: https://api.openai.com/v1 +tags: + - name: Assistants + description: Build Assistants that can call models and use tools. + - name: Audio + description: Learn how to turn audio into text or text into audio. + - name: Chat + description: Given a list of messages comprising a conversation, the model will return a response. + - name: Completions + description: Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position. + - name: Embeddings + description: Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms. + - name: Fine-tuning + description: Manage fine-tuning jobs to tailor a model to your specific training data. + - name: Files + description: Files are used to upload documents that can be used with features like Assistants and Fine-tuning. + - name: Images + description: Given a prompt and/or an input image, the model will generate a new image. + - name: Models + description: List and describe the various models available in the API. + - name: Moderations + description: Given a input text, outputs if the model classifies it as violating OpenAI's content policy. + - name: Fine-tunes + description: Manage legacy fine-tuning jobs to tailor a model to your specific training data. + - name: Edits + description: Given a prompt and an instruction, the model will return an edited version of the prompt. +paths: + # Note: When adding an endpoint, make sure you also add it in the `groups` section, in the end of this file, + # under the appropriate group + /chat/completions: + post: + operationId: createChatCompletion + tags: + - Chat + summary: Creates a model response for the given chat conversation. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateChatCompletionRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/CreateChatCompletionResponse" + + x-oaiMeta: + name: Create chat completion + group: chat + returns: | + Returns a [chat completion](/docs/api-reference/chat/object) object, or a streamed sequence of [chat completion chunk](/docs/api-reference/chat/streaming) objects if the request is streamed. + path: create + examples: + - title: Default + request: + curl: | + curl https://api.openai.com/v1/chat/completions \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "model": "VAR_model_id", + "messages": [ + { + "role": "system", + "content": "You are a helpful assistant." + }, + { + "role": "user", + "content": "Hello!" + } + ] + }' + python: | + from openai import OpenAI + client = OpenAI() + + completion = client.chat.completions.create( + model="VAR_model_id", + messages=[ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "Hello!"} + ] + ) + + print(completion.choices[0].message) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const completion = await openai.chat.completions.create({ + messages: [{ role: "system", content: "You are a helpful assistant." }], + model: "VAR_model_id", + }); + + console.log(completion.choices[0]); + } + + main(); + response: &chat_completion_example | + { + "id": "chatcmpl-123", + "object": "chat.completion", + "created": 1677652288, + "model": "gpt-3.5-turbo-0613", + "system_fingerprint": "fp_44709d6fcb", + "choices": [{ + "index": 0, + "message": { + "role": "assistant", + "content": "\n\nHello there, how may I assist you today?", + }, + "logprobs": null, + "finish_reason": "stop" + }], + "usage": { + "prompt_tokens": 9, + "completion_tokens": 12, + "total_tokens": 21 + } + } + - title: Image input + request: + curl: | + curl https://api.openai.com/v1/chat/completions \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "model": "gpt-4-vision-preview", + "messages": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "What’s in this image?" + }, + { + "type": "image_url", + "image_url": { + "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg" + } + } + ] + } + ], + "max_tokens": 300 + }' + python: | + from openai import OpenAI + + client = OpenAI() + + response = client.chat.completions.create( + model="gpt-4-vision-preview", + messages=[ + { + "role": "user", + "content": [ + {"type": "text", "text": "What’s in this image?"}, + { + "type": "image_url", + "image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg", + }, + ], + } + ], + max_tokens=300, + ) + + print(response.choices[0]) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const response = await openai.chat.completions.create({ + model: "gpt-4-vision-preview", + messages: [ + { + role: "user", + content: [ + { type: "text", text: "What’s in this image?" }, + { + type: "image_url", + image_url: + "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg", + }, + ], + }, + ], + }); + console.log(response.choices[0]); + } + main(); + response: &chat_completion_image_example | + { + "id": "chatcmpl-123", + "object": "chat.completion", + "created": 1677652288, + "model": "gpt-3.5-turbo-0613", + "system_fingerprint": "fp_44709d6fcb", + "choices": [{ + "index": 0, + "message": { + "role": "assistant", + "content": "\n\nHello there, how may I assist you today?", + }, + "logprobs": null, + "finish_reason": "stop" + }], + "usage": { + "prompt_tokens": 9, + "completion_tokens": 12, + "total_tokens": 21 + } + } + - title: Streaming + request: + curl: | + curl https://api.openai.com/v1/chat/completions \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "model": "VAR_model_id", + "messages": [ + { + "role": "system", + "content": "You are a helpful assistant." + }, + { + "role": "user", + "content": "Hello!" + } + ], + "stream": true + }' + python: | + from openai import OpenAI + client = OpenAI() + + completion = client.chat.completions.create( + model="VAR_model_id", + messages=[ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "Hello!"} + ], + stream=True + ) + + for chunk in completion: + print(chunk.choices[0].delta) + + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const completion = await openai.chat.completions.create({ + model: "VAR_model_id", + messages: [ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "Hello!"} + ], + stream: true, + }); + + for await (const chunk of completion) { + console.log(chunk.choices[0].delta.content); + } + } + + main(); + response: &chat_completion_chunk_example | + {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"role":"assistant","content":""},"logprobs":null,"finish_reason":null}]} + + {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":"Hello"},"logprobs":null,"finish_reason":null}]} + + {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":"!"},"logprobs":null,"finish_reason":null}]} + + .... + + {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":" today"},"logprobs":null,"finish_reason":null}]} + + {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":"?"},"logprobs":null,"finish_reason":null}]} + + {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}]} + - title: Functions + request: + curl: | + curl https://api.openai.com/v1/chat/completions \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "model": "gpt-3.5-turbo", + "messages": [ + { + "role": "user", + "content": "What is the weather like in Boston?" + } + ], + "tools": [ + { + "type": "function", + "function": { + "name": "get_current_weather", + "description": "Get the current weather in a given location", + "parameters": { + "type": "object", + "properties": { + "location": { + "type": "string", + "description": "The city and state, e.g. San Francisco, CA" + }, + "unit": { + "type": "string", + "enum": ["celsius", "fahrenheit"] + } + }, + "required": ["location"] + } + } + } + ], + "tool_choice": "auto" + }' + python: | + from openai import OpenAI + client = OpenAI() + + tools = [ + { + "type": "function", + "function": { + "name": "get_current_weather", + "description": "Get the current weather in a given location", + "parameters": { + "type": "object", + "properties": { + "location": { + "type": "string", + "description": "The city and state, e.g. San Francisco, CA", + }, + "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}, + }, + "required": ["location"], + }, + } + } + ] + messages = [{"role": "user", "content": "What's the weather like in Boston today?"}] + completion = client.chat.completions.create( + model="VAR_model_id", + messages=messages, + tools=tools, + tool_choice="auto" + ) + + print(completion) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const messages = [{"role": "user", "content": "What's the weather like in Boston today?"}]; + const tools = [ + { + "type": "function", + "function": { + "name": "get_current_weather", + "description": "Get the current weather in a given location", + "parameters": { + "type": "object", + "properties": { + "location": { + "type": "string", + "description": "The city and state, e.g. San Francisco, CA", + }, + "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}, + }, + "required": ["location"], + }, + } + } + ]; + + const response = await openai.chat.completions.create({ + model: "gpt-3.5-turbo", + messages: messages, + tools: tools, + tool_choice: "auto", + }); + + console.log(response); + } + + main(); + response: &chat_completion_function_example | + { + "id": "chatcmpl-abc123", + "object": "chat.completion", + "created": 1699896916, + "model": "gpt-3.5-turbo-0613", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": null, + "tool_calls": [ + { + "id": "call_abc123", + "type": "function", + "function": { + "name": "get_current_weather", + "arguments": "{\n\"location\": \"Boston, MA\"\n}" + } + } + ] + }, + "logprobs": null, + "finish_reason": "tool_calls" + } + ], + "usage": { + "prompt_tokens": 82, + "completion_tokens": 17, + "total_tokens": 99 + } + } + + /completions: + post: + operationId: createCompletion + tags: + - Completions + summary: Creates a completion for the provided prompt and parameters. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateCompletionRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/CreateCompletionResponse" + x-oaiMeta: + name: Create completion + group: completions + returns: | + Returns a [completion](/docs/api-reference/completions/object) object, or a sequence of completion objects if the request is streamed. + legacy: true + examples: + - title: No streaming + request: + curl: | + curl https://api.openai.com/v1/completions \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "model": "VAR_model_id", + "prompt": "Say this is a test", + "max_tokens": 7, + "temperature": 0 + }' + python: | + from openai import OpenAI + client = OpenAI() + + client.completions.create( + model="VAR_model_id", + prompt="Say this is a test", + max_tokens=7, + temperature=0 + ) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const completion = await openai.completions.create({ + model: "VAR_model_id", + prompt: "Say this is a test.", + max_tokens: 7, + temperature: 0, + }); + + console.log(completion); + } + main(); + response: | + { + "id": "cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7", + "object": "text_completion", + "created": 1589478378, + "model": "VAR_model_id", + "system_fingerprint": "fp_44709d6fcb", + "choices": [ + { + "text": "\n\nThis is indeed a test", + "index": 0, + "logprobs": null, + "finish_reason": "length" + } + ], + "usage": { + "prompt_tokens": 5, + "completion_tokens": 7, + "total_tokens": 12 + } + } + - title: Streaming + request: + curl: | + curl https://api.openai.com/v1/completions \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "model": "VAR_model_id", + "prompt": "Say this is a test", + "max_tokens": 7, + "temperature": 0, + "stream": true + }' + python: | + from openai import OpenAI + client = OpenAI() + + for chunk in client.completions.create( + model="VAR_model_id", + prompt="Say this is a test", + max_tokens=7, + temperature=0, + stream=True + ): + print(chunk.choices[0].text) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const stream = await openai.completions.create({ + model: "VAR_model_id", + prompt: "Say this is a test.", + stream: true, + }); + + for await (const chunk of stream) { + console.log(chunk.choices[0].text) + } + } + main(); + response: | + { + "id": "cmpl-7iA7iJjj8V2zOkCGvWF2hAkDWBQZe", + "object": "text_completion", + "created": 1690759702, + "choices": [ + { + "text": "This", + "index": 0, + "logprobs": null, + "finish_reason": null + } + ], + "model": "gpt-3.5-turbo-instruct" + "system_fingerprint": "fp_44709d6fcb", + } + /edits: + post: + operationId: createEdit + deprecated: true + tags: + - Edits + summary: Creates a new edit for the provided input, instruction, and parameters. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateEditRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/CreateEditResponse" + x-oaiMeta: + name: Create edit + returns: | + Returns an [edit](/docs/api-reference/edits/object) object. + group: edits + examples: + request: + curl: | + curl https://api.openai.com/v1/edits \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "model": "VAR_model_id", + "input": "What day of the wek is it?", + "instruction": "Fix the spelling mistakes" + }' + python: | + from openai import OpenAI + client = OpenAI() + + client.edits.create( + model="VAR_model_id", + input="What day of the wek is it?", + instruction="Fix the spelling mistakes" + ) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const edit = await openai.edits.create({ + model: "VAR_model_id", + input: "What day of the wek is it?", + instruction: "Fix the spelling mistakes.", + }); + + console.log(edit); + } + + main(); + response: &edit_example | + { + "object": "edit", + "created": 1589478378, + "choices": [ + { + "text": "What day of the week is it?", + "index": 0, + } + ], + "usage": { + "prompt_tokens": 25, + "completion_tokens": 32, + "total_tokens": 57 + } + } + + /images/generations: + post: + operationId: createImage + tags: + - Images + summary: Creates an image given a prompt. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateImageRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ImagesResponse" + x-oaiMeta: + name: Create image + group: images + returns: Returns a list of [image](/docs/api-reference/images/object) objects. + examples: + request: + curl: | + curl https://api.openai.com/v1/images/generations \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "model": "dall-e-3", + "prompt": "A cute baby sea otter", + "n": 1, + "size": "1024x1024" + }' + python: | + from openai import OpenAI + client = OpenAI() + + client.images.generate( + model="dall-e-3", + prompt="A cute baby sea otter", + n=1, + size="1024x1024" + ) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const image = await openai.images.generate({ model: "dall-e-3", prompt: "A cute baby sea otter" }); + + console.log(image.data); + } + main(); + response: | + { + "created": 1589478378, + "data": [ + { + "url": "https://..." + }, + { + "url": "https://..." + } + ] + } + /images/edits: + post: + operationId: createImageEdit + tags: + - Images + summary: Creates an edited or extended image given an original image and a prompt. + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: "#/components/schemas/CreateImageEditRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ImagesResponse" + x-oaiMeta: + name: Create image edit + group: images + returns: Returns a list of [image](/docs/api-reference/images/object) objects. + examples: + request: + curl: | + curl https://api.openai.com/v1/images/edits \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -F image="@otter.png" \ + -F mask="@mask.png" \ + -F prompt="A cute baby sea otter wearing a beret" \ + -F n=2 \ + -F size="1024x1024" + python: | + from openai import OpenAI + client = OpenAI() + + client.images.edit( + image=open("otter.png", "rb"), + mask=open("mask.png", "rb"), + prompt="A cute baby sea otter wearing a beret", + n=2, + size="1024x1024" + ) + node.js: |- + import fs from "fs"; + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const image = await openai.images.edit({ + image: fs.createReadStream("otter.png"), + mask: fs.createReadStream("mask.png"), + prompt: "A cute baby sea otter wearing a beret", + }); + + console.log(image.data); + } + main(); + response: | + { + "created": 1589478378, + "data": [ + { + "url": "https://..." + }, + { + "url": "https://..." + } + ] + } + /images/variations: + post: + operationId: createImageVariation + tags: + - Images + summary: Creates a variation of a given image. + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: "#/components/schemas/CreateImageVariationRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ImagesResponse" + x-oaiMeta: + name: Create image variation + group: images + returns: Returns a list of [image](/docs/api-reference/images/object) objects. + examples: + request: + curl: | + curl https://api.openai.com/v1/images/variations \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -F image="@otter.png" \ + -F n=2 \ + -F size="1024x1024" + python: | + from openai import OpenAI + client = OpenAI() + + response = client.images.create_variation( + image=open("image_edit_original.png", "rb"), + n=2, + size="1024x1024" + ) + node.js: |- + import fs from "fs"; + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const image = await openai.images.createVariation({ + image: fs.createReadStream("otter.png"), + }); + + console.log(image.data); + } + main(); + response: | + { + "created": 1589478378, + "data": [ + { + "url": "https://..." + }, + { + "url": "https://..." + } + ] + } + + /embeddings: + post: + operationId: createEmbedding + tags: + - Embeddings + summary: Creates an embedding vector representing the input text. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateEmbeddingRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/CreateEmbeddingResponse" + x-oaiMeta: + name: Create embeddings + group: embeddings + returns: A list of [embedding](/docs/api-reference/embeddings/object) objects. + examples: + request: + curl: | + curl https://api.openai.com/v1/embeddings \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "input": "The food was delicious and the waiter...", + "model": "text-embedding-ada-002", + "encoding_format": "float" + }' + python: | + from openai import OpenAI + client = OpenAI() + + client.embeddings.create( + model="text-embedding-ada-002", + input="The food was delicious and the waiter...", + encoding_format="float" + ) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const embedding = await openai.embeddings.create({ + model: "text-embedding-ada-002", + input: "The quick brown fox jumped over the lazy dog", + encoding_format: "float", + }); + + console.log(embedding); + } + + main(); + response: | + { + "object": "list", + "data": [ + { + "object": "embedding", + "embedding": [ + 0.0023064255, + -0.009327292, + .... (1536 floats total for ada-002) + -0.0028842222, + ], + "index": 0 + } + ], + "model": "text-embedding-ada-002", + "usage": { + "prompt_tokens": 8, + "total_tokens": 8 + } + } + + /audio/speech: + post: + operationId: createSpeech + tags: + - Audio + summary: Generates audio from the input text. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateSpeechRequest" + responses: + "200": + description: OK + headers: + Transfer-Encoding: + schema: + type: string + description: chunked + content: + application/octet-stream: + schema: + type: string + format: binary + x-oaiMeta: + name: Create speech + group: audio + returns: The audio file content. + examples: + request: + curl: | + curl https://api.openai.com/v1/audio/speech \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "tts-1", + "input": "The quick brown fox jumped over the lazy dog.", + "voice": "alloy" + }' \ + --output speech.mp3 + python: | + from pathlib import Path + import openai + + speech_file_path = Path(__file__).parent / "speech.mp3" + response = openai.audio.speech.create( + model="tts-1", + voice="alloy", + input="The quick brown fox jumped over the lazy dog." + ) + response.stream_to_file(speech_file_path) + node: | + import fs from "fs"; + import path from "path"; + import OpenAI from "openai"; + + const openai = new OpenAI(); + + const speechFile = path.resolve("./speech.mp3"); + + async function main() { + const mp3 = await openai.audio.speech.create({ + model: "tts-1", + voice: "alloy", + input: "Today is a wonderful day to build something people love!", + }); + console.log(speechFile); + const buffer = Buffer.from(await mp3.arrayBuffer()); + await fs.promises.writeFile(speechFile, buffer); + } + main(); + /audio/transcriptions: + post: + operationId: createTranscription + tags: + - Audio + summary: Transcribes audio into the input language. + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: "#/components/schemas/CreateTranscriptionRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/CreateTranscriptionResponse" + x-oaiMeta: + name: Create transcription + group: audio + returns: The transcribed text. + examples: + request: + curl: | + curl https://api.openai.com/v1/audio/transcriptions \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: multipart/form-data" \ + -F file="@/path/to/file/audio.mp3" \ + -F model="whisper-1" + python: | + from openai import OpenAI + client = OpenAI() + + audio_file = open("speech.mp3", "rb") + transcript = client.audio.transcriptions.create( + model="whisper-1", + file=audio_file + ) + node: | + import fs from "fs"; + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const transcription = await openai.audio.transcriptions.create({ + file: fs.createReadStream("audio.mp3"), + model: "whisper-1", + }); + + console.log(transcription.text); + } + main(); + response: | + { + "text": "Imagine the wildest idea that you've ever had, and you're curious about how it might scale to something that's a 100, a 1,000 times bigger. This is a place where you can get to do that." + } + /audio/translations: + post: + operationId: createTranslation + tags: + - Audio + summary: Translates audio into English. + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: "#/components/schemas/CreateTranslationRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/CreateTranslationResponse" + x-oaiMeta: + name: Create translation + group: audio + returns: The translated text. + examples: + request: + curl: | + curl https://api.openai.com/v1/audio/translations \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: multipart/form-data" \ + -F file="@/path/to/file/german.m4a" \ + -F model="whisper-1" + python: | + from openai import OpenAI + client = OpenAI() + + audio_file = open("speech.mp3", "rb") + transcript = client.audio.translations.create( + model="whisper-1", + file=audio_file + ) + node: | + import fs from "fs"; + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const translation = await openai.audio.translations.create({ + file: fs.createReadStream("speech.mp3"), + model: "whisper-1", + }); + + console.log(translation.text); + } + main(); + response: | + { + "text": "Hello, my name is Wolfgang and I come from Germany. Where are you heading today?" + } + + /files: + get: + operationId: listFiles + tags: + - Files + summary: Returns a list of files that belong to the user's organization. + parameters: + - in: query + name: purpose + required: false + schema: + type: string + description: Only return files with the given purpose. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ListFilesResponse" + x-oaiMeta: + name: List files + group: files + returns: A list of [File](/docs/api-reference/files/object) objects. + examples: + request: + curl: | + curl https://api.openai.com/v1/files \ + -H "Authorization: Bearer $OPENAI_API_KEY" + python: | + from openai import OpenAI + client = OpenAI() + + client.files.list() + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const list = await openai.files.list(); + + for await (const file of list) { + console.log(file); + } + } + + main(); + response: | + { + "data": [ + { + "id": "file-abc123", + "object": "file", + "bytes": 175, + "created_at": 1613677385, + "filename": "salesOverview.pdf", + "purpose": "assistants", + }, + { + "id": "file-abc123", + "object": "file", + "bytes": 140, + "created_at": 1613779121, + "filename": "puppy.jsonl", + "purpose": "fine-tune", + } + ], + "object": "list" + } + post: + operationId: createFile + tags: + - Files + summary: | + Upload a file that can be used across various endpoints. The size of all the files uploaded by one organization can be up to 100 GB. + + The size of individual files can be a maximum of 512 MB or 2 million tokens for Assistants. See the [Assistants Tools guide](/docs/assistants/tools) to learn more about the types of files supported. The Fine-tuning API only supports `.jsonl` files. + + Please [contact us](https://help.openai.com/) if you need to increase these storage limits. + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: "#/components/schemas/CreateFileRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/OpenAIFile" + x-oaiMeta: + name: Upload file + group: files + returns: The uploaded [File](/docs/api-reference/files/object) object. + examples: + request: + curl: | + curl https://api.openai.com/v1/files \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -F purpose="fine-tune" \ + -F file="@mydata.jsonl" + python: | + from openai import OpenAI + client = OpenAI() + + client.files.create( + file=open("mydata.jsonl", "rb"), + purpose="fine-tune" + ) + node.js: |- + import fs from "fs"; + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const file = await openai.files.create({ + file: fs.createReadStream("mydata.jsonl"), + purpose: "fine-tune", + }); + + console.log(file); + } + + main(); + response: | + { + "id": "file-abc123", + "object": "file", + "bytes": 120000, + "created_at": 1677610602, + "filename": "mydata.jsonl", + "purpose": "fine-tune", + } + /files/{file_id}: + delete: + operationId: deleteFile + tags: + - Files + summary: Delete a file. + parameters: + - in: path + name: file_id + required: true + schema: + type: string + description: The ID of the file to use for this request. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/DeleteFileResponse" + x-oaiMeta: + name: Delete file + group: files + returns: Deletion status. + examples: + request: + curl: | + curl https://api.openai.com/v1/files/file-abc123 \ + -X DELETE \ + -H "Authorization: Bearer $OPENAI_API_KEY" + python: | + from openai import OpenAI + client = OpenAI() + + client.files.delete("file-abc123") + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const file = await openai.files.del("file-abc123"); + + console.log(file); + } + + main(); + response: | + { + "id": "file-abc123", + "object": "file", + "deleted": true + } + get: + operationId: retrieveFile + tags: + - Files + summary: Returns information about a specific file. + parameters: + - in: path + name: file_id + required: true + schema: + type: string + description: The ID of the file to use for this request. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/OpenAIFile" + x-oaiMeta: + name: Retrieve file + group: files + returns: The [File](/docs/api-reference/files/object) object matching the specified ID. + examples: + request: + curl: | + curl https://api.openai.com/v1/files/file-abc123 \ + -H "Authorization: Bearer $OPENAI_API_KEY" + python: | + from openai import OpenAI + client = OpenAI() + + client.files.retrieve("file-abc123") + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const file = await openai.files.retrieve("file-abc123"); + + console.log(file); + } + + main(); + response: | + { + "id": "file-abc123", + "object": "file", + "bytes": 120000, + "created_at": 1677610602, + "filename": "mydata.jsonl", + "purpose": "fine-tune", + } + /files/{file_id}/content: + get: + operationId: downloadFile + tags: + - Files + summary: Returns the contents of the specified file. + parameters: + - in: path + name: file_id + required: true + schema: + type: string + description: The ID of the file to use for this request. + responses: + "200": + description: OK + content: + application/json: + schema: + type: string + x-oaiMeta: + name: Retrieve file content + group: files + returns: The file content. + examples: + request: + curl: | + curl https://api.openai.com/v1/files/file-abc123/content \ + -H "Authorization: Bearer $OPENAI_API_KEY" > file.jsonl + python: | + from openai import OpenAI + client = OpenAI() + + content = client.files.retrieve_content("file-abc123") + node.js: | + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const file = await openai.files.retrieveContent("file-abc123"); + + console.log(file); + } + + main(); + + /fine_tuning/jobs: + post: + operationId: createFineTuningJob + tags: + - Fine-tuning + summary: | + Creates a job that fine-tunes a specified model from a given dataset. + + Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. + + [Learn more about fine-tuning](/docs/guides/fine-tuning) + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateFineTuningJobRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/FineTuningJob" + x-oaiMeta: + name: Create fine-tuning job + group: fine-tuning + returns: A [fine-tuning.job](/docs/api-reference/fine-tuning/object) object. + examples: + - title: Default + request: + curl: | + curl https://api.openai.com/v1/fine_tuning/jobs \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "training_file": "file-BK7bzQj3FfZFXr7DbL6xJwfo", + "model": "gpt-3.5-turbo" + }' + python: | + from openai import OpenAI + client = OpenAI() + + client.fine_tuning.jobs.create( + training_file="file-abc123", + model="gpt-3.5-turbo" + ) + node.js: | + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const fineTune = await openai.fineTuning.jobs.create({ + training_file: "file-abc123" + }); + + console.log(fineTune); + } + + main(); + response: | + { + "object": "fine_tuning.job", + "id": "ftjob-abc123", + "model": "gpt-3.5-turbo-0613", + "created_at": 1614807352, + "fine_tuned_model": null, + "organization_id": "org-123", + "result_files": [], + "status": "queued", + "validation_file": null, + "training_file": "file-abc123", + } + - title: Epochs + request: + curl: | + curl https://api.openai.com/v1/fine_tuning/jobs \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "training_file": "file-abc123", + "model": "gpt-3.5-turbo", + "hyperparameters": { + "n_epochs": 2 + } + }' + python: | + from openai import OpenAI + client = OpenAI() + + client.fine_tuning.jobs.create( + training_file="file-abc123", + model="gpt-3.5-turbo", + hyperparameters={ + "n_epochs":2 + } + ) + node.js: | + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const fineTune = await openai.fineTuning.jobs.create({ + training_file: "file-abc123", + model: "gpt-3.5-turbo", + hyperparameters: { n_epochs: 2 } + }); + + console.log(fineTune); + } + + main(); + response: | + { + "object": "fine_tuning.job", + "id": "ftjob-abc123", + "model": "gpt-3.5-turbo-0613", + "created_at": 1614807352, + "fine_tuned_model": null, + "organization_id": "org-123", + "result_files": [], + "status": "queued", + "validation_file": null, + "training_file": "file-abc123", + "hyperparameters": {"n_epochs": 2}, + } + - title: Validation file + request: + curl: | + curl https://api.openai.com/v1/fine_tuning/jobs \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "training_file": "file-abc123", + "validation_file": "file-abc123", + "model": "gpt-3.5-turbo" + }' + python: | + from openai import OpenAI + client = OpenAI() + + client.fine_tuning.jobs.create( + training_file="file-abc123", + validation_file="file-def456", + model="gpt-3.5-turbo" + ) + node.js: | + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const fineTune = await openai.fineTuning.jobs.create({ + training_file: "file-abc123", + validation_file: "file-abc123" + }); + + console.log(fineTune); + } + + main(); + response: | + { + "object": "fine_tuning.job", + "id": "ftjob-abc123", + "model": "gpt-3.5-turbo-0613", + "created_at": 1614807352, + "fine_tuned_model": null, + "organization_id": "org-123", + "result_files": [], + "status": "queued", + "validation_file": "file-abc123", + "training_file": "file-abc123", + } + get: + operationId: listPaginatedFineTuningJobs + tags: + - Fine-tuning + summary: | + List your organization's fine-tuning jobs + parameters: + - name: after + in: query + description: Identifier for the last job from the previous pagination request. + required: false + schema: + type: string + - name: limit + in: query + description: Number of fine-tuning jobs to retrieve. + required: false + schema: + type: integer + default: 20 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ListPaginatedFineTuningJobsResponse" + x-oaiMeta: + name: List fine-tuning jobs + group: fine-tuning + returns: A list of paginated [fine-tuning job](/docs/api-reference/fine-tuning/object) objects. + examples: + request: + curl: | + curl https://api.openai.com/v1/fine_tuning/jobs?limit=2 \ + -H "Authorization: Bearer $OPENAI_API_KEY" + python: | + from openai import OpenAI + client = OpenAI() + + client.fine_tuning.jobs.list() + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const list = await openai.fineTuning.jobs.list(); + + for await (const fineTune of list) { + console.log(fineTune); + } + } + + main(); + response: | + { + "object": "list", + "data": [ + { + "object": "fine_tuning.job.event", + "id": "ft-event-TjX0lMfOniCZX64t9PUQT5hn", + "created_at": 1689813489, + "level": "warn", + "message": "Fine tuning process stopping due to job cancellation", + "data": null, + "type": "message" + }, + { ... }, + { ... } + ], "has_more": true + } + /fine_tuning/jobs/{fine_tuning_job_id}: + get: + operationId: retrieveFineTuningJob + tags: + - Fine-tuning + summary: | + Get info about a fine-tuning job. + + [Learn more about fine-tuning](/docs/guides/fine-tuning) + parameters: + - in: path + name: fine_tuning_job_id + required: true + schema: + type: string + example: ft-AF1WoRqd3aJAHsqc9NY7iL8F + description: | + The ID of the fine-tuning job. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/FineTuningJob" + x-oaiMeta: + name: Retrieve fine-tuning job + group: fine-tuning + returns: The [fine-tuning](/docs/api-reference/fine-tunes/object) object with the given ID. + examples: + request: + curl: | + curl https://api.openai.com/v1/fine_tuning/jobs/ft-AF1WoRqd3aJAHsqc9NY7iL8F \ + -H "Authorization: Bearer $OPENAI_API_KEY" + python: | + from openai import OpenAI + client = OpenAI() + + client.fine_tuning.jobs.retrieve("ftjob-abc123") + node.js: | + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const fineTune = await openai.fineTuning.jobs.retrieve("ftjob-abc123"); + + console.log(fineTune); + } + + main(); + response: &fine_tuning_example | + { + "object": "fine_tuning.job", + "id": "ftjob-abc123", + "model": "davinci-002", + "created_at": 1692661014, + "finished_at": 1692661190, + "fine_tuned_model": "ft:davinci-002:my-org:custom_suffix:7q8mpxmy", + "organization_id": "org-123", + "result_files": [ + "file-abc123" + ], + "status": "succeeded", + "validation_file": null, + "training_file": "file-abc123", + "hyperparameters": { + "n_epochs": 4, + }, + "trained_tokens": 5768 + } + /fine_tuning/jobs/{fine_tuning_job_id}/events: + get: + operationId: listFineTuningEvents + tags: + - Fine-tuning + summary: | + Get status updates for a fine-tuning job. + parameters: + - in: path + name: fine_tuning_job_id + required: true + schema: + type: string + example: ft-AF1WoRqd3aJAHsqc9NY7iL8F + description: | + The ID of the fine-tuning job to get events for. + - name: after + in: query + description: Identifier for the last event from the previous pagination request. + required: false + schema: + type: string + - name: limit + in: query + description: Number of events to retrieve. + required: false + schema: + type: integer + default: 20 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ListFineTuningJobEventsResponse" + x-oaiMeta: + name: List fine-tuning events + group: fine-tuning + returns: A list of fine-tuning event objects. + examples: + request: + curl: | + curl https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/events \ + -H "Authorization: Bearer $OPENAI_API_KEY" + python: | + from openai import OpenAI + client = OpenAI() + + client.fine_tuning.jobs.list_events( + fine_tuning_job_id="ftjob-abc123", + limit=2 + ) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const list = await openai.fineTuning.list_events(id="ftjob-abc123", limit=2); + + for await (const fineTune of list) { + console.log(fineTune); + } + } + + main(); + response: | + { + "object": "list", + "data": [ + { + "object": "fine_tuning.job.event", + "id": "ft-event-ddTJfwuMVpfLXseO0Am0Gqjm", + "created_at": 1692407401, + "level": "info", + "message": "Fine tuning job successfully completed", + "data": null, + "type": "message" + }, + { + "object": "fine_tuning.job.event", + "id": "ft-event-tyiGuB72evQncpH87xe505Sv", + "created_at": 1692407400, + "level": "info", + "message": "New fine-tuned model created: ft:gpt-3.5-turbo:openai::7p4lURel", + "data": null, + "type": "message" + } + ], + "has_more": true + } + /fine_tuning/jobs/{fine_tuning_job_id}/cancel: + post: + operationId: cancelFineTuningJob + tags: + - Fine-tuning + summary: | + Immediately cancel a fine-tune job. + parameters: + - in: path + name: fine_tuning_job_id + required: true + schema: + type: string + example: ft-AF1WoRqd3aJAHsqc9NY7iL8F + description: | + The ID of the fine-tuning job to cancel. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/FineTuningJob" + x-oaiMeta: + name: Cancel fine-tuning + group: fine-tuning + returns: The cancelled [fine-tuning](/docs/api-reference/fine-tuning/object) object. + examples: + request: + curl: | + curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/cancel \ + -H "Authorization: Bearer $OPENAI_API_KEY" + python: | + from openai import OpenAI + client = OpenAI() + + client.fine_tuning.jobs.cancel("ftjob-abc123") + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const fineTune = await openai.fineTuning.jobs.cancel("ftjob-abc123"); + + console.log(fineTune); + } + main(); + response: | + { + "object": "fine_tuning.job", + "id": "ftjob-abc123", + "model": "gpt-3.5-turbo-0613", + "created_at": 1689376978, + "fine_tuned_model": null, + "organization_id": "org-123", + "result_files": [], + "hyperparameters": { + "n_epochs": "auto" + }, + "status": "cancelled", + "validation_file": "file-abc123", + "training_file": "file-abc123" + } + + /fine-tunes: + post: + operationId: createFineTune + deprecated: true + tags: + - Fine-tunes + summary: | + Creates a job that fine-tunes a specified model from a given dataset. + + Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. + + [Learn more about fine-tuning](/docs/guides/legacy-fine-tuning) + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateFineTuneRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/FineTune" + x-oaiMeta: + name: Create fine-tune + group: fine-tunes + returns: A [fine-tune](/docs/api-reference/fine-tunes/object) object. + examples: + request: + curl: | + curl https://api.openai.com/v1/fine-tunes \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "training_file": "file-abc123" + }' + python: | + from openai import OpenAI + client = OpenAI() + + fine_tune = client.fine_tunes.create( + training_file="file-abc123", + model="davinci" + } + print(fine_tune) + node.js: | + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const fineTune = await openai.fineTunes.create({ + training_file: "file-abc123" + }); + + console.log(fineTune); + } + + main(); + response: | + { + "id": "ft-AF1WoRqd3aJAHsqc9NY7iL8F", + "object": "fine-tune", + "model": "curie", + "created_at": 1614807352, + "events": [ + { + "object": "fine-tune-event", + "created_at": 1614807352, + "level": "info", + "message": "Job enqueued. Waiting for jobs ahead to complete. Queue number: 0." + } + ], + "fine_tuned_model": null, + "hyperparams": { + "batch_size": 4, + "learning_rate_multiplier": 0.1, + "n_epochs": 4, + "prompt_loss_weight": 0.1, + }, + "organization_id": "org-123", + "result_files": [], + "status": "pending", + "validation_files": [], + "training_files": [ + { + "id": "file-abc123", + "object": "file", + "bytes": 1547276, + "created_at": 1610062281, + "filename": "my-data-train.jsonl", + "purpose": "fine-tune-results" + } + ], + "updated_at": 1614807352, + } + get: + operationId: listFineTunes + deprecated: true + tags: + - Fine-tunes + summary: | + List your organization's fine-tuning jobs + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ListFineTunesResponse" + x-oaiMeta: + name: List fine-tunes + group: fine-tunes + returns: A list of [fine-tune](/docs/api-reference/fine-tunes/object) objects. + examples: + request: + curl: | + curl https://api.openai.com/v1/fine-tunes \ + -H "Authorization: Bearer $OPENAI_API_KEY" + python: | + from openai import OpenAI + client = OpenAI() + + models = client.fine_tunes.list() + print(models) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const list = await openai.fineTunes.list(); + + for await (const fineTune of list) { + console.log(fineTune); + } + } + + main(); + response: | + { + "object": "list", + "data": [ + { + "id": "ft-AF1WoRqd3aJAHsqc9NY7iL8F", + "object": "fine-tune", + "model": "curie", + "created_at": 1614807352, + "fine_tuned_model": null, + "hyperparams": { ... }, + "organization_id": "org-123", + "result_files": [], + "status": "pending", + "validation_files": [], + "training_files": [ { ... } ], + "updated_at": 1614807352, + }, + { ... }, + { ... } + ] + } + /fine-tunes/{fine_tune_id}: + get: + operationId: retrieveFineTune + deprecated: true + tags: + - Fine-tunes + summary: | + Gets info about the fine-tune job. + + [Learn more about fine-tuning](/docs/guides/legacy-fine-tuning) + parameters: + - in: path + name: fine_tune_id + required: true + schema: + type: string + example: ft-AF1WoRqd3aJAHsqc9NY7iL8F + description: | + The ID of the fine-tune job + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/FineTune" + x-oaiMeta: + name: Retrieve fine-tune + group: fine-tunes + returns: The [fine-tune](/docs/api-reference/fine-tunes/object) object with the given ID. + examples: + request: + curl: | + curl https://api.openai.com/v1/fine-tunes/ft-abc123 \ + -H "Authorization: Bearer $OPENAI_API_KEY" + python: | + from openai import OpenAI + client = OpenAI() + + fine_tune = client.fine_tunes.retrieve("ft-abc123") + print(fine_tune) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const fineTune = await openai.fineTunes.retrieve("ft-abc123"); + + console.log(fineTune); + } + + main(); + response: &fine_tune_example | + { + "id": "ft-abc123", + "object": "fine-tune", + "model": "curie", + "created_at": 1614807352, + "events": [ + { + "object": "fine-tune-event", + "created_at": 1614807352, + "level": "info", + "message": "Job enqueued. Waiting for jobs ahead to complete. Queue number: 0." + }, + { + "object": "fine-tune-event", + "created_at": 1614807356, + "level": "info", + "message": "Job started." + }, + { + "object": "fine-tune-event", + "created_at": 1614807861, + "level": "info", + "message": "Uploaded snapshot: curie:ft-acmeco-2021-03-03-21-44-20." + }, + { + "object": "fine-tune-event", + "created_at": 1614807864, + "level": "info", + "message": "Uploaded result files: file-abc123." + }, + { + "object": "fine-tune-event", + "created_at": 1614807864, + "level": "info", + "message": "Job succeeded." + } + ], + "fine_tuned_model": "curie:ft-acmeco-2021-03-03-21-44-20", + "hyperparams": { + "batch_size": 4, + "learning_rate_multiplier": 0.1, + "n_epochs": 4, + "prompt_loss_weight": 0.1, + }, + "organization_id": "org-123", + "result_files": [ + { + "id": "file-abc123", + "object": "file", + "bytes": 81509, + "created_at": 1614807863, + "filename": "compiled_results.csv", + "purpose": "fine-tune-results" + } + ], + "status": "succeeded", + "validation_files": [], + "training_files": [ + { + "id": "file-abc123", + "object": "file", + "bytes": 1547276, + "created_at": 1610062281, + "filename": "my-data-train.jsonl", + "purpose": "fine-tune" + } + ], + "updated_at": 1614807865, + } + /fine-tunes/{fine_tune_id}/cancel: + post: + operationId: cancelFineTune + deprecated: true + tags: + - Fine-tunes + summary: | + Immediately cancel a fine-tune job. + parameters: + - in: path + name: fine_tune_id + required: true + schema: + type: string + example: ft-AF1WoRqd3aJAHsqc9NY7iL8F + description: | + The ID of the fine-tune job to cancel + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/FineTune" + x-oaiMeta: + name: Cancel fine-tune + group: fine-tunes + returns: The cancelled [fine-tune](/docs/api-reference/fine-tunes/object) object. + examples: + request: + curl: | + curl https://api.openai.com/v1/fine-tunes/ft-AF1WoRqd3aJAHsqc9NY7iL8F/cancel \ + -H "Authorization: Bearer $OPENAI_API_KEY" + python: | + from openai import OpenAI + client = OpenAI() + + fine_tune = client.fine_tunes.cancel("ft-abc123") + print(fine_tune) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const fineTune = await openai.fineTunes.cancel("ft-AF1WoRqd3aJAHsqc9NY7iL8F"); + + console.log(fineTune); + } + main(); + response: | + { + "id": "ft-xhrpBbvVUzYGo8oUO1FY4nI7", + "object": "fine-tune", + "model": "curie", + "created_at": 1614807770, + "events": [ { ... } ], + "fine_tuned_model": null, + "hyperparams": { ... }, + "organization_id": "org-123", + "result_files": [], + "status": "cancelled", + "validation_files": [], + "training_files": [ + { + "id": "file-abc123", + "object": "file", + "bytes": 1547276, + "created_at": 1610062281, + "filename": "my-data-train.jsonl", + "purpose": "fine-tune" + } + ], + "updated_at": 1614807789, + } + /fine-tunes/{fine_tune_id}/events: + get: + operationId: listFineTuneEvents + deprecated: true + tags: + - Fine-tunes + summary: | + Get fine-grained status updates for a fine-tune job. + parameters: + - in: path + name: fine_tune_id + required: true + schema: + type: string + example: ft-AF1WoRqd3aJAHsqc9NY7iL8F + description: | + The ID of the fine-tune job to get events for. + - in: query + name: stream + required: false + schema: + type: boolean + default: false + description: | + Whether to stream events for the fine-tune job. If set to true, + events will be sent as data-only + [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) + as they become available. The stream will terminate with a + `data: [DONE]` message when the job is finished (succeeded, cancelled, + or failed). + + If set to false, only events generated so far will be returned. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ListFineTuneEventsResponse" + x-oaiMeta: + name: List fine-tune events + group: fine-tunes + returns: A list of fine-tune event objects. + examples: + request: + curl: | + curl https://api.openai.com/v1/fine-tunes/ft-AF1WoRqd3aJAHsqc9NY7iL8F/events \ + -H "Authorization: Bearer $OPENAI_API_KEY" + python: | + from openai import OpenAI + client = OpenAI() + + fine_tune = client.fine_tunes.list_events("ft-abc123") + print(fine_tune) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const fineTune = await openai.fineTunes.listEvents("ft-AF1WoRqd3aJAHsqc9NY7iL8F"); + + console.log(fineTune); + } + main(); + response: | + { + "object": "list", + "data": [ + { + "object": "fine-tune-event", + "created_at": 1614807352, + "level": "info", + "message": "Job enqueued. Waiting for jobs ahead to complete. Queue number: 0." + }, + { + "object": "fine-tune-event", + "created_at": 1614807356, + "level": "info", + "message": "Job started." + }, + { + "object": "fine-tune-event", + "created_at": 1614807861, + "level": "info", + "message": "Uploaded snapshot: curie:ft-acmeco-2021-03-03-21-44-20." + }, + { + "object": "fine-tune-event", + "created_at": 1614807864, + "level": "info", + "message": "Uploaded result files: file-abc123" + }, + { + "object": "fine-tune-event", + "created_at": 1614807864, + "level": "info", + "message": "Job succeeded." + } + ] + } + + /models: + get: + operationId: listModels + tags: + - Models + summary: Lists the currently available models, and provides basic information about each one such as the owner and availability. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ListModelsResponse" + x-oaiMeta: + name: List models + group: models + returns: A list of [model](/docs/api-reference/models/object) objects. + examples: + request: + curl: | + curl https://api.openai.com/v1/models \ + -H "Authorization: Bearer $OPENAI_API_KEY" + python: | + from openai import OpenAI + client = OpenAI() + + client.models.list() + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const list = await openai.models.list(); + + for await (const model of list) { + console.log(model); + } + } + main(); + response: | + { + "object": "list", + "data": [ + { + "id": "model-id-0", + "object": "model", + "created": 1686935002, + "owned_by": "organization-owner" + }, + { + "id": "model-id-1", + "object": "model", + "created": 1686935002, + "owned_by": "organization-owner", + }, + { + "id": "model-id-2", + "object": "model", + "created": 1686935002, + "owned_by": "openai" + }, + ], + "object": "list" + } + /models/{model}: + get: + operationId: retrieveModel + tags: + - Models + summary: Retrieves a model instance, providing basic information about the model such as the owner and permissioning. + parameters: + - in: path + name: model + required: true + schema: + type: string + # ideally this will be an actual ID, so this will always work from browser + example: gpt-3.5-turbo + description: The ID of the model to use for this request + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/Model" + x-oaiMeta: + name: Retrieve model + group: models + returns: The [model](/docs/api-reference/models/object) object matching the specified ID. + examples: + request: + curl: | + curl https://api.openai.com/v1/models/VAR_model_id \ + -H "Authorization: Bearer $OPENAI_API_KEY" + python: | + from openai import OpenAI + client = OpenAI() + + client.models.retrieve("VAR_model_id") + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const model = await openai.models.retrieve("gpt-3.5-turbo"); + + console.log(model); + } + + main(); + response: &retrieve_model_response | + { + "id": "VAR_model_id", + "object": "model", + "created": 1686935002, + "owned_by": "openai" + } + delete: + operationId: deleteModel + tags: + - Models + summary: Delete a fine-tuned model. You must have the Owner role in your organization to delete a model. + parameters: + - in: path + name: model + required: true + schema: + type: string + example: ft:gpt-3.5-turbo:acemeco:suffix:abc123 + description: The model to delete + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/DeleteModelResponse" + x-oaiMeta: + name: Delete a fine-tuned model + group: models + returns: Deletion status. + examples: + request: + curl: | + curl https://api.openai.com/v1/models/ft:gpt-3.5-turbo:acemeco:suffix:abc123 \ + -X DELETE \ + -H "Authorization: Bearer $OPENAI_API_KEY" + python: | + from openai import OpenAI + client = OpenAI() + + client.models.delete("ft:gpt-3.5-turbo:acemeco:suffix:abc123") + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const model = await openai.models.del("ft:gpt-3.5-turbo:acemeco:suffix:abc123"); + + console.log(model); + } + main(); + response: | + { + "id": "ft:gpt-3.5-turbo:acemeco:suffix:abc123", + "object": "model", + "deleted": true + } + + /moderations: + post: + operationId: createModeration + tags: + - Moderations + summary: Classifies if text violates OpenAI's Content Policy + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateModerationRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/CreateModerationResponse" + x-oaiMeta: + name: Create moderation + group: moderations + returns: A [moderation](/docs/api-reference/moderations/object) object. + examples: + request: + curl: | + curl https://api.openai.com/v1/moderations \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "input": "I want to kill them." + }' + python: | + from openai import OpenAI + client = OpenAI() + + client.moderations.create(input="I want to kill them.") + node.js: | + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const moderation = await openai.moderations.create({ input: "I want to kill them." }); + + console.log(moderation); + } + main(); + response: &moderation_example | + { + "id": "modr-XXXXX", + "model": "text-moderation-005", + "results": [ + { + "flagged": true, + "categories": { + "sexual": false, + "hate": false, + "harassment": false, + "self-harm": false, + "sexual/minors": false, + "hate/threatening": false, + "violence/graphic": false, + "self-harm/intent": false, + "self-harm/instructions": false, + "harassment/threatening": true, + "violence": true, + }, + "category_scores": { + "sexual": 1.2282071e-06, + "hate": 0.010696256, + "harassment": 0.29842457, + "self-harm": 1.5236925e-08, + "sexual/minors": 5.7246268e-08, + "hate/threatening": 0.0060676364, + "violence/graphic": 4.435014e-06, + "self-harm/intent": 8.098441e-10, + "self-harm/instructions": 2.8498655e-11, + "harassment/threatening": 0.63055265, + "violence": 0.99011886, + } + } + ] + } + + /assistants: + get: + operationId: listAssistants + tags: + - Assistants + summary: Returns a list of assistants. + parameters: + - name: limit + in: query + description: &pagination_limit_param_description | + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + required: false + schema: + type: integer + default: 20 + - name: order + in: query + description: &pagination_order_param_description | + Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + schema: + type: string + default: desc + enum: ["asc", "desc"] + - name: after + in: query + description: &pagination_after_param_description | + A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + schema: + type: string + - name: before + in: query + description: &pagination_before_param_description | + A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ListAssistantsResponse" + x-oaiMeta: + name: List assistants + group: assistants + beta: true + returns: A list of [assistant](/docs/api-reference/assistants/object) objects. + examples: + request: + curl: | + curl "https://api.openai.com/v1/assistants?order=desc&limit=20" \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "OpenAI-Beta: assistants=v1" + python: | + from openai import OpenAI + client = OpenAI() + + my_assistants = client.beta.assistants.list( + order="desc", + limit="20", + ) + print(my_assistants.data) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const myAssistants = await openai.beta.assistants.list({ + order: "desc", + limit: "20", + }); + + console.log(myAssistants.data); + } + + main(); + response: &list_assistants_example | + { + "object": "list", + "data": [ + { + "id": "asst_abc123", + "object": "assistant", + "created_at": 1698982736, + "name": "Coding Tutor", + "description": null, + "model": "gpt-4", + "instructions": "You are a helpful assistant designed to make me better at coding!", + "tools": [], + "file_ids": [], + "metadata": {} + }, + { + "id": "asst_abc456", + "object": "assistant", + "created_at": 1698982718, + "name": "My Assistant", + "description": null, + "model": "gpt-4", + "instructions": "You are a helpful assistant designed to make me better at coding!", + "tools": [], + "file_ids": [], + "metadata": {} + }, + { + "id": "asst_abc789", + "object": "assistant", + "created_at": 1698982643, + "name": null, + "description": null, + "model": "gpt-4", + "instructions": null, + "tools": [], + "file_ids": [], + "metadata": {} + } + ], + "first_id": "asst_abc123", + "last_id": "asst_abc789", + "has_more": false + } + post: + operationId: createAssistant + tags: + - Assistants + summary: Create an assistant with a model and instructions. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateAssistantRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/AssistantObject" + x-oaiMeta: + name: Create assistant + group: assistants + beta: true + returns: An [assistant](/docs/api-reference/assistants/object) object. + examples: + - title: Code Interpreter + request: + curl: | + curl "https://api.openai.com/v1/assistants" \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "OpenAI-Beta: assistants=v1" \ + -d '{ + "instructions": "You are a personal math tutor. When asked a question, write and run Python code to answer the question.", + "name": "Math Tutor", + "tools": [{"type": "code_interpreter"}], + "model": "gpt-4" + }' + + python: | + from openai import OpenAI + client = OpenAI() + + my_assistant = client.beta.assistants.create( + instructions="You are a personal math tutor. When asked a question, write and run Python code to answer the question.", + name="Math Tutor", + tools=[{"type": "code_interpreter"}], + model="gpt-4", + ) + print(my_assistant) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const myAssistant = await openai.beta.assistants.create({ + instructions: + "You are a personal math tutor. When asked a question, write and run Python code to answer the question.", + name: "Math Tutor", + tools: [{ type: "code_interpreter" }], + model: "gpt-4", + }); + + console.log(myAssistant); + } + + main(); + response: &create_assistants_example | + { + "id": "asst_abc123", + "object": "assistant", + "created_at": 1698984975, + "name": "Math Tutor", + "description": null, + "model": "gpt-4", + "instructions": "You are a personal math tutor. When asked a question, write and run Python code to answer the question.", + "tools": [ + { + "type": "code_interpreter" + } + ], + "file_ids": [], + "metadata": {} + } + - title: Files + request: + curl: | + curl https://api.openai.com/v1/assistants \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "OpenAI-Beta: assistants=v1" \ + -d '{ + "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies.", + "tools": [{"type": "retrieval"}], + "model": "gpt-4", + "file_ids": ["file-abc123"] + }' + python: | + from openai import OpenAI + client = OpenAI() + + my_assistant = client.beta.assistants.create( + instructions="You are an HR bot, and you have access to files to answer employee questions about company policies.", + name="HR Helper", + tools=[{"type": "retrieval"}], + model="gpt-4", + file_ids=["file-abc123"], + ) + print(my_assistant) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const myAssistant = await openai.beta.assistants.create({ + instructions: + "You are an HR bot, and you have access to files to answer employee questions about company policies.", + name: "HR Helper", + tools: [{ type: "retrieval" }], + model: "gpt-4", + file_ids: ["file-abc123"], + }); + + console.log(myAssistant); + } + + main(); + response: | + { + "id": "asst_abc123", + "object": "assistant", + "created_at": 1699009403, + "name": "HR Helper", + "description": null, + "model": "gpt-4", + "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies.", + "tools": [ + { + "type": "retrieval" + } + ], + "file_ids": [ + "file-abc123" + ], + "metadata": {} + } + + /assistants/{assistant_id}: + get: + operationId: getAssistant + tags: + - Assistants + summary: Retrieves an assistant. + parameters: + - in: path + name: assistant_id + required: true + schema: + type: string + description: The ID of the assistant to retrieve. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/AssistantObject" + x-oaiMeta: + name: Retrieve assistant + group: assistants + beta: true + returns: The [assistant](/docs/api-reference/assistants/object) object matching the specified ID. + examples: + request: + curl: | + curl https://api.openai.com/v1/assistants/asst_abc123 \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "OpenAI-Beta: assistants=v1" + python: | + from openai import OpenAI + client = OpenAI() + + my_assistant = client.beta.assistants.retrieve("asst_abc123") + print(my_assistant) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const myAssistant = await openai.beta.assistants.retrieve( + "asst_abc123" + ); + + console.log(myAssistant); + } + + main(); + response: | + { + "id": "asst_abc123", + "object": "assistant", + "created_at": 1699009709, + "name": "HR Helper", + "description": null, + "model": "gpt-4", + "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies.", + "tools": [ + { + "type": "retrieval" + } + ], + "file_ids": [ + "file-abc123" + ], + "metadata": {} + } + post: + operationId: modifyAssistant + tags: + - Assistants + summary: Modifies an assistant. + parameters: + - in: path + name: assistant_id + required: true + schema: + type: string + description: The ID of the assistant to modify. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/ModifyAssistantRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/AssistantObject" + x-oaiMeta: + name: Modify assistant + group: assistants + beta: true + returns: The modified [assistant](/docs/api-reference/assistants/object) object. + examples: + request: + curl: | + curl https://api.openai.com/v1/assistants/asst_abc123 \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "OpenAI-Beta: assistants=v1" \ + -d '{ + "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.", + "tools": [{"type": "retrieval"}], + "model": "gpt-4", + "file_ids": ["file-abc123", "file-abc456"] + }' + python: | + from openai import OpenAI + client = OpenAI() + + my_updated_assistant = client.beta.assistants.update( + "asst_abc123", + instructions="You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.", + name="HR Helper", + tools=[{"type": "retrieval"}], + model="gpt-4", + file_ids=["file-abc123", "file-abc456"], + ) + + print(my_updated_assistant) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const myUpdatedAssistant = await openai.beta.assistants.update( + "asst_abc123", + { + instructions: + "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.", + name: "HR Helper", + tools: [{ type: "retrieval" }], + model: "gpt-4", + file_ids: [ + "file-abc123", + "file-abc456", + ], + } + ); + + console.log(myUpdatedAssistant); + } + + main(); + response: | + { + "id": "asst_abc123", + "object": "assistant", + "created_at": 1699009709, + "name": "HR Helper", + "description": null, + "model": "gpt-4", + "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.", + "tools": [ + { + "type": "retrieval" + } + ], + "file_ids": [ + "file-abc123", + "file-abc456" + ], + "metadata": {} + } + delete: + operationId: deleteAssistant + tags: + - Assistants + summary: Delete an assistant. + parameters: + - in: path + name: assistant_id + required: true + schema: + type: string + description: The ID of the assistant to delete. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/DeleteAssistantResponse" + x-oaiMeta: + name: Delete assistant + group: assistants + beta: true + returns: Deletion status + examples: + request: + curl: | + curl https://api.openai.com/v1/assistants/asst_abc123 \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "OpenAI-Beta: assistants=v1" \ + -X DELETE + python: | + from openai import OpenAI + client = OpenAI() + + response = client.beta.assistants.delete("asst_abc123") + print(response) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const response = await openai.beta.assistants.del("asst_abc123"); + + console.log(response); + } + main(); + response: | + { + "id": "asst_abc123", + "object": "assistant.deleted", + "deleted": true + } + + /threads: + post: + operationId: createThread + tags: + - Assistants + summary: Create a thread. + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/CreateThreadRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ThreadObject" + x-oaiMeta: + name: Create thread + group: threads + beta: true + returns: A [thread](/docs/api-reference/threads) object. + examples: + - title: Empty + request: + curl: | + curl https://api.openai.com/v1/threads \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "OpenAI-Beta: assistants=v1" \ + -d '' + python: | + from openai import OpenAI + client = OpenAI() + + empty_thread = client.beta.threads.create() + print(empty_thread) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const emptyThread = await openai.beta.threads.create(); + + console.log(emptyThread); + } + + main(); + response: | + { + "id": "thread_abc123", + "object": "thread", + "created_at": 1699012949, + "metadata": {} + } + - title: Messages + request: + curl: | + curl https://api.openai.com/v1/threads \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "OpenAI-Beta: assistants=v1" \ + -d '{ + "messages": [{ + "role": "user", + "content": "Hello, what is AI?", + "file_ids": ["file-abc123"] + }, { + "role": "user", + "content": "How does AI work? Explain it in simple terms." + }] + }' + python: | + from openai import OpenAI + client = OpenAI() + + message_thread = client.beta.threads.create( + messages=[ + { + "role": "user", + "content": "Hello, what is AI?", + "file_ids": ["file-abc123"], + }, + { + "role": "user", + "content": "How does AI work? Explain it in simple terms." + }, + ] + ) + + print(message_thread) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const messageThread = await openai.beta.threads.create({ + messages: [ + { + role: "user", + content: "Hello, what is AI?", + file_ids: ["file-abc123"], + }, + { + role: "user", + content: "How does AI work? Explain it in simple terms.", + }, + ], + }); + + console.log(messageThread); + } + + main(); + response: | + { + id: 'thread_abc123', + object: 'thread', + created_at: 1699014083, + metadata: {} + } + + /threads/{thread_id}: + get: + operationId: getThread + tags: + - Assistants + summary: Retrieves a thread. + parameters: + - in: path + name: thread_id + required: true + schema: + type: string + description: The ID of the thread to retrieve. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ThreadObject" + x-oaiMeta: + name: Retrieve thread + group: threads + beta: true + returns: The [thread](/docs/api-reference/threads/object) object matching the specified ID. + examples: + request: + curl: | + curl https://api.openai.com/v1/threads/thread_abc123 \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "OpenAI-Beta: assistants=v1" + python: | + from openai import OpenAI + client = OpenAI() + + my_thread = client.beta.threads.retrieve("thread_abc123") + print(my_thread) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const myThread = await openai.beta.threads.retrieve( + "thread_abc123" + ); + + console.log(myThread); + } + + main(); + response: | + { + "id": "thread_abc123", + "object": "thread", + "created_at": 1699014083, + "metadata": {} + } + post: + operationId: modifyThread + tags: + - Assistants + summary: Modifies a thread. + parameters: + - in: path + name: thread_id + required: true + schema: + type: string + description: The ID of the thread to modify. Only the `metadata` can be modified. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/ModifyThreadRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ThreadObject" + x-oaiMeta: + name: Modify thread + group: threads + beta: true + returns: The modified [thread](/docs/api-reference/threads/object) object matching the specified ID. + examples: + request: + curl: | + curl https://api.openai.com/v1/threads/thread_abc123 \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "OpenAI-Beta: assistants=v1" \ + -d '{ + "metadata": { + "modified": "true", + "user": "abc123" + } + }' + python: | + from openai import OpenAI + client = OpenAI() + + my_updated_thread = client.beta.threads.update( + "thread_abc123", + metadata={ + "modified": "true", + "user": "abc123" + } + ) + print(my_updated_thread) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const updatedThread = await openai.beta.threads.update( + "thread_abc123", + { + metadata: { modified: "true", user: "abc123" }, + } + ); + + console.log(updatedThread); + } + + main(); + response: | + { + "id": "thread_abc123", + "object": "thread", + "created_at": 1699014083, + "metadata": { + "modified": "true", + "user": "abc123" + } + } + delete: + operationId: deleteThread + tags: + - Assistants + summary: Delete a thread. + parameters: + - in: path + name: thread_id + required: true + schema: + type: string + description: The ID of the thread to delete. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/DeleteThreadResponse" + x-oaiMeta: + name: Delete thread + group: threads + beta: true + returns: Deletion status + examples: + request: + curl: | + curl https://api.openai.com/v1/threads/thread_abc123 \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "OpenAI-Beta: assistants=v1" \ + -X DELETE + python: | + from openai import OpenAI + client = OpenAI() + + response = client.beta.threads.delete("thread_abc123") + print(response) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const response = await openai.beta.threads.del("thread_abc123"); + + console.log(response); + } + main(); + response: | + { + "id": "thread_abc123", + "object": "thread.deleted", + "deleted": true + } + + /threads/{thread_id}/messages: + get: + operationId: listMessages + tags: + - Assistants + summary: Returns a list of messages for a given thread. + parameters: + - in: path + name: thread_id + required: true + schema: + type: string + description: The ID of the [thread](/docs/api-reference/threads) the messages belong to. + - name: limit + in: query + description: *pagination_limit_param_description + required: false + schema: + type: integer + default: 20 + - name: order + in: query + description: *pagination_order_param_description + schema: + type: string + default: desc + enum: ["asc", "desc"] + - name: after + in: query + description: *pagination_after_param_description + schema: + type: string + - name: before + in: query + description: *pagination_before_param_description + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ListMessagesResponse" + x-oaiMeta: + name: List messages + group: threads + beta: true + returns: A list of [message](/docs/api-reference/messages) objects. + examples: + request: + curl: | + curl https://api.openai.com/v1/threads/thread_abc123/messages \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "OpenAI-Beta: assistants=v1" + python: | + from openai import OpenAI + client = OpenAI() + + thread_messages = client.beta.threads.messages.list("thread_abc123") + print(thread_messages.data) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const threadMessages = await openai.beta.threads.messages.list( + "thread_abc123" + ); + + console.log(threadMessages.data); + } + + main(); + response: | + { + "object": "list", + "data": [ + { + "id": "msg_abc123", + "object": "thread.message", + "created_at": 1699016383, + "thread_id": "thread_abc123", + "role": "user", + "content": [ + { + "type": "text", + "text": { + "value": "How does AI work? Explain it in simple terms.", + "annotations": [] + } + } + ], + "file_ids": [], + "assistant_id": null, + "run_id": null, + "metadata": {} + }, + { + "id": "msg_abc456", + "object": "thread.message", + "created_at": 1699016383, + "thread_id": "thread_abc123", + "role": "user", + "content": [ + { + "type": "text", + "text": { + "value": "Hello, what is AI?", + "annotations": [] + } + } + ], + "file_ids": [ + "file-abc123" + ], + "assistant_id": null, + "run_id": null, + "metadata": {} + } + ], + "first_id": "msg_abc123", + "last_id": "msg_abc456", + "has_more": false + } + post: + operationId: createMessage + tags: + - Assistants + summary: Create a message. + parameters: + - in: path + name: thread_id + required: true + schema: + type: string + description: The ID of the [thread](/docs/api-reference/threads) to create a message for. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateMessageRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/MessageObject" + x-oaiMeta: + name: Create message + group: threads + beta: true + returns: A [message](/docs/api-reference/messages/object) object. + examples: + request: + curl: | + curl https://api.openai.com/v1/threads/thread_abc123/messages \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "OpenAI-Beta: assistants=v1" \ + -d '{ + "role": "user", + "content": "How does AI work? Explain it in simple terms." + }' + python: | + from openai import OpenAI + client = OpenAI() + + thread_message = client.beta.threads.messages.create( + "thread_abc123", + role="user", + content="How does AI work? Explain it in simple terms.", + ) + print(thread_message) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const threadMessages = await openai.beta.threads.messages.create( + "thread_abc123", + { role: "user", content: "How does AI work? Explain it in simple terms." } + ); + + console.log(threadMessages); + } + + main(); + response: | + { + "id": "msg_abc123", + "object": "thread.message", + "created_at": 1699017614, + "thread_id": "thread_abc123", + "role": "user", + "content": [ + { + "type": "text", + "text": { + "value": "How does AI work? Explain it in simple terms.", + "annotations": [] + } + } + ], + "file_ids": [], + "assistant_id": null, + "run_id": null, + "metadata": {} + } + + /threads/{thread_id}/messages/{message_id}: + get: + operationId: getMessage + tags: + - Assistants + summary: Retrieve a message. + parameters: + - in: path + name: thread_id + required: true + schema: + type: string + description: The ID of the [thread](/docs/api-reference/threads) to which this message belongs. + - in: path + name: message_id + required: true + schema: + type: string + description: The ID of the message to retrieve. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/MessageObject" + x-oaiMeta: + name: Retrieve message + group: threads + beta: true + returns: The [message](/docs/api-reference/threads/messages/object) object matching the specified ID. + examples: + request: + curl: | + curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "OpenAI-Beta: assistants=v1" + python: | + from openai import OpenAI + client = OpenAI() + + message = client.beta.threads.messages.retrieve( + message_id="msg_abc123", + thread_id="thread_abc123", + ) + print(message) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const message = await openai.beta.threads.messages.retrieve( + "thread_abc123", + "msg_abc123" + ); + + console.log(message); + } + + main(); + response: | + { + "id": "msg_abc123", + "object": "thread.message", + "created_at": 1699017614, + "thread_id": "thread_abc123", + "role": "user", + "content": [ + { + "type": "text", + "text": { + "value": "How does AI work? Explain it in simple terms.", + "annotations": [] + } + } + ], + "file_ids": [], + "assistant_id": null, + "run_id": null, + "metadata": {} + } + post: + operationId: modifyMessage + tags: + - Assistants + summary: Modifies a message. + parameters: + - in: path + name: thread_id + required: true + schema: + type: string + description: The ID of the thread to which this message belongs. + - in: path + name: message_id + required: true + schema: + type: string + description: The ID of the message to modify. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/ModifyMessageRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/MessageObject" + x-oaiMeta: + name: Modify message + group: threads + beta: true + returns: The modified [message](/docs/api-reference/threads/messages/object) object. + examples: + request: + curl: | + curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "OpenAI-Beta: assistants=v1" \ + -d '{ + "metadata": { + "modified": "true", + "user": "abc123" + } + }' + python: | + from openai import OpenAI + client = OpenAI() + + message = client.beta.threads.messages.update( + message_id="msg_abc12", + thread_id="thread_abc123", + metadata={ + "modified": "true", + "user": "abc123", + }, + ) + print(message) + node.js: |- + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const message = await openai.beta.threads.messages.update( + "thread_abc123", + "msg_abc123", + { + metadata: { + modified: "true", + user: "abc123", + }, + } + }' + response: | + { + "id": "msg_abc123", + "object": "thread.message", + "created_at": 1699017614, + "thread_id": "thread_abc123", + "role": "user", + "content": [ + { + "type": "text", + "text": { + "value": "How does AI work? Explain it in simple terms.", + "annotations": [] + } + } + ], + "file_ids": [], + "assistant_id": null, + "run_id": null, + "metadata": { + "modified": "true", + "user": "abc123" + } + } + + /threads/runs: + post: + operationId: createThreadAndRun + tags: + - Assistants + summary: Create a thread and run it in one request. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateThreadAndRunRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/RunObject" + x-oaiMeta: + name: Create thread and run + group: threads + beta: true + returns: A [run](/docs/api-reference/runs/object) object. + examples: + request: + curl: | + curl https://api.openai.com/v1/threads/runs \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: application/json" \ + -H "OpenAI-Beta: assistants=v1" \ + -d '{ + "assistant_id": "asst_abc123", + "thread": { + "messages": [ + {"role": "user", "content": "Explain deep learning to a 5 year old."} + ] + } + }' + python: | + from openai import OpenAI + client = OpenAI() + + run = client.beta.threads.create_and_run( + assistant_id="asst_abc123", + thread={ + "messages": [ + {"role": "user", "content": "Explain deep learning to a 5 year old."} + ] + } + ) + node.js: | + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const run = await openai.beta.threads.createAndRun({ + assistant_id: "asst_abc123", + thread: { + messages: [ + { role: "user", content: "Explain deep learning to a 5 year old." }, + ], + }, + }); + + console.log(run); + } + + main(); + response: | + { + "id": "run_abc123", + "object": "thread.run", + "created_at": 1699076792, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "queued", + "started_at": null, + "expires_at": 1699077392, + "cancelled_at": null, + "failed_at": null, + "completed_at": null, + "last_error": null, + "model": "gpt-4", + "instructions": "You are a helpful assistant.", + "tools": [], + "file_ids": [], + "metadata": {} + } + + /threads/{thread_id}/runs: + get: + operationId: listRuns + tags: + - Assistants + summary: Returns a list of runs belonging to a thread. + parameters: + - name: thread_id + in: path + required: true + schema: + type: string + description: The ID of the thread the run belongs to. + - name: limit + in: query + description: *pagination_limit_param_description + required: false + schema: + type: integer + default: 20 + - name: order + in: query + description: *pagination_order_param_description + schema: + type: string + default: desc + enum: ["asc", "desc"] + - name: after + in: query + description: *pagination_after_param_description + schema: + type: string + - name: before + in: query + description: *pagination_before_param_description + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ListRunsResponse" + x-oaiMeta: + name: List runs + group: threads + beta: true + returns: A list of [run](/docs/api-reference/runs/object) objects. + examples: + request: + curl: | + curl https://api.openai.com/v1/threads/thread_abc123/runs \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: application/json" \ + -H "OpenAI-Beta: assistants=v1" + python: | + from openai import OpenAI + client = OpenAI() + + runs = client.beta.threads.runs.list( + "thread_abc123" + ) + print(runs) + node.js: | + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const runs = await openai.beta.threads.runs.list( + "thread_abc123" + ); + + console.log(runs); + } + + main(); + response: | + { + "object": "list", + "data": [ + { + "id": "run_abc123", + "object": "thread.run", + "created_at": 1699075072, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "completed", + "started_at": 1699075072, + "expires_at": null, + "cancelled_at": null, + "failed_at": null, + "completed_at": 1699075073, + "last_error": null, + "model": "gpt-3.5-turbo", + "instructions": null, + "tools": [ + { + "type": "code_interpreter" + } + ], + "file_ids": [ + "file-abc123", + "file-abc456" + ], + "metadata": {} + }, + { + "id": "run_abc456", + "object": "thread.run", + "created_at": 1699063290, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "completed", + "started_at": 1699063290, + "expires_at": null, + "cancelled_at": null, + "failed_at": null, + "completed_at": 1699063291, + "last_error": null, + "model": "gpt-3.5-turbo", + "instructions": null, + "tools": [ + { + "type": "code_interpreter" + } + ], + "file_ids": [ + "file-abc123", + "file-abc456" + ], + "metadata": {} + } + ], + "first_id": "run_abc123", + "last_id": "run_abc456", + "has_more": false + } + post: + operationId: createRun + tags: + - Assistants + summary: Create a run. + parameters: + - in: path + name: thread_id + required: true + schema: + type: string + description: The ID of the thread to run. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateRunRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/RunObject" + x-oaiMeta: + name: Create run + group: threads + beta: true + returns: A [run](/docs/api-reference/runs/object) object. + examples: + request: + curl: | + curl https://api.openai.com/v1/threads/thread_abc123/runs \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: application/json" \ + -H "OpenAI-Beta: assistants=v1" \ + -d '{ + "assistant_id": "asst_abc123" + }' + python: | + from openai import OpenAI + client = OpenAI() + + run = client.beta.threads.runs.create( + thread_id="thread_abc123", + assistant_id="asst_abc123" + ) + print(run) + node.js: | + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const run = await openai.beta.threads.runs.create( + "thread_abc123", + { assistant_id: "asst_abc123" } + ); + + console.log(run); + } + + main(); + response: &run_object_example | + { + "id": "run_abc123", + "object": "thread.run", + "created_at": 1699063290, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "queued", + "started_at": 1699063290, + "expires_at": null, + "cancelled_at": null, + "failed_at": null, + "completed_at": 1699063291, + "last_error": null, + "model": "gpt-4", + "instructions": null, + "tools": [ + { + "type": "code_interpreter" + } + ], + "file_ids": [ + "file-abc123", + "file-abc456" + ], + "metadata": {} + } + + /threads/{thread_id}/runs/{run_id}: + get: + operationId: getRun + tags: + - Assistants + summary: Retrieves a run. + parameters: + - in: path + name: thread_id + required: true + schema: + type: string + description: The ID of the [thread](/docs/api-reference/threads) that was run. + - in: path + name: run_id + required: true + schema: + type: string + description: The ID of the run to retrieve. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/RunObject" + x-oaiMeta: + name: Retrieve run + group: threads + beta: true + returns: The [run](/docs/api-reference/runs/object) object matching the specified ID. + examples: + request: + curl: | + curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "OpenAI-Beta: assistants=v1" + python: | + from openai import OpenAI + client = OpenAI() + + run = client.beta.threads.runs.retrieve( + thread_id="thread_abc123", + run_id="run_abc123" + ) + print(run) + node.js: | + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const run = await openai.beta.threads.runs.retrieve( + "thread_abc123", + "run_abc123" + ); + + console.log(run); + } + + main(); + response: | + { + "id": "run_abc123", + "object": "thread.run", + "created_at": 1699075072, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "completed", + "started_at": 1699075072, + "expires_at": null, + "cancelled_at": null, + "failed_at": null, + "completed_at": 1699075073, + "last_error": null, + "model": "gpt-3.5-turbo", + "instructions": null, + "tools": [ + { + "type": "code_interpreter" + } + ], + "file_ids": [ + "file-abc123", + "file-abc456" + ], + "metadata": {} + } + post: + operationId: modifyRun + tags: + - Assistants + summary: Modifies a run. + parameters: + - in: path + name: thread_id + required: true + schema: + type: string + description: The ID of the [thread](/docs/api-reference/threads) that was run. + - in: path + name: run_id + required: true + schema: + type: string + description: The ID of the run to modify. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/ModifyRunRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/RunObject" + x-oaiMeta: + name: Modify run + group: threads + beta: true + returns: The modified [run](/docs/api-reference/runs/object) object matching the specified ID. + examples: + request: + curl: | + curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: application/json" \ + -H "OpenAI-Beta: assistants=v1" \ + -d '{ + "metadata": { + "user_id": "user_abc123" + } + }' + python: | + from openai import OpenAI + client = OpenAI() + + run = client.beta.threads.runs.update( + thread_id="thread_abc123", + run_id="run_abc123", + metadata={"user_id": "user_abc123"}, + ) + print(run) + node.js: | + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const run = await openai.beta.threads.runs.update( + "thread_abc123", + "run_abc123", + { + metadata: { + user_id: "user_abc123", + }, + } + ); + + console.log(run); + } + + main(); + response: | + { + "id": "run_abc123", + "object": "thread.run", + "created_at": 1699075072, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "completed", + "started_at": 1699075072, + "expires_at": null, + "cancelled_at": null, + "failed_at": null, + "completed_at": 1699075073, + "last_error": null, + "model": "gpt-3.5-turbo", + "instructions": null, + "tools": [ + { + "type": "code_interpreter" + } + ], + "file_ids": [ + "file-abc123", + "file-abc456" + ], + "metadata": { + "user_id": "user_abc123" + } + } + + /threads/{thread_id}/runs/{run_id}/submit_tool_outputs: + post: + operationId: submitToolOuputsToRun + tags: + - Assistants + summary: | + When a run has the `status: "requires_action"` and `required_action.type` is `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request. + parameters: + - in: path + name: thread_id + required: true + schema: + type: string + description: The ID of the [thread](/docs/api-reference/threads) to which this run belongs. + - in: path + name: run_id + required: true + schema: + type: string + description: The ID of the run that requires the tool output submission. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/SubmitToolOutputsRunRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/RunObject" + x-oaiMeta: + name: Submit tool outputs to run + group: threads + beta: true + returns: The modified [run](/docs/api-reference/runs/object) object matching the specified ID. + examples: + request: + curl: | + curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/submit_tool_outputs \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: application/json" \ + -H "OpenAI-Beta: assistants=v1" \ + -d '{ + "tool_outputs": [ + { + "tool_call_id": "call_abc123", + "output": "28C" + } + ] + }' + python: | + from openai import OpenAI + client = OpenAI() + + run = client.beta.threads.runs.submit_tool_outputs( + thread_id="thread_abc123", + run_id="run_abc123", + tool_outputs=[ + { + "tool_call_id": "call_abc123", + "output": "28C" + } + ] + ) + print(run) + node.js: | + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const run = await openai.beta.threads.runs.submitToolOutputs( + "thread_abc123", + "run_abc123", + { + tool_outputs: [ + { + tool_call_id: "call_abc123", + output: "28C", + }, + ], + } + ); + + console.log(run); + } + + main(); + response: | + { + "id": "run_abc123", + "object": "thread.run", + "created_at": 1699075592, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "queued", + "started_at": 1699075592, + "expires_at": 1699076192, + "cancelled_at": null, + "failed_at": null, + "completed_at": null, + "last_error": null, + "model": "gpt-4", + "instructions": "You tell the weather.", + "tools": [ + { + "type": "function", + "function": { + "name": "get_weather", + "description": "Determine weather in my location", + "parameters": { + "type": "object", + "properties": { + "location": { + "type": "string", + "description": "The city and state e.g. San Francisco, CA" + }, + "unit": { + "type": "string", + "enum": [ + "c", + "f" + ] + } + }, + "required": [ + "location" + ] + } + } + } + ], + "file_ids": [], + "metadata": {} + } + + /threads/{thread_id}/runs/{run_id}/cancel: + post: + operationId: cancelRun + tags: + - Assistants + summary: Cancels a run that is `in_progress`. + parameters: + - in: path + name: thread_id + required: true + schema: + type: string + description: The ID of the thread to which this run belongs. + - in: path + name: run_id + required: true + schema: + type: string + description: The ID of the run to cancel. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/RunObject" + x-oaiMeta: + name: Cancel a run + group: threads + beta: true + returns: The modified [run](/docs/api-reference/runs/object) object matching the specified ID. + examples: + request: + curl: | + curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/cancel \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "OpenAI-Beta: assistants=v1" \ + -X POST + python: | + from openai import OpenAI + client = OpenAI() + + run = client.beta.threads.runs.cancel( + thread_id="thread_abc123", + run_id="run_abc123" + ) + print(run) + node.js: | + import OpenAI from "openai"; + + const openai = new OpenAI(); + + async function main() { + const run = await openai.beta.threads.runs.cancel( + "thread_abc123", + "run_abc123" + ); + + console.log(run); + } + + main(); + response: | + { + "id": "run_abc123", + "object": "thread.run", + "created_at": 1699076126, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "cancelling", + "started_at": 1699076126, + "expires_at": 1699076726, + "cancelled_at": null, + "failed_at": null, + "completed_at": null, + "last_error": null, + "model": "gpt-4", + "instructions": "You summarize books.", + "tools": [ + { + "type": "retrieval" + } + ], + "file_ids": [], + "metadata": {} + } + + /threads/{thread_id}/runs/{run_id}/steps: + get: + operationId: listRunSteps + tags: + - Assistants + summary: Returns a list of run steps belonging to a run. + parameters: + - name: thread_id + in: path + required: true + schema: + type: string + description: The ID of the thread the run and run steps belong to. + - name: run_id + in: path + required: true + schema: + type: string + description: The ID of the run the run steps belong to. + - name: limit + in: query + description: *pagination_limit_param_description + required: false + schema: + type: integer + default: 20 + - name: order + in: query + description: *pagination_order_param_description + schema: + type: string + default: desc + enum: ["asc", "desc"] + - name: after + in: query + description: *pagination_after_param_description + schema: + type: string + - name: before + in: query + description: *pagination_before_param_description + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ListRunStepsResponse" + x-oaiMeta: + name: List run steps + group: threads + beta: true + returns: A list of [run step](/docs/api-reference/runs/step-object) objects. + examples: + request: + curl: | + curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: application/json" \ + -H "OpenAI-Beta: assistants=v1" + python: | + from openai import OpenAI + client = OpenAI() + + run_steps = client.beta.threads.runs.steps.list( + thread_id="thread_abc123", + run_id="run_abc123" + ) + print(run_steps) + node.js: | + import OpenAI from "openai"; + const openai = new OpenAI(); + + async function main() { + const runStep = await openai.beta.threads.runs.steps.list( + "thread_abc123", + "run_abc123" + ); + console.log(runStep); + } + + main(); + response: | + { + "object": "list", + "data": [ + { + "id": "step_abc123", + "object": "thread.run.step", + "created_at": 1699063291, + "run_id": "run_abc123", + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "type": "message_creation", + "status": "completed", + "cancelled_at": null, + "completed_at": 1699063291, + "expired_at": null, + "failed_at": null, + "last_error": null, + "step_details": { + "type": "message_creation", + "message_creation": { + "message_id": "msg_abc123" + } + } + } + ], + "first_id": "step_abc123", + "last_id": "step_abc456", + "has_more": false + } + + /threads/{thread_id}/runs/{run_id}/steps/{step_id}: + get: + operationId: getRunStep + tags: + - Assistants + summary: Retrieves a run step. + parameters: + - in: path + name: thread_id + required: true + schema: + type: string + description: The ID of the thread to which the run and run step belongs. + - in: path + name: run_id + required: true + schema: + type: string + description: The ID of the run to which the run step belongs. + - in: path + name: step_id + required: true + schema: + type: string + description: The ID of the run step to retrieve. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/RunStepObject" + x-oaiMeta: + name: Retrieve run step + group: threads + beta: true + returns: The [run step](/docs/api-reference/runs/step-object) object matching the specified ID. + examples: + request: + curl: | + curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps/step_abc123 \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: application/json" \ + -H "OpenAI-Beta: assistants=v1" + python: | + from openai import OpenAI + client = OpenAI() + + run_step = client.beta.threads.runs.steps.retrieve( + thread_id="thread_abc123", + run_id="run_abc123", + step_id="step_abc123" + ) + print(run_step) + node.js: | + import OpenAI from "openai"; + const openai = new OpenAI(); + + async function main() { + const runStep = await openai.beta.threads.runs.steps.retrieve( + "thread_abc123", + "run_abc123", + "step_abc123" + ); + console.log(runStep); + } + + main(); + response: &run_step_object_example | + { + "id": "step_abc123", + "object": "thread.run.step", + "created_at": 1699063291, + "run_id": "run_abc123", + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "type": "message_creation", + "status": "completed", + "cancelled_at": null, + "completed_at": 1699063291, + "expired_at": null, + "failed_at": null, + "last_error": null, + "step_details": { + "type": "message_creation", + "message_creation": { + "message_id": "msg_abc123" + } + } + } + + /assistants/{assistant_id}/files: + get: + operationId: listAssistantFiles + tags: + - Assistants + summary: Returns a list of assistant files. + parameters: + - name: assistant_id + in: path + description: The ID of the assistant the file belongs to. + required: true + schema: + type: string + - name: limit + in: query + description: *pagination_limit_param_description + required: false + schema: + type: integer + default: 20 + - name: order + in: query + description: *pagination_order_param_description + schema: + type: string + default: desc + enum: ["asc", "desc"] + - name: after + in: query + description: *pagination_after_param_description + schema: + type: string + - name: before + in: query + description: *pagination_before_param_description + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ListAssistantFilesResponse" + x-oaiMeta: + name: List assistant files + group: assistants + beta: true + returns: A list of [assistant file](/docs/api-reference/assistants/file-object) objects. + examples: + request: + curl: | + curl https://api.openai.com/v1/assistants/asst_abc123/files \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: application/json" \ + -H "OpenAI-Beta: assistants=v1" + python: | + from openai import OpenAI + client = OpenAI() + + assistant_files = client.beta.assistants.files.list( + assistant_id="asst_abc123" + ) + print(assistant_files) + node.js: | + import OpenAI from "openai"; + const openai = new OpenAI(); + + async function main() { + const assistantFiles = await openai.beta.assistants.files.list( + "asst_abc123" + ); + console.log(assistantFiles); + } + + main(); + response: | + { + "object": "list", + "data": [ + { + "id": "file-abc123", + "object": "assistant.file", + "created_at": 1699060412, + "assistant_id": "asst_abc123" + }, + { + "id": "file-abc456", + "object": "assistant.file", + "created_at": 1699060412, + "assistant_id": "asst_abc123" + } + ], + "first_id": "file-abc123", + "last_id": "file-abc456", + "has_more": false + } + post: + operationId: createAssistantFile + tags: + - Assistants + summary: Create an assistant file by attaching a [File](/docs/api-reference/files) to an [assistant](/docs/api-reference/assistants). + parameters: + - in: path + name: assistant_id + required: true + schema: + type: string + example: file-abc123 + description: | + The ID of the assistant for which to create a File. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateAssistantFileRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/AssistantFileObject" + x-oaiMeta: + name: Create assistant file + group: assistants + beta: true + returns: An [assistant file](/docs/api-reference/assistants/file-object) object. + examples: + request: + curl: | + curl https://api.openai.com/v1/assistants/asst_abc123/files \ + -H 'Authorization: Bearer $OPENAI_API_KEY"' \ + -H 'Content-Type: application/json' \ + -H 'OpenAI-Beta: assistants=v1' \ + -d '{ + "file_id": "file-abc123" + }' + python: | + from openai import OpenAI + client = OpenAI() + + assistant_file = client.beta.assistants.files.create( + assistant_id="asst_abc123", + file_id="file-abc123" + ) + print(assistant_file) + node.js: | + import OpenAI from "openai"; + const openai = new OpenAI(); + + async function main() { + const myAssistantFile = await openai.beta.assistants.files.create( + "asst_abc123", + { + file_id: "file-abc123" + } + ); + console.log(myAssistantFile); + } + + main(); + response: &assistant_file_object | + { + "id": "file-abc123", + "object": "assistant.file", + "created_at": 1699055364, + "assistant_id": "asst_abc123" + } + + /assistants/{assistant_id}/files/{file_id}: + get: + operationId: getAssistantFile + tags: + - Assistants + summary: Retrieves an AssistantFile. + parameters: + - in: path + name: assistant_id + required: true + schema: + type: string + description: The ID of the assistant who the file belongs to. + - in: path + name: file_id + required: true + schema: + type: string + description: The ID of the file we're getting. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/AssistantFileObject" + x-oaiMeta: + name: Retrieve assistant file + group: assistants + beta: true + returns: The [assistant file](/docs/api-reference/assistants/file-object) object matching the specified ID. + examples: + request: + curl: | + curl https://api.openai.com/v1/assistants/asst_abc123/files/file-abc123 \ + -H 'Authorization: Bearer $OPENAI_API_KEY"' \ + -H 'Content-Type: application/json' \ + -H 'OpenAI-Beta: assistants=v1' + python: | + from openai import OpenAI + client = OpenAI() + + assistant_file = client.beta.assistants.files.retrieve( + assistant_id="asst_abc123", + file_id="file-abc123" + ) + print(assistant_file) + node.js: | + import OpenAI from "openai"; + const openai = new OpenAI(); + + async function main() { + const myAssistantFile = await openai.beta.assistants.files.retrieve( + "asst_abc123", + "file-abc123" + ); + console.log(myAssistantFile); + } + + main(); + response: *assistant_file_object + delete: + operationId: deleteAssistantFile + tags: + - Assistants + summary: Delete an assistant file. + parameters: + - in: path + name: assistant_id + required: true + schema: + type: string + description: The ID of the assistant that the file belongs to. + - in: path + name: file_id + required: true + schema: + type: string + description: The ID of the file to delete. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/DeleteAssistantFileResponse" + x-oaiMeta: + name: Delete assistant file + group: assistants + beta: true + returns: Deletion status + examples: + request: + curl: | + curl https://api.openai.com/v1/assistants/asst_abc123/files/file-abc123 \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: application/json" \ + -H "OpenAI-Beta: assistants=v1" \ + -X DELETE + python: | + from openai import OpenAI + client = OpenAI() + + deleted_assistant_file = client.beta.assistants.files.delete( + assistant_id="asst_abc123", + file_id="file-abc123" + ) + print(deleted_assistant_file) + node.js: | + import OpenAI from "openai"; + const openai = new OpenAI(); + + async function main() { + const deletedAssistantFile = await openai.beta.assistants.files.del( + "asst_abc123", + "file-abc123" + ); + console.log(deletedAssistantFile); + } + + main(); + response: | + { + id: "file-abc123", + object: "assistant.file.deleted", + deleted: true + } + + /threads/{thread_id}/messages/{message_id}/files: + get: + operationId: listMessageFiles + tags: + - Assistants + summary: Returns a list of message files. + parameters: + - name: thread_id + in: path + description: The ID of the thread that the message and files belong to. + required: true + schema: + type: string + - name: message_id + in: path + description: The ID of the message that the files belongs to. + required: true + schema: + type: string + - name: limit + in: query + description: *pagination_limit_param_description + required: false + schema: + type: integer + default: 20 + - name: order + in: query + description: *pagination_order_param_description + schema: + type: string + default: desc + enum: ["asc", "desc"] + - name: after + in: query + description: *pagination_after_param_description + schema: + type: string + - name: before + in: query + description: *pagination_before_param_description + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ListMessageFilesResponse" + x-oaiMeta: + name: List message files + group: threads + beta: true + returns: A list of [message file](/docs/api-reference/messages/file-object) objects. + examples: + request: + curl: | + curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123/files \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: application/json" \ + -H "OpenAI-Beta: assistants=v1" + python: | + from openai import OpenAI + client = OpenAI() + + message_files = client.beta.threads.messages.files.list( + thread_id="thread_abc123", + message_id="msg_abc123" + ) + print(message_files) + node.js: | + import OpenAI from "openai"; + const openai = new OpenAI(); + + async function main() { + const messageFiles = await openai.beta.threads.messages.files.list( + "thread_abc123", + "msg_abc123" + ); + console.log(messageFiles); + } + + main(); + response: | + { + "object": "list", + "data": [ + { + "id": "file-abc123", + "object": "thread.message.file", + "created_at": 1699061776, + "message_id": "msg_abc123" + }, + { + "id": "file-abc123", + "object": "thread.message.file", + "created_at": 1699061776, + "message_id": "msg_abc123" + } + ], + "first_id": "file-abc123", + "last_id": "file-abc123", + "has_more": false + } + + /threads/{thread_id}/messages/{message_id}/files/{file_id}: + get: + operationId: getMessageFile + tags: + - Assistants + summary: Retrieves a message file. + parameters: + - in: path + name: thread_id + required: true + schema: + type: string + example: thread_abc123 + description: The ID of the thread to which the message and File belong. + - in: path + name: message_id + required: true + schema: + type: string + example: msg_abc123 + description: The ID of the message the file belongs to. + - in: path + name: file_id + required: true + schema: + type: string + example: file-abc123 + description: The ID of the file being retrieved. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/MessageFileObject" + x-oaiMeta: + name: Retrieve message file + group: threads + beta: true + returns: The [message file](/docs/api-reference/messages/file-object) object. + examples: + request: + curl: | + curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123/files/file-abc123 \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: application/json" \ + -H "OpenAI-Beta: assistants=v1" + python: | + from openai import OpenAI + client = OpenAI() + + message_files = client.beta.threads.messages.files.retrieve( + thread_id="thread_abc123", + message_id="msg_abc123", + file_id="file-abc123" + ) + print(message_files) + node.js: | + import OpenAI from "openai"; + const openai = new OpenAI(); + + async function main() { + const messageFile = await openai.beta.threads.messages.files.retrieve( + "thread_abc123", + "msg_abc123", + "file-abc123" + ); + console.log(messageFile); + } + + main(); + response: | + { + "id": "file-abc123", + "object": "thread.message.file", + "created_at": 1699061776, + "message_id": "msg_abc123" + } + +components: + securitySchemes: + ApiKeyAuth: + type: http + scheme: "bearer" + + schemas: + Error: + type: object + properties: + code: + type: string + nullable: true + message: + type: string + nullable: false + param: + type: string + nullable: true + type: + type: string + nullable: false + required: + - type + - message + - param + - code + ErrorResponse: + type: object + properties: + error: + $ref: "#/components/schemas/Error" + required: + - error + + ListModelsResponse: + type: object + properties: + object: + type: string + enum: [list] + data: + type: array + items: + $ref: "#/components/schemas/Model" + required: + - object + - data + DeleteModelResponse: + type: object + properties: + id: + type: string + deleted: + type: boolean + object: + type: string + required: + - id + - object + - deleted + + CreateCompletionRequest: + type: object + properties: + model: + description: &model_description | + ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them. + anyOf: + - type: string + - type: string + enum: + [ + "babbage-002", + "davinci-002", + "gpt-3.5-turbo-instruct", + "text-davinci-003", + "text-davinci-002", + "text-davinci-001", + "code-davinci-002", + "text-curie-001", + "text-babbage-001", + "text-ada-001", + ] + x-oaiTypeLabel: string + prompt: + description: &completions_prompt_description | + The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays. + + Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document. + default: "<|endoftext|>" + nullable: true + oneOf: + - type: string + default: "" + example: "This is a test." + - type: array + items: + type: string + default: "" + example: "This is a test." + - type: array + minItems: 1 + items: + type: integer + example: "[1212, 318, 257, 1332, 13]" + - type: array + minItems: 1 + items: + type: array + minItems: 1 + items: + type: integer + example: "[[1212, 318, 257, 1332, 13]]" + best_of: + type: integer + default: 1 + minimum: 0 + maximum: 20 + nullable: true + description: &completions_best_of_description | + Generates `best_of` completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed. + + When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`. + + **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`. + echo: + type: boolean + default: false + nullable: true + description: &completions_echo_description > + Echo back the prompt in addition to the completion + frequency_penalty: + type: number + default: 0 + minimum: -2 + maximum: 2 + nullable: true + description: &completions_frequency_penalty_description | + Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + + [See more information about frequency and presence penalties.](/docs/guides/text-generation/parameter-details) + logit_bias: &completions_logit_bias + type: object + x-oaiTypeLabel: map + default: null + nullable: true + additionalProperties: + type: integer + description: &completions_logit_bias_description | + Modify the likelihood of specified tokens appearing in the completion. + + Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) (which works for both GPT-2 and GPT-3) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. + + As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token from being generated. + logprobs: &completions_logprobs_configuration + type: integer + minimum: 0 + maximum: 5 + default: null + nullable: true + description: &completions_logprobs_description | + Include the log probabilities on the `logprobs` most likely output tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. + + The maximum value for `logprobs` is 5. + max_tokens: + type: integer + minimum: 0 + default: 16 + example: 16 + nullable: true + description: &completions_max_tokens_description | + The maximum number of [tokens](/tokenizer) that can be generated in the completion. + + The token count of your prompt plus `max_tokens` cannot exceed the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. + n: + type: integer + minimum: 1 + maximum: 128 + default: 1 + example: 1 + nullable: true + description: &completions_completions_description | + How many completions to generate for each prompt. + + **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`. + presence_penalty: + type: number + default: 0 + minimum: -2 + maximum: 2 + nullable: true + description: &completions_presence_penalty_description | + Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + + [See more information about frequency and presence penalties.](/docs/guides/text-generation/parameter-details) + seed: &completions_seed_param + type: integer + minimum: -9223372036854775808 + maximum: 9223372036854775807 + nullable: true + description: | + If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. + + Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. + stop: + description: &completions_stop_description > + Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. + default: null + nullable: true + oneOf: + - type: string + default: <|endoftext|> + example: "\n" + nullable: true + - type: array + minItems: 1 + maxItems: 4 + items: + type: string + example: '["\n"]' + stream: + description: > + Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) + as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). + type: boolean + nullable: true + default: false + suffix: + description: The suffix that comes after a completion of inserted text. + default: null + nullable: true + type: string + example: "test." + temperature: + type: number + minimum: 0 + maximum: 2 + default: 1 + example: 1 + nullable: true + description: &completions_temperature_description | + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + + We generally recommend altering this or `top_p` but not both. + top_p: + type: number + minimum: 0 + maximum: 1 + default: 1 + example: 1 + nullable: true + description: &completions_top_p_description | + An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or `temperature` but not both. + user: &end_user_param_configuration + type: string + example: user-1234 + description: | + A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids). + required: + - model + - prompt + + CreateCompletionResponse: + type: object + description: | + Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint). + properties: + id: + type: string + description: A unique identifier for the completion. + choices: + type: array + description: The list of completion choices the model generated for the input prompt. + items: + type: object + required: + - finish_reason + - index + - logprobs + - text + properties: + finish_reason: + type: string + description: &completion_finish_reason_description | + The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, + `length` if the maximum number of tokens specified in the request was reached, + or `content_filter` if content was omitted due to a flag from our content filters. + enum: ["stop", "length", "content_filter"] + index: + type: integer + logprobs: + type: object + nullable: true + properties: + text_offset: + type: array + items: + type: integer + token_logprobs: + type: array + items: + type: number + tokens: + type: array + items: + type: string + top_logprobs: + type: array + items: + type: object + additionalProperties: + type: number + text: + type: string + created: + type: integer + description: The Unix timestamp (in seconds) of when the completion was created. + model: + type: string + description: The model used for completion. + system_fingerprint: + type: string + description: | + This fingerprint represents the backend configuration that the model runs with. + + Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. + object: + type: string + description: The object type, which is always "text_completion" + enum: [text_completion] + usage: + $ref: "#/components/schemas/CompletionUsage" + required: + - id + - object + - created + - model + - choices + x-oaiMeta: + name: The completion object + legacy: true + example: | + { + "id": "cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7", + "object": "text_completion", + "created": 1589478378, + "model": "gpt-3.5-turbo", + "choices": [ + { + "text": "\n\nThis is indeed a test", + "index": 0, + "logprobs": null, + "finish_reason": "length" + } + ], + "usage": { + "prompt_tokens": 5, + "completion_tokens": 7, + "total_tokens": 12 + } + } + + ChatCompletionRequestMessageContentPart: + oneOf: + - $ref: "#/components/schemas/ChatCompletionRequestMessageContentPartText" + - $ref: "#/components/schemas/ChatCompletionRequestMessageContentPartImage" + x-oaiExpandable: true + + ChatCompletionRequestMessageContentPartImage: + type: object + title: Image content part + properties: + type: + type: string + enum: ["image_url"] + description: The type of the content part. + image_url: + type: object + properties: + url: + type: string + description: Either a URL of the image or the base64 encoded image data. + format: uri + detail: + type: string + description: Specifies the detail level of the image. Learn more in the [Vision guide](/docs/guides/vision/low-or-high-fidelity-image-understanding). + enum: ["auto", "low", "high"] + default: "auto" + required: + - url + required: + - type + - image_url + + ChatCompletionRequestMessageContentPartText: + type: object + title: Text content part + properties: + type: + type: string + enum: ["text"] + description: The type of the content part. + text: + type: string + description: The text content. + required: + - type + - text + + ChatCompletionRequestMessage: + oneOf: + - $ref: "#/components/schemas/ChatCompletionRequestSystemMessage" + - $ref: "#/components/schemas/ChatCompletionRequestUserMessage" + - $ref: "#/components/schemas/ChatCompletionRequestAssistantMessage" + - $ref: "#/components/schemas/ChatCompletionRequestToolMessage" + - $ref: "#/components/schemas/ChatCompletionRequestFunctionMessage" + x-oaiExpandable: true + + ChatCompletionRequestSystemMessage: + type: object + title: System message + properties: + content: + description: The contents of the system message. + type: string + role: + type: string + enum: ["system"] + description: The role of the messages author, in this case `system`. + name: + type: string + description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. + required: + - content + - role + + ChatCompletionRequestUserMessage: + type: object + title: User message + properties: + content: + description: | + The contents of the user message. + oneOf: + - type: string + description: The text contents of the message. + title: Text content + - type: array + description: An array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts. Image input is only supported when using the `gpt-4-visual-preview` model. + title: Array of content parts + items: + $ref: "#/components/schemas/ChatCompletionRequestMessageContentPart" + minItems: 1 + x-oaiExpandable: true + role: + type: string + enum: ["user"] + description: The role of the messages author, in this case `user`. + name: + type: string + description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. + required: + - content + - role + + ChatCompletionRequestAssistantMessage: + type: object + title: Assistant message + properties: + content: + nullable: true + type: string + description: | + The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified. + role: + type: string + enum: ["assistant"] + description: The role of the messages author, in this case `assistant`. + name: + type: string + description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. + tool_calls: + $ref: "#/components/schemas/ChatCompletionMessageToolCalls" + function_call: + type: object + deprecated: true + description: "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model." + properties: + arguments: + type: string + description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. + name: + type: string + description: The name of the function to call. + required: + - arguments + - name + required: + - role + + ChatCompletionRequestToolMessage: + type: object + title: Tool message + properties: + role: + type: string + enum: ["tool"] + description: The role of the messages author, in this case `tool`. + content: + type: string + description: The contents of the tool message. + tool_call_id: + type: string + description: Tool call that this message is responding to. + required: + - role + - content + - tool_call_id + + ChatCompletionRequestFunctionMessage: + type: object + title: Function message + deprecated: true + properties: + role: + type: string + enum: ["function"] + description: The role of the messages author, in this case `function`. + content: + nullable: true + type: string + description: The contents of the function message. + name: + type: string + description: The name of the function to call. + required: + - role + - content + - name + + FunctionParameters: + type: object + description: "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/text-generation/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list." + additionalProperties: true + + ChatCompletionFunctions: + type: object + deprecated: true + properties: + description: + type: string + description: A description of what the function does, used by the model to choose when and how to call the function. + name: + type: string + description: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + parameters: + $ref: "#/components/schemas/FunctionParameters" + required: + - name + + ChatCompletionFunctionCallOption: + type: object + description: > + Specifying a particular function via `{"name": "my_function"}` forces the model to call that function. + properties: + name: + type: string + description: The name of the function to call. + required: + - name + + ChatCompletionTool: + type: object + properties: + type: + type: string + enum: ["function"] + description: The type of the tool. Currently, only `function` is supported. + function: + $ref: "#/components/schemas/FunctionObject" + required: + - type + - function + + FunctionObject: + type: object + properties: + description: + type: string + description: A description of what the function does, used by the model to choose when and how to call the function. + name: + type: string + description: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + parameters: + $ref: "#/components/schemas/FunctionParameters" + required: + - name + + ChatCompletionToolChoiceOption: + description: | + Controls which (if any) function is called by the model. + `none` means the model will not call a function and instead generates a message. + `auto` means the model can pick between generating a message or calling a function. + Specifying a particular function via `{"type: "function", "function": {"name": "my_function"}}` forces the model to call that function. + + `none` is the default when no functions are present. `auto` is the default if functions are present. + oneOf: + - type: string + description: > + `none` means the model will not call a function and instead generates a message. + `auto` means the model can pick between generating a message or calling a function. + enum: [none, auto] + - $ref: "#/components/schemas/ChatCompletionNamedToolChoice" + x-oaiExpandable: true + + ChatCompletionNamedToolChoice: + type: object + description: Specifies a tool the model should use. Use to force the model to call a specific function. + properties: + type: + type: string + enum: ["function"] + description: The type of the tool. Currently, only `function` is supported. + function: + type: object + properties: + name: + type: string + description: The name of the function to call. + required: + - name + required: + - type + - function + + ChatCompletionMessageToolCalls: + type: array + description: The tool calls generated by the model, such as function calls. + items: + $ref: "#/components/schemas/ChatCompletionMessageToolCall" + + ChatCompletionMessageToolCall: + type: object + properties: + # TODO: index included when streaming + id: + type: string + description: The ID of the tool call. + type: + type: string + enum: ["function"] + description: The type of the tool. Currently, only `function` is supported. + function: + type: object + description: The function that the model called. + properties: + name: + type: string + description: The name of the function to call. + arguments: + type: string + description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. + required: + - name + - arguments + required: + - id + - type + - function + + ChatCompletionMessageToolCallChunk: + type: object + properties: + index: + type: integer + id: + type: string + description: The ID of the tool call. + type: + type: string + enum: ["function"] + description: The type of the tool. Currently, only `function` is supported. + function: + type: object + properties: + name: + type: string + description: The name of the function to call. + arguments: + type: string + description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. + required: + - index + + # Note, this isn't referenced anywhere, but is kept as a convenience to record all possible roles in one place. + ChatCompletionRole: + type: string + description: The role of the author of a message + enum: + - system + - user + - assistant + - tool + - function + + ChatCompletionResponseMessage: + type: object + description: A chat completion message generated by the model. + properties: + content: + type: string + description: The contents of the message. + nullable: true + tool_calls: + $ref: "#/components/schemas/ChatCompletionMessageToolCalls" + role: + type: string + enum: ["assistant"] + description: The role of the author of this message. + function_call: + type: object + deprecated: true + description: "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model." + properties: + arguments: + type: string + description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. + name: + type: string + description: The name of the function to call. + required: + - name + - arguments + required: + - role + - content + + ChatCompletionStreamResponseDelta: + type: object + description: A chat completion delta generated by streamed model responses. + properties: + content: + type: string + description: The contents of the chunk message. + nullable: true + function_call: + deprecated: true + type: object + description: "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model." + properties: + arguments: + type: string + description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. + name: + type: string + description: The name of the function to call. + tool_calls: + type: array + items: + $ref: "#/components/schemas/ChatCompletionMessageToolCallChunk" + role: + type: string + enum: ["system", "user", "assistant", "tool"] + description: The role of the author of this message. + + CreateChatCompletionRequest: + type: object + properties: + messages: + description: A list of messages comprising the conversation so far. [Example Python code](https://cookbook.openai.com/examples/how_to_format_inputs_to_chatgpt_models). + type: array + minItems: 1 + items: + $ref: "#/components/schemas/ChatCompletionRequestMessage" + model: + description: ID of the model to use. See the [model endpoint compatibility](/docs/models/model-endpoint-compatibility) table for details on which models work with the Chat API. + example: "gpt-3.5-turbo" + anyOf: + - type: string + - type: string + enum: + [ + "gpt-4-1106-preview", + "gpt-4-vision-preview", + "gpt-4", + "gpt-4-0314", + "gpt-4-0613", + "gpt-4-32k", + "gpt-4-32k-0314", + "gpt-4-32k-0613", + "gpt-3.5-turbo", + "gpt-3.5-turbo-16k", + "gpt-3.5-turbo-0301", + "gpt-3.5-turbo-0613", + "gpt-3.5-turbo-1106", + "gpt-3.5-turbo-16k-0613", + ] + x-oaiTypeLabel: string + frequency_penalty: + type: number + default: 0 + minimum: -2 + maximum: 2 + nullable: true + description: *completions_frequency_penalty_description + logit_bias: + type: object + x-oaiTypeLabel: map + default: null + nullable: true + additionalProperties: + type: integer + description: | + Modify the likelihood of specified tokens appearing in the completion. + + Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. + logprobs: + description: Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`. This option is currently not available on the `gpt-4-vision-preview` model. + type: boolean + default: false + nullable: true + top_logprobs: + description: An integer between 0 and 5 specifying the number of most likely tokens to return at each token position, each with an associated log probability. `logprobs` must be set to `true` if this parameter is used. + type: integer + minimum: 0 + maximum: 5 + nullable: true + max_tokens: + description: | + The maximum number of [tokens](/tokenizer) that can be generated in the chat completion. + + The total length of input tokens and generated tokens is limited by the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. + type: integer + nullable: true + n: + type: integer + minimum: 1 + maximum: 128 + default: 1 + example: 1 + nullable: true + description: How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs. + presence_penalty: + type: number + default: 0 + minimum: -2 + maximum: 2 + nullable: true + description: *completions_presence_penalty_description + response_format: + type: object + description: | + An object specifying the format that the model must output. Compatible with `gpt-4-1106-preview` and `gpt-3.5-turbo-1106`. + + Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON. + + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + properties: + type: + type: string + enum: ["text", "json_object"] + example: "json_object" + default: "text" + description: Must be one of `text` or `json_object`. + seed: + type: integer + minimum: -9223372036854775808 + maximum: 9223372036854775807 + nullable: true + description: | + This feature is in Beta. + If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. + Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. + x-oaiMeta: + beta: true + stop: + description: | + Up to 4 sequences where the API will stop generating further tokens. + default: null + oneOf: + - type: string + nullable: true + - type: array + minItems: 1 + maxItems: 4 + items: + type: string + stream: + description: > + If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) + as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). + type: boolean + nullable: true + default: false + temperature: + type: number + minimum: 0 + maximum: 2 + default: 1 + example: 1 + nullable: true + description: *completions_temperature_description + top_p: + type: number + minimum: 0 + maximum: 1 + default: 1 + example: 1 + nullable: true + description: *completions_top_p_description + tools: + type: array + description: > + A list of tools the model may call. Currently, only functions are supported as a tool. + Use this to provide a list of functions the model may generate JSON inputs for. + items: + $ref: "#/components/schemas/ChatCompletionTool" + tool_choice: + $ref: "#/components/schemas/ChatCompletionToolChoiceOption" + user: *end_user_param_configuration + function_call: + deprecated: true + description: | + Deprecated in favor of `tool_choice`. + + Controls which (if any) function is called by the model. + `none` means the model will not call a function and instead generates a message. + `auto` means the model can pick between generating a message or calling a function. + Specifying a particular function via `{"name": "my_function"}` forces the model to call that function. + + `none` is the default when no functions are present. `auto` is the default if functions are present. + oneOf: + - type: string + description: > + `none` means the model will not call a function and instead generates a message. + `auto` means the model can pick between generating a message or calling a function. + enum: [none, auto] + - $ref: "#/components/schemas/ChatCompletionFunctionCallOption" + x-oaiExpandable: true + functions: + deprecated: true + description: | + Deprecated in favor of `tools`. + + A list of functions the model may generate JSON inputs for. + type: array + minItems: 1 + maxItems: 128 + items: + $ref: "#/components/schemas/ChatCompletionFunctions" + + required: + - model + - messages + + CreateChatCompletionResponse: + type: object + description: Represents a chat completion response returned by model, based on the provided input. + properties: + id: + type: string + description: A unique identifier for the chat completion. + choices: + type: array + description: A list of chat completion choices. Can be more than one if `n` is greater than 1. + items: + type: object + required: + - finish_reason + - index + - message + - logprobs + properties: + finish_reason: + type: string + description: &chat_completion_finish_reason_description | + The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, + `length` if the maximum number of tokens specified in the request was reached, + `content_filter` if content was omitted due to a flag from our content filters, + `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function. + enum: + [ + "stop", + "length", + "tool_calls", + "content_filter", + "function_call", + ] + index: + type: integer + description: The index of the choice in the list of choices. + message: + $ref: "#/components/schemas/ChatCompletionResponseMessage" + logprobs: &chat_completion_response_logprobs + description: Log probability information for the choice. + type: object + nullable: true + properties: + content: + description: A list of message content tokens with log probability information. + type: array + items: + $ref: '#/components/schemas/ChatCompletionTokenLogprob' + nullable: true + required: + - content + created: + type: integer + description: The Unix timestamp (in seconds) of when the chat completion was created. + model: + type: string + description: The model used for the chat completion. + system_fingerprint: + type: string + description: | + This fingerprint represents the backend configuration that the model runs with. + + Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. + object: + type: string + description: The object type, which is always `chat.completion`. + enum: [chat.completion] + usage: + $ref: "#/components/schemas/CompletionUsage" + required: + - choices + - created + - id + - model + - object + x-oaiMeta: + name: The chat completion object + group: chat + example: *chat_completion_example + + CreateChatCompletionFunctionResponse: + type: object + description: Represents a chat completion response returned by model, based on the provided input. + properties: + id: + type: string + description: A unique identifier for the chat completion. + choices: + type: array + description: A list of chat completion choices. Can be more than one if `n` is greater than 1. + items: + type: object + required: + - finish_reason + - index + - message + - logprobs + properties: + finish_reason: + type: string + description: + &chat_completion_function_finish_reason_description | + The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, or `function_call` if the model called a function. + enum: ["stop", "length", "function_call", "content_filter"] + index: + type: integer + description: The index of the choice in the list of choices. + message: + $ref: "#/components/schemas/ChatCompletionResponseMessage" + created: + type: integer + description: The Unix timestamp (in seconds) of when the chat completion was created. + model: + type: string + description: The model used for the chat completion. + system_fingerprint: + type: string + description: | + This fingerprint represents the backend configuration that the model runs with. + + Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. + object: + type: string + description: The object type, which is always `chat.completion`. + enum: [chat.completion] + usage: + $ref: "#/components/schemas/CompletionUsage" + required: + - choices + - created + - id + - model + - object + x-oaiMeta: + name: The chat completion object + group: chat + example: *chat_completion_function_example + + ChatCompletionTokenLogprob: + type: object + properties: + token: &chat_completion_response_logprobs_token + description: The token. + type: string + logprob: &chat_completion_response_logprobs_token_logprob + description: The log probability of this token. + type: number + bytes: &chat_completion_response_logprobs_bytes + description: A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token. + type: array + items: + type: integer + nullable: true + top_logprobs: + description: List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned. + type: array + items: + type: object + properties: + token: *chat_completion_response_logprobs_token + logprob: *chat_completion_response_logprobs_token_logprob + bytes: *chat_completion_response_logprobs_bytes + required: + - token + - logprob + - bytes + required: + - token + - logprob + - bytes + - top_logprobs + + ListPaginatedFineTuningJobsResponse: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/FineTuningJob" + has_more: + type: boolean + object: + type: string + enum: [list] + required: + - object + - data + - has_more + + CreateChatCompletionStreamResponse: + type: object + description: Represents a streamed chunk of a chat completion response returned by model, based on the provided input. + properties: + id: + type: string + description: A unique identifier for the chat completion. Each chunk has the same ID. + choices: + type: array + description: A list of chat completion choices. Can be more than one if `n` is greater than 1. + items: + type: object + required: + - delta + - finish_reason + - index + properties: + delta: + $ref: "#/components/schemas/ChatCompletionStreamResponseDelta" + logprobs: *chat_completion_response_logprobs + finish_reason: + type: string + description: *chat_completion_finish_reason_description + enum: + [ + "stop", + "length", + "tool_calls", + "content_filter", + "function_call", + ] + nullable: true + index: + type: integer + description: The index of the choice in the list of choices. + created: + type: integer + description: The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp. + model: + type: string + description: The model to generate the completion. + system_fingerprint: + type: string + description: | + This fingerprint represents the backend configuration that the model runs with. + Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. + object: + type: string + description: The object type, which is always `chat.completion.chunk`. + enum: [chat.completion.chunk] + required: + - choices + - created + - id + - model + - object + x-oaiMeta: + name: The chat completion chunk object + group: chat + example: *chat_completion_chunk_example + + CreateChatCompletionImageResponse: + type: object + description: Represents a streamed chunk of a chat completion response returned by model, based on the provided input. + x-oaiMeta: + name: The chat completion chunk object + group: chat + example: *chat_completion_image_example + + CreateEditRequest: + type: object + properties: + instruction: + description: The instruction that tells the model how to edit the prompt. + type: string + example: "Fix the spelling mistakes." + model: + description: ID of the model to use. You can use the `text-davinci-edit-001` or `code-davinci-edit-001` model with this endpoint. + example: "text-davinci-edit-001" + anyOf: + - type: string + - type: string + enum: ["text-davinci-edit-001", "code-davinci-edit-001"] + x-oaiTypeLabel: string + input: + description: The input text to use as a starting point for the edit. + type: string + default: "" + nullable: true + example: "What day of the wek is it?" + n: + type: integer + minimum: 1 + maximum: 20 + default: 1 + example: 1 + nullable: true + description: How many edits to generate for the input and instruction. + temperature: + type: number + minimum: 0 + maximum: 2 + default: 1 + example: 1 + nullable: true + description: *completions_temperature_description + top_p: + type: number + minimum: 0 + maximum: 1 + default: 1 + example: 1 + nullable: true + description: *completions_top_p_description + required: + - model + - instruction + + CreateEditResponse: + type: object + deprecated: true + title: Edit + properties: + choices: + type: array + description: A list of edit choices. Can be more than one if `n` is greater than 1. + items: + type: object + required: + - text + - index + - finish_reason + properties: + finish_reason: + type: string + description: *completion_finish_reason_description + enum: ["stop", "length"] + index: + type: integer + description: The index of the choice in the list of choices. + text: + type: string + description: The edited result. + object: + type: string + description: The object type, which is always `edit`. + enum: [edit] + created: + type: integer + description: The Unix timestamp (in seconds) of when the edit was created. + usage: + $ref: "#/components/schemas/CompletionUsage" + required: + - object + - created + - choices + - usage + x-oaiMeta: + name: The edit object + example: *edit_example + + CreateImageRequest: + type: object + properties: + prompt: + description: A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`. + type: string + example: "A cute baby sea otter" + model: + anyOf: + - type: string + - type: string + enum: ["dall-e-2", "dall-e-3"] + x-oaiTypeLabel: string + default: "dall-e-2" + example: "dall-e-3" + nullable: true + description: The model to use for image generation. + n: &images_n + type: integer + minimum: 1 + maximum: 10 + default: 1 + example: 1 + nullable: true + description: The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported. + quality: + type: string + enum: ["standard", "hd"] + default: "standard" + example: "standard" + description: The quality of the image that will be generated. `hd` creates images with finer details and greater consistency across the image. This param is only supported for `dall-e-3`. + response_format: &images_response_format + type: string + enum: ["url", "b64_json"] + default: "url" + example: "url" + nullable: true + description: The format in which the generated images are returned. Must be one of `url` or `b64_json`. + size: &images_size + type: string + enum: ["256x256", "512x512", "1024x1024", "1792x1024", "1024x1792"] + default: "1024x1024" + example: "1024x1024" + nullable: true + description: The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3` models. + style: + type: string + enum: ["vivid", "natural"] + default: "vivid" + example: "vivid" + nullable: true + description: The style of the generated images. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for `dall-e-3`. + user: *end_user_param_configuration + required: + - prompt + + ImagesResponse: + properties: + created: + type: integer + data: + type: array + items: + $ref: "#/components/schemas/Image" + required: + - created + - data + + Image: + type: object + description: Represents the url or the content of an image generated by the OpenAI API. + properties: + b64_json: + type: string + description: The base64-encoded JSON of the generated image, if `response_format` is `b64_json`. + url: + type: string + description: The URL of the generated image, if `response_format` is `url` (default). + revised_prompt: + type: string + description: The prompt that was used to generate the image, if there was any revision to the prompt. + x-oaiMeta: + name: The image object + example: | + { + "url": "...", + "revised_prompt": "..." + } + + CreateImageEditRequest: + type: object + properties: + image: + description: The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask. + type: string + format: binary + prompt: + description: A text description of the desired image(s). The maximum length is 1000 characters. + type: string + example: "A cute baby sea otter wearing a beret" + mask: + description: An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. + type: string + format: binary + model: + anyOf: + - type: string + - type: string + enum: ["dall-e-2"] + x-oaiTypeLabel: string + default: "dall-e-2" + example: "dall-e-2" + nullable: true + description: The model to use for image generation. Only `dall-e-2` is supported at this time. + n: + type: integer + minimum: 1 + maximum: 10 + default: 1 + example: 1 + nullable: true + description: The number of images to generate. Must be between 1 and 10. + size: &dalle2_images_size + type: string + enum: ["256x256", "512x512", "1024x1024"] + default: "1024x1024" + example: "1024x1024" + nullable: true + description: The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`. + response_format: *images_response_format + user: *end_user_param_configuration + required: + - prompt + - image + + CreateImageVariationRequest: + type: object + properties: + image: + description: The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. + type: string + format: binary + model: + anyOf: + - type: string + - type: string + enum: ["dall-e-2"] + x-oaiTypeLabel: string + default: "dall-e-2" + example: "dall-e-2" + nullable: true + description: The model to use for image generation. Only `dall-e-2` is supported at this time. + n: *images_n + response_format: *images_response_format + size: *dalle2_images_size + user: *end_user_param_configuration + required: + - image + + CreateModerationRequest: + type: object + properties: + input: + description: The input text to classify + oneOf: + - type: string + default: "" + example: "I want to kill them." + - type: array + items: + type: string + default: "" + example: "I want to kill them." + model: + description: | + Two content moderations models are available: `text-moderation-stable` and `text-moderation-latest`. + + The default is `text-moderation-latest` which will be automatically upgraded over time. This ensures you are always using our most accurate model. If you use `text-moderation-stable`, we will provide advanced notice before updating the model. Accuracy of `text-moderation-stable` may be slightly lower than for `text-moderation-latest`. + nullable: false + default: "text-moderation-latest" + example: "text-moderation-stable" + anyOf: + - type: string + - type: string + enum: ["text-moderation-latest", "text-moderation-stable"] + x-oaiTypeLabel: string + required: + - input + + CreateModerationResponse: + type: object + description: Represents policy compliance report by OpenAI's content moderation model against a given input. + properties: + id: + type: string + description: The unique identifier for the moderation request. + model: + type: string + description: The model used to generate the moderation results. + results: + type: array + description: A list of moderation objects. + items: + type: object + properties: + flagged: + type: boolean + description: Whether the content violates [OpenAI's usage policies](/policies/usage-policies). + categories: + type: object + description: A list of the categories, and whether they are flagged or not. + properties: + hate: + type: boolean + description: Content that expresses, incites, or promotes hate based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. Hateful content aimed at non-protected groups (e.g., chess players) is harassment. + hate/threatening: + type: boolean + description: Hateful content that also includes violence or serious harm towards the targeted group based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. + harassment: + type: boolean + description: Content that expresses, incites, or promotes harassing language towards any target. + harassment/threatening: + type: boolean + description: Harassment content that also includes violence or serious harm towards any target. + self-harm: + type: boolean + description: Content that promotes, encourages, or depicts acts of self-harm, such as suicide, cutting, and eating disorders. + self-harm/intent: + type: boolean + description: Content where the speaker expresses that they are engaging or intend to engage in acts of self-harm, such as suicide, cutting, and eating disorders. + self-harm/instructions: + type: boolean + description: Content that encourages performing acts of self-harm, such as suicide, cutting, and eating disorders, or that gives instructions or advice on how to commit such acts. + sexual: + type: boolean + description: Content meant to arouse sexual excitement, such as the description of sexual activity, or that promotes sexual services (excluding sex education and wellness). + sexual/minors: + type: boolean + description: Sexual content that includes an individual who is under 18 years old. + violence: + type: boolean + description: Content that depicts death, violence, or physical injury. + violence/graphic: + type: boolean + description: Content that depicts death, violence, or physical injury in graphic detail. + required: + - hate + - hate/threatening + - harassment + - harassment/threatening + - self-harm + - self-harm/intent + - self-harm/instructions + - sexual + - sexual/minors + - violence + - violence/graphic + category_scores: + type: object + description: A list of the categories along with their scores as predicted by model. + properties: + hate: + type: number + description: The score for the category 'hate'. + hate/threatening: + type: number + description: The score for the category 'hate/threatening'. + harassment: + type: number + description: The score for the category 'harassment'. + harassment/threatening: + type: number + description: The score for the category 'harassment/threatening'. + self-harm: + type: number + description: The score for the category 'self-harm'. + self-harm/intent: + type: number + description: The score for the category 'self-harm/intent'. + self-harm/instructions: + type: number + description: The score for the category 'self-harm/instructions'. + sexual: + type: number + description: The score for the category 'sexual'. + sexual/minors: + type: number + description: The score for the category 'sexual/minors'. + violence: + type: number + description: The score for the category 'violence'. + violence/graphic: + type: number + description: The score for the category 'violence/graphic'. + required: + - hate + - hate/threatening + - harassment + - harassment/threatening + - self-harm + - self-harm/intent + - self-harm/instructions + - sexual + - sexual/minors + - violence + - violence/graphic + required: + - flagged + - categories + - category_scores + required: + - id + - model + - results + x-oaiMeta: + name: The moderation object + example: *moderation_example + + ListFilesResponse: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/OpenAIFile" + object: + type: string + enum: [list] + required: + - object + - data + + CreateFileRequest: + type: object + additionalProperties: false + properties: + file: + description: | + The File object (not file name) to be uploaded. + type: string + format: binary + purpose: + description: | + The intended purpose of the uploaded file. + + Use "fine-tune" for [Fine-tuning](/docs/api-reference/fine-tuning) and "assistants" for [Assistants](/docs/api-reference/assistants) and [Messages](/docs/api-reference/messages). This allows us to validate the format of the uploaded file is correct for fine-tuning. + type: string + enum: ["fine-tune", "assistants"] + required: + - file + - purpose + + DeleteFileResponse: + type: object + properties: + id: + type: string + object: + type: string + enum: [file] + deleted: + type: boolean + required: + - id + - object + - deleted + + CreateFineTuningJobRequest: + type: object + properties: + model: + description: | + The name of the model to fine-tune. You can select one of the + [supported models](/docs/guides/fine-tuning/what-models-can-be-fine-tuned). + example: "gpt-3.5-turbo" + anyOf: + - type: string + - type: string + enum: ["babbage-002", "davinci-002", "gpt-3.5-turbo"] + x-oaiTypeLabel: string + training_file: + description: | + The ID of an uploaded file that contains training data. + + See [upload file](/docs/api-reference/files/upload) for how to upload a file. + + Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose `fine-tune`. + + See the [fine-tuning guide](/docs/guides/fine-tuning) for more details. + type: string + example: "file-abc123" + hyperparameters: + type: object + description: The hyperparameters used for the fine-tuning job. + properties: + batch_size: + description: | + Number of examples in each batch. A larger batch size means that model parameters + are updated less frequently, but with lower variance. + oneOf: + - type: string + enum: [auto] + - type: integer + minimum: 1 + maximum: 256 + default: auto + learning_rate_multiplier: + description: | + Scaling factor for the learning rate. A smaller learning rate may be useful to avoid + overfitting. + oneOf: + - type: string + enum: [auto] + - type: number + minimum: 0 + exclusiveMinimum: true + default: auto + n_epochs: + description: | + The number of epochs to train the model for. An epoch refers to one full cycle + through the training dataset. + oneOf: + - type: string + enum: [auto] + - type: integer + minimum: 1 + maximum: 50 + default: auto + suffix: + description: | + A string of up to 18 characters that will be added to your fine-tuned model name. + + For example, a `suffix` of "custom-model-name" would produce a model name like `ft:gpt-3.5-turbo:openai:custom-model-name:7p4lURel`. + type: string + minLength: 1 + maxLength: 40 + default: null + nullable: true + validation_file: + description: | + The ID of an uploaded file that contains validation data. + + If you provide this file, the data is used to generate validation + metrics periodically during fine-tuning. These metrics can be viewed in + the fine-tuning results file. + The same data should not be present in both train and validation files. + + Your dataset must be formatted as a JSONL file. You must upload your file with the purpose `fine-tune`. + + See the [fine-tuning guide](/docs/guides/fine-tuning) for more details. + type: string + nullable: true + example: "file-abc123" + required: + - model + - training_file + + ListFineTuningJobEventsResponse: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/FineTuningJobEvent" + object: + type: string + enum: [list] + required: + - object + - data + + CreateFineTuneRequest: + type: object + properties: + training_file: + description: | + The ID of an uploaded file that contains training data. + + See [upload file](/docs/api-reference/files/upload) for how to upload a file. + + Your dataset must be formatted as a JSONL file, where each training + example is a JSON object with the keys "prompt" and "completion". + Additionally, you must upload your file with the purpose `fine-tune`. + + See the [fine-tuning guide](/docs/guides/legacy-fine-tuning/creating-training-data) for more details. + type: string + example: "file-abc123" + batch_size: + description: | + The batch size to use for training. The batch size is the number of + training examples used to train a single forward and backward pass. + + By default, the batch size will be dynamically configured to be + ~0.2% of the number of examples in the training set, capped at 256 - + in general, we've found that larger batch sizes tend to work better + for larger datasets. + default: null + type: integer + nullable: true + classification_betas: + description: | + If this is provided, we calculate F-beta scores at the specified + beta values. The F-beta score is a generalization of F-1 score. + This is only used for binary classification. + + With a beta of 1 (i.e. the F-1 score), precision and recall are + given the same weight. A larger beta score puts more weight on + recall and less on precision. A smaller beta score puts more weight + on precision and less on recall. + type: array + items: + type: number + example: [0.6, 1, 1.5, 2] + default: null + nullable: true + classification_n_classes: + description: | + The number of classes in a classification task. + + This parameter is required for multiclass classification. + type: integer + default: null + nullable: true + classification_positive_class: + description: | + The positive class in binary classification. + + This parameter is needed to generate precision, recall, and F1 + metrics when doing binary classification. + type: string + default: null + nullable: true + compute_classification_metrics: + description: | + If set, we calculate classification-specific metrics such as accuracy + and F-1 score using the validation set at the end of every epoch. + These metrics can be viewed in the [results file](/docs/guides/legacy-fine-tuning/analyzing-your-fine-tuned-model). + + In order to compute classification metrics, you must provide a + `validation_file`. Additionally, you must + specify `classification_n_classes` for multiclass classification or + `classification_positive_class` for binary classification. + type: boolean + default: false + nullable: true + hyperparameters: + type: object + description: The hyperparameters used for the fine-tuning job. + properties: + n_epochs: + description: | + The number of epochs to train the model for. An epoch refers to one + full cycle through the training dataset. + oneOf: + - type: string + enum: [auto] + - type: integer + minimum: 1 + maximum: 50 + default: auto + learning_rate_multiplier: + description: | + The learning rate multiplier to use for training. + The fine-tuning learning rate is the original learning rate used for + pretraining multiplied by this value. + + By default, the learning rate multiplier is the 0.05, 0.1, or 0.2 + depending on final `batch_size` (larger learning rates tend to + perform better with larger batch sizes). We recommend experimenting + with values in the range 0.02 to 0.2 to see what produces the best + results. + default: null + type: number + nullable: true + model: + description: | + The name of the base model to fine-tune. You can select one of "ada", + "babbage", "curie", "davinci", or a fine-tuned model created after 2022-04-21 and before 2023-08-22. + To learn more about these models, see the + [Models](/docs/models) documentation. + default: "curie" + example: "curie" + nullable: true + anyOf: + - type: string + - type: string + enum: ["ada", "babbage", "curie", "davinci"] + x-oaiTypeLabel: string + prompt_loss_weight: + description: | + The weight to use for loss on the prompt tokens. This controls how + much the model tries to learn to generate the prompt (as compared + to the completion which always has a weight of 1.0), and can add + a stabilizing effect to training when completions are short. + + If prompts are extremely long (relative to completions), it may make + sense to reduce this weight so as to avoid over-prioritizing + learning the prompt. + default: 0.01 + type: number + nullable: true + suffix: + description: | + A string of up to 40 characters that will be added to your fine-tuned model name. + + For example, a `suffix` of "custom-model-name" would produce a model name like `ada:ft-your-org:custom-model-name-2022-02-15-04-21-04`. + type: string + minLength: 1 + maxLength: 40 + default: null + nullable: true + validation_file: + description: | + The ID of an uploaded file that contains validation data. + + If you provide this file, the data is used to generate validation + metrics periodically during fine-tuning. These metrics can be viewed in + the [fine-tuning results file](/docs/guides/legacy-fine-tuning/analyzing-your-fine-tuned-model). + Your train and validation data should be mutually exclusive. + + Your dataset must be formatted as a JSONL file, where each validation + example is a JSON object with the keys "prompt" and "completion". + Additionally, you must upload your file with the purpose `fine-tune`. + + See the [fine-tuning guide](/docs/guides/legacy-fine-tuning/creating-training-data) for more details. + type: string + nullable: true + example: "file-abc123" + required: + - training_file + + ListFineTunesResponse: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/FineTune" + object: + type: string + enum: [list] + required: + - object + - data + + ListFineTuneEventsResponse: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/FineTuneEvent" + object: + type: string + enum: [list] + required: + - object + - data + + CreateEmbeddingRequest: + type: object + additionalProperties: false + properties: + input: + description: | + Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for `text-embedding-ada-002`), cannot be an empty string, and any array must be 2048 dimensions or less. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. + example: "The quick brown fox jumped over the lazy dog" + oneOf: + - type: string + title: string + description: The string that will be turned into an embedding. + default: "" + example: "This is a test." + - type: array + title: array + description: The array of strings that will be turned into an embedding. + minItems: 1 + maxItems: 2048 + items: + type: string + default: "" + example: "['This is a test.']" + - type: array + title: array + description: The array of integers that will be turned into an embedding. + minItems: 1 + maxItems: 2048 + items: + type: integer + example: "[1212, 318, 257, 1332, 13]" + - type: array + title: array + description: The array of arrays containing integers that will be turned into an embedding. + minItems: 1 + maxItems: 2048 + items: + type: array + minItems: 1 + items: + type: integer + example: "[[1212, 318, 257, 1332, 13]]" + x-oaiExpandable: true + model: + description: *model_description + example: "text-embedding-ada-002" + anyOf: + - type: string + - type: string + enum: ["text-embedding-ada-002"] + x-oaiTypeLabel: string + encoding_format: + description: "The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/)." + example: "float" + default: "float" + type: string + enum: ["float", "base64"] + user: *end_user_param_configuration + required: + - model + - input + + CreateEmbeddingResponse: + type: object + properties: + data: + type: array + description: The list of embeddings generated by the model. + items: + $ref: "#/components/schemas/Embedding" + model: + type: string + description: The name of the model used to generate the embedding. + object: + type: string + description: The object type, which is always "list". + enum: [list] + usage: + type: object + description: The usage information for the request. + properties: + prompt_tokens: + type: integer + description: The number of tokens used by the prompt. + total_tokens: + type: integer + description: The total number of tokens used by the request. + required: + - prompt_tokens + - total_tokens + required: + - object + - model + - data + - usage + + CreateTranscriptionRequest: + type: object + additionalProperties: false + properties: + file: + description: | + The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. + type: string + x-oaiTypeLabel: file + format: binary + model: + description: | + ID of the model to use. Only `whisper-1` is currently available. + example: whisper-1 + anyOf: + - type: string + - type: string + enum: ["whisper-1"] + x-oaiTypeLabel: string + language: + description: | + The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format will improve accuracy and latency. + type: string + prompt: + description: | + An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should match the audio language. + type: string + response_format: + description: | + The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`. + type: string + enum: + - json + - text + - srt + - verbose_json + - vtt + default: json + temperature: + description: | + The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit. + type: number + default: 0 + required: + - file + - model + + # Note: This does not currently support the non-default response format types. + CreateTranscriptionResponse: + type: object + properties: + text: + type: string + required: + - text + + CreateTranslationRequest: + type: object + additionalProperties: false + properties: + file: + description: | + The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. + type: string + x-oaiTypeLabel: file + format: binary + model: + description: | + ID of the model to use. Only `whisper-1` is currently available. + example: whisper-1 + anyOf: + - type: string + - type: string + enum: ["whisper-1"] + x-oaiTypeLabel: string + prompt: + description: | + An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should be in English. + type: string + response_format: + description: | + The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`. + type: string + default: json + temperature: + description: | + The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit. + type: number + default: 0 + required: + - file + - model + + # Note: This does not currently support the non-default response format types. + CreateTranslationResponse: + type: object + properties: + text: + type: string + required: + - text + + CreateSpeechRequest: + type: object + additionalProperties: false + properties: + model: + description: | + One of the available [TTS models](/docs/models/tts): `tts-1` or `tts-1-hd` + anyOf: + - type: string + - type: string + enum: ["tts-1", "tts-1-hd"] + x-oaiTypeLabel: string + input: + type: string + description: The text to generate audio for. The maximum length is 4096 characters. + maxLength: 4096 + voice: + description: The voice to use when generating the audio. Supported voices are `alloy`, `echo`, `fable`, `onyx`, `nova`, and `shimmer`. Previews of the voices are available in the [Text to speech guide](/docs/guides/text-to-speech/voice-options). + type: string + enum: ["alloy", "echo", "fable", "onyx", "nova", "shimmer"] + response_format: + description: "The format to audio in. Supported formats are `mp3`, `opus`, `aac`, and `flac`." + default: "mp3" + type: string + enum: ["mp3", "opus", "aac", "flac"] + speed: + description: "The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default." + type: number + default: 1.0 + minimum: 0.25 + maximum: 4.0 + required: + - model + - input + - voice + + Model: + title: Model + description: Describes an OpenAI model offering that can be used with the API. + properties: + id: + type: string + description: The model identifier, which can be referenced in the API endpoints. + created: + type: integer + description: The Unix timestamp (in seconds) when the model was created. + object: + type: string + description: The object type, which is always "model". + enum: [model] + owned_by: + type: string + description: The organization that owns the model. + required: + - id + - object + - created + - owned_by + x-oaiMeta: + name: The model object + example: *retrieve_model_response + + OpenAIFile: + title: OpenAIFile + description: The `File` object represents a document that has been uploaded to OpenAI. + properties: + id: + type: string + description: The file identifier, which can be referenced in the API endpoints. + bytes: + type: integer + description: The size of the file, in bytes. + created_at: + type: integer + description: The Unix timestamp (in seconds) for when the file was created. + filename: + type: string + description: The name of the file. + object: + type: string + description: The object type, which is always `file`. + enum: ["file"] + purpose: + type: string + description: The intended purpose of the file. Supported values are `fine-tune`, `fine-tune-results`, `assistants`, and `assistants_output`. + enum: + [ + "fine-tune", + "fine-tune-results", + "assistants", + "assistants_output", + ] + status: + type: string + deprecated: true + description: Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`. + enum: ["uploaded", "processed", "error"] + status_details: + type: string + deprecated: true + description: Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`. + required: + - id + - object + - bytes + - created_at + - filename + - purpose + - status + x-oaiMeta: + name: The File object + example: | + { + "id": "file-abc123", + "object": "file", + "bytes": 120000, + "created_at": 1677610602, + "filename": "salesOverview.pdf", + "purpose": "assistants", + } + Embedding: + type: object + description: | + Represents an embedding vector returned by embedding endpoint. + properties: + index: + type: integer + description: The index of the embedding in the list of embeddings. + embedding: + type: array + description: | + The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the [embedding guide](/docs/guides/embeddings). + items: + type: number + object: + type: string + description: The object type, which is always "embedding". + enum: [embedding] + required: + - index + - object + - embedding + x-oaiMeta: + name: The embedding object + example: | + { + "object": "embedding", + "embedding": [ + 0.0023064255, + -0.009327292, + .... (1536 floats total for ada-002) + -0.0028842222, + ], + "index": 0 + } + + FineTuningJob: + type: object + title: FineTuningJob + description: | + The `fine_tuning.job` object represents a fine-tuning job that has been created through the API. + properties: + id: + type: string + description: The object identifier, which can be referenced in the API endpoints. + created_at: + type: integer + description: The Unix timestamp (in seconds) for when the fine-tuning job was created. + error: + type: object + nullable: true + description: For fine-tuning jobs that have `failed`, this will contain more information on the cause of the failure. + properties: + code: + type: string + description: A machine-readable error code. + message: + type: string + description: A human-readable error message. + param: + type: string + description: The parameter that was invalid, usually `training_file` or `validation_file`. This field will be null if the failure was not parameter-specific. + nullable: true + required: + - code + - message + - param + fine_tuned_model: + type: string + nullable: true + description: The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running. + finished_at: + type: integer + nullable: true + description: The Unix timestamp (in seconds) for when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running. + hyperparameters: + type: object + description: The hyperparameters used for the fine-tuning job. See the [fine-tuning guide](/docs/guides/fine-tuning) for more details. + properties: + n_epochs: + oneOf: + - type: string + enum: [auto] + - type: integer + minimum: 1 + maximum: 50 + default: auto + description: + The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. + + "auto" decides the optimal number of epochs based on the size of the dataset. If setting the number manually, we support any number between 1 and 50 epochs. + required: + - n_epochs + model: + type: string + description: The base model that is being fine-tuned. + object: + type: string + description: The object type, which is always "fine_tuning.job". + enum: [fine_tuning.job] + organization_id: + type: string + description: The organization that owns the fine-tuning job. + result_files: + type: array + description: The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/docs/api-reference/files/retrieve-contents). + items: + type: string + example: file-abc123 + status: + type: string + description: The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`. + enum: + [ + "validating_files", + "queued", + "running", + "succeeded", + "failed", + "cancelled", + ] + trained_tokens: + type: integer + nullable: true + description: The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running. + training_file: + type: string + description: The file ID used for training. You can retrieve the training data with the [Files API](/docs/api-reference/files/retrieve-contents). + validation_file: + type: string + nullable: true + description: The file ID used for validation. You can retrieve the validation results with the [Files API](/docs/api-reference/files/retrieve-contents). + required: + - created_at + - error + - finished_at + - fine_tuned_model + - hyperparameters + - id + - model + - object + - organization_id + - result_files + - status + - trained_tokens + - training_file + - validation_file + x-oaiMeta: + name: The fine-tuning job object + example: *fine_tuning_example + + FineTuningJobEvent: + type: object + description: Fine-tuning job event object + properties: + id: + type: string + created_at: + type: integer + level: + type: string + enum: ["info", "warn", "error"] + message: + type: string + object: + type: string + enum: [fine_tuning.job.event] + required: + - id + - object + - created_at + - level + - message + x-oaiMeta: + name: The fine-tuning job event object + example: | + { + "object": "fine_tuning.job.event", + "id": "ftevent-abc123" + "created_at": 1677610602, + "level": "info", + "message": "Created fine-tuning job" + } + + FineTune: + type: object + deprecated: true + description: | + The `FineTune` object represents a legacy fine-tune job that has been created through the API. + properties: + id: + type: string + description: The object identifier, which can be referenced in the API endpoints. + created_at: + type: integer + description: The Unix timestamp (in seconds) for when the fine-tuning job was created. + events: + type: array + description: The list of events that have been observed in the lifecycle of the FineTune job. + items: + $ref: "#/components/schemas/FineTuneEvent" + fine_tuned_model: + type: string + nullable: true + description: The name of the fine-tuned model that is being created. + hyperparams: + type: object + description: The hyperparameters used for the fine-tuning job. See the [fine-tuning guide](/docs/guides/legacy-fine-tuning/hyperparameters) for more details. + properties: + batch_size: + type: integer + description: | + The batch size to use for training. The batch size is the number of + training examples used to train a single forward and backward pass. + classification_n_classes: + type: integer + description: | + The number of classes to use for computing classification metrics. + classification_positive_class: + type: string + description: | + The positive class to use for computing classification metrics. + compute_classification_metrics: + type: boolean + description: | + The classification metrics to compute using the validation dataset at the end of every epoch. + learning_rate_multiplier: + type: number + description: | + The learning rate multiplier to use for training. + n_epochs: + type: integer + description: | + The number of epochs to train the model for. An epoch refers to one + full cycle through the training dataset. + prompt_loss_weight: + type: number + description: | + The weight to use for loss on the prompt tokens. + required: + - batch_size + - learning_rate_multiplier + - n_epochs + - prompt_loss_weight + model: + type: string + description: The base model that is being fine-tuned. + object: + type: string + description: The object type, which is always "fine-tune". + enum: [fine-tune] + organization_id: + type: string + description: The organization that owns the fine-tuning job. + result_files: + type: array + description: The compiled results files for the fine-tuning job. + items: + $ref: "#/components/schemas/OpenAIFile" + status: + type: string + description: The current status of the fine-tuning job, which can be either `created`, `running`, `succeeded`, `failed`, or `cancelled`. + training_files: + type: array + description: The list of files used for training. + items: + $ref: "#/components/schemas/OpenAIFile" + updated_at: + type: integer + description: The Unix timestamp (in seconds) for when the fine-tuning job was last updated. + validation_files: + type: array + description: The list of files used for validation. + items: + $ref: "#/components/schemas/OpenAIFile" + required: + - created_at + - fine_tuned_model + - hyperparams + - id + - model + - object + - organization_id + - result_files + - status + - training_files + - updated_at + - validation_files + x-oaiMeta: + name: The fine-tune object + example: *fine_tune_example + + FineTuneEvent: + type: object + deprecated: true + description: Fine-tune event object + properties: + created_at: + type: integer + level: + type: string + message: + type: string + object: + type: string + enum: [fine-tune-event] + required: + - object + - created_at + - level + - message + x-oaiMeta: + name: The fine-tune event object + example: | + { + "object": "fine-tune-event", + "created_at": 1677610602, + "level": "info", + "message": "Created fine-tune job" + } + + CompletionUsage: + type: object + description: Usage statistics for the completion request. + properties: + completion_tokens: + type: integer + description: Number of tokens in the generated completion. + prompt_tokens: + type: integer + description: Number of tokens in the prompt. + total_tokens: + type: integer + description: Total number of tokens used in the request (prompt + completion). + required: + - prompt_tokens + - completion_tokens + - total_tokens + + AssistantObject: + type: object + title: Assistant + description: Represents an `assistant` that can call the model and use tools. + properties: + id: + description: The identifier, which can be referenced in API endpoints. + type: string + object: + description: The object type, which is always `assistant`. + type: string + enum: [assistant] + created_at: + description: The Unix timestamp (in seconds) for when the assistant was created. + type: integer + name: + description: &assistant_name_param_description | + The name of the assistant. The maximum length is 256 characters. + type: string + maxLength: 256 + nullable: true + description: + description: &assistant_description_param_description | + The description of the assistant. The maximum length is 512 characters. + type: string + maxLength: 512 + nullable: true + model: + description: *model_description + type: string + instructions: + description: &assistant_instructions_param_description | + The system instructions that the assistant uses. The maximum length is 32768 characters. + type: string + maxLength: 32768 + nullable: true + tools: + description: &assistant_tools_param_description | + A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`. + default: [] + type: array + maxItems: 128 + items: + oneOf: + - $ref: "#/components/schemas/AssistantToolsCode" + - $ref: "#/components/schemas/AssistantToolsRetrieval" + - $ref: "#/components/schemas/AssistantToolsFunction" + x-oaiExpandable: true + file_ids: + description: &assistant_file_param_description | + A list of [file](/docs/api-reference/files) IDs attached to this assistant. There can be a maximum of 20 files attached to the assistant. Files are ordered by their creation date in ascending order. + default: [] + type: array + maxItems: 20 + items: + type: string + metadata: + description: &metadata_description | + Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + type: object + x-oaiTypeLabel: map + nullable: true + required: + - id + - object + - created_at + - name + - description + - model + - instructions + - tools + - file_ids + - metadata + x-oaiMeta: + name: The assistant object + beta: true + example: *create_assistants_example + + CreateAssistantRequest: + type: object + additionalProperties: false + properties: + model: + description: *model_description + anyOf: + - type: string + name: + description: *assistant_name_param_description + type: string + nullable: true + maxLength: 256 + description: + description: *assistant_description_param_description + type: string + nullable: true + maxLength: 512 + instructions: + description: *assistant_instructions_param_description + type: string + nullable: true + maxLength: 32768 + tools: + description: *assistant_tools_param_description + default: [] + type: array + maxItems: 128 + items: + oneOf: + - $ref: "#/components/schemas/AssistantToolsCode" + - $ref: "#/components/schemas/AssistantToolsRetrieval" + - $ref: "#/components/schemas/AssistantToolsFunction" + x-oaiExpandable: true + file_ids: + description: *assistant_file_param_description + default: [] + maxItems: 20 + type: array + items: + type: string + metadata: + description: *metadata_description + type: object + x-oaiTypeLabel: map + nullable: true + required: + - model + + ModifyAssistantRequest: + type: object + additionalProperties: false + properties: + model: + description: *model_description + anyOf: + - type: string + name: + description: *assistant_name_param_description + type: string + nullable: true + maxLength: 256 + description: + description: *assistant_description_param_description + type: string + nullable: true + maxLength: 512 + instructions: + description: *assistant_instructions_param_description + type: string + nullable: true + maxLength: 32768 + tools: + description: *assistant_tools_param_description + default: [] + type: array + maxItems: 128 + items: + oneOf: + - $ref: "#/components/schemas/AssistantToolsCode" + - $ref: "#/components/schemas/AssistantToolsRetrieval" + - $ref: "#/components/schemas/AssistantToolsFunction" + x-oaiExpandable: true + file_ids: + description: | + A list of [File](/docs/api-reference/files) IDs attached to this assistant. There can be a maximum of 20 files attached to the assistant. Files are ordered by their creation date in ascending order. If a file was previously attached to the list but does not show up in the list, it will be deleted from the assistant. + default: [] + type: array + maxItems: 20 + items: + type: string + metadata: + description: *metadata_description + type: object + x-oaiTypeLabel: map + nullable: true + + DeleteAssistantResponse: + type: object + properties: + id: + type: string + deleted: + type: boolean + object: + type: string + enum: [assistant.deleted] + required: + - id + - object + - deleted + + ListAssistantsResponse: + type: object + properties: + object: + type: string + example: "list" + data: + type: array + items: + $ref: "#/components/schemas/AssistantObject" + first_id: + type: string + example: "asst_abc123" + last_id: + type: string + example: "asst_abc456" + has_more: + type: boolean + example: false + required: + - object + - data + - first_id + - last_id + - has_more + x-oaiMeta: + name: List assistants response object + group: chat + example: *list_assistants_example + + AssistantToolsCode: + type: object + title: Code interpreter tool + properties: + type: + type: string + description: "The type of tool being defined: `code_interpreter`" + enum: ["code_interpreter"] + required: + - type + + AssistantToolsRetrieval: + type: object + title: Retrieval tool + properties: + type: + type: string + description: "The type of tool being defined: `retrieval`" + enum: ["retrieval"] + required: + - type + + AssistantToolsFunction: + type: object + title: Function tool + properties: + type: + type: string + description: "The type of tool being defined: `function`" + enum: ["function"] + function: + $ref: "#/components/schemas/FunctionObject" + required: + - type + - function + + RunObject: + type: object + title: A run on a thread + description: Represents an execution run on a [thread](/docs/api-reference/threads). + properties: + id: + description: The identifier, which can be referenced in API endpoints. + type: string + object: + description: The object type, which is always `thread.run`. + type: string + enum: ["thread.run"] + created_at: + description: The Unix timestamp (in seconds) for when the run was created. + type: integer + thread_id: + description: The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. + type: string + assistant_id: + description: The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. + type: string + status: + description: The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, or `expired`. + type: string + enum: + [ + "queued", + "in_progress", + "requires_action", + "cancelling", + "cancelled", + "failed", + "completed", + "expired", + ] + required_action: + type: object + description: Details on the action required to continue the run. Will be `null` if no action is required. + nullable: true + properties: + type: + description: For now, this is always `submit_tool_outputs`. + type: string + enum: ["submit_tool_outputs"] + submit_tool_outputs: + type: object + description: Details on the tool outputs needed for this run to continue. + properties: + tool_calls: + type: array + description: A list of the relevant tool calls. + items: + $ref: "#/components/schemas/RunToolCallObject" + required: + - tool_calls + required: + - type + - submit_tool_outputs + last_error: + type: object + description: The last error associated with this run. Will be `null` if there are no errors. + nullable: true + properties: + code: + type: string + description: One of `server_error` or `rate_limit_exceeded`. + enum: ["server_error", "rate_limit_exceeded"] + message: + type: string + description: A human-readable description of the error. + required: + - code + - message + expires_at: + description: The Unix timestamp (in seconds) for when the run will expire. + type: integer + started_at: + description: The Unix timestamp (in seconds) for when the run was started. + type: integer + nullable: true + cancelled_at: + description: The Unix timestamp (in seconds) for when the run was cancelled. + type: integer + nullable: true + failed_at: + description: The Unix timestamp (in seconds) for when the run failed. + type: integer + nullable: true + completed_at: + description: The Unix timestamp (in seconds) for when the run was completed. + type: integer + nullable: true + model: + description: The model that the [assistant](/docs/api-reference/assistants) used for this run. + type: string + instructions: + description: The instructions that the [assistant](/docs/api-reference/assistants) used for this run. + type: string + tools: + description: The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. + default: [] + type: array + maxItems: 20 + items: + oneOf: + - $ref: "#/components/schemas/AssistantToolsCode" + - $ref: "#/components/schemas/AssistantToolsRetrieval" + - $ref: "#/components/schemas/AssistantToolsFunction" + x-oaiExpandable: true + file_ids: + description: The list of [File](/docs/api-reference/files) IDs the [assistant](/docs/api-reference/assistants) used for this run. + default: [] + type: array + items: + type: string + metadata: + description: *metadata_description + type: object + x-oaiTypeLabel: map + nullable: true + required: + - id + - object + - created_at + - thread_id + - assistant_id + - status + - required_action + - last_error + - expires_at + - started_at + - cancelled_at + - failed_at + - completed_at + - model + - instructions + - tools + - file_ids + - metadata + x-oaiMeta: + name: The run object + beta: true + example: | + { + "id": "run_abc123", + "object": "thread.run", + "created_at": 1698107661, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "completed", + "started_at": 1699073476, + "expires_at": null, + "cancelled_at": null, + "failed_at": null, + "completed_at": 1699073498, + "last_error": null, + "model": "gpt-4", + "instructions": null, + "tools": [{"type": "retrieval"}, {"type": "code_interpreter"}], + "file_ids": [], + "metadata": {} + } + CreateRunRequest: + type: object + additionalProperties: false + properties: + assistant_id: + description: The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run. + type: string + model: + description: The ID of the [Model](/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. + type: string + nullable: true + instructions: + description: Overrides the [instructions](/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis. + type: string + nullable: true + additional_instructions: + description: Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions. + type: string + nullable: true + tools: + description: Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. + nullable: true + type: array + maxItems: 20 + items: + oneOf: + - $ref: "#/components/schemas/AssistantToolsCode" + - $ref: "#/components/schemas/AssistantToolsRetrieval" + - $ref: "#/components/schemas/AssistantToolsFunction" + x-oaiExpandable: true + metadata: + description: *metadata_description + type: object + x-oaiTypeLabel: map + nullable: true + required: + - thread_id + - assistant_id + ListRunsResponse: + type: object + properties: + object: + type: string + example: "list" + data: + type: array + items: + $ref: "#/components/schemas/RunObject" + first_id: + type: string + example: "run_abc123" + last_id: + type: string + example: "run_abc456" + has_more: + type: boolean + example: false + required: + - object + - data + - first_id + - last_id + - has_more + ModifyRunRequest: + type: object + additionalProperties: false + properties: + metadata: + description: *metadata_description + type: object + x-oaiTypeLabel: map + nullable: true + SubmitToolOutputsRunRequest: + type: object + additionalProperties: false + properties: + tool_outputs: + description: A list of tools for which the outputs are being submitted. + type: array + items: + type: object + properties: + tool_call_id: + type: string + description: The ID of the tool call in the `required_action` object within the run object the output is being submitted for. + output: + type: string + description: The output of the tool call to be submitted to continue the run. + required: + - tool_outputs + + RunToolCallObject: + type: object + description: Tool call objects + properties: + id: + type: string + description: The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. + type: + type: string + description: The type of tool call the output is required for. For now, this is always `function`. + enum: ["function"] + function: + type: object + description: The function definition. + properties: + name: + type: string + description: The name of the function. + arguments: + type: string + description: The arguments that the model expects you to pass to the function. + required: + - name + - arguments + required: + - id + - type + - function + + CreateThreadAndRunRequest: + type: object + additionalProperties: false + properties: + assistant_id: + description: The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run. + type: string + thread: + $ref: "#/components/schemas/CreateThreadRequest" + description: If no thread is provided, an empty thread will be created. + model: + description: The ID of the [Model](/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. + type: string + nullable: true + instructions: + description: Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. + type: string + nullable: true + tools: + description: Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. + nullable: true + type: array + maxItems: 20 + items: + oneOf: + - $ref: "#/components/schemas/AssistantToolsCode" + - $ref: "#/components/schemas/AssistantToolsRetrieval" + - $ref: "#/components/schemas/AssistantToolsFunction" + metadata: + description: *metadata_description + type: object + x-oaiTypeLabel: map + nullable: true + required: + - thread_id + - assistant_id + + ThreadObject: + type: object + title: Thread + description: Represents a thread that contains [messages](/docs/api-reference/messages). + properties: + id: + description: The identifier, which can be referenced in API endpoints. + type: string + object: + description: The object type, which is always `thread`. + type: string + enum: ["thread"] + created_at: + description: The Unix timestamp (in seconds) for when the thread was created. + type: integer + metadata: + description: *metadata_description + type: object + x-oaiTypeLabel: map + nullable: true + required: + - id + - object + - created_at + - metadata + x-oaiMeta: + name: The thread object + beta: true + example: | + { + "id": "thread_abc123", + "object": "thread", + "created_at": 1698107661, + "metadata": {} + } + + CreateThreadRequest: + type: object + additionalProperties: false + properties: + messages: + description: A list of [messages](/docs/api-reference/messages) to start the thread with. + type: array + items: + $ref: "#/components/schemas/CreateMessageRequest" + metadata: + description: *metadata_description + type: object + x-oaiTypeLabel: map + nullable: true + + ModifyThreadRequest: + type: object + additionalProperties: false + properties: + metadata: + description: *metadata_description + type: object + x-oaiTypeLabel: map + nullable: true + + DeleteThreadResponse: + type: object + properties: + id: + type: string + deleted: + type: boolean + object: + type: string + enum: [thread.deleted] + required: + - id + - object + - deleted + + ListThreadsResponse: + properties: + object: + type: string + example: "list" + data: + type: array + items: + $ref: "#/components/schemas/ThreadObject" + first_id: + type: string + example: "asst_abc123" + last_id: + type: string + example: "asst_abc456" + has_more: + type: boolean + example: false + required: + - object + - data + - first_id + - last_id + - has_more + + MessageObject: + type: object + title: The message object + description: Represents a message within a [thread](/docs/api-reference/threads). + properties: + id: + description: The identifier, which can be referenced in API endpoints. + type: string + object: + description: The object type, which is always `thread.message`. + type: string + enum: ["thread.message"] + created_at: + description: The Unix timestamp (in seconds) for when the message was created. + type: integer + thread_id: + description: The [thread](/docs/api-reference/threads) ID that this message belongs to. + type: string + role: + description: The entity that produced the message. One of `user` or `assistant`. + type: string + enum: ["user", "assistant"] + content: + description: The content of the message in array of text and/or images. + type: array + items: + oneOf: + - $ref: "#/components/schemas/MessageContentImageFileObject" + - $ref: "#/components/schemas/MessageContentTextObject" + x-oaiExpandable: true + assistant_id: + description: If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. + type: string + nullable: true + run_id: + description: If applicable, the ID of the [run](/docs/api-reference/runs) associated with the authoring of this message. + type: string + nullable: true + file_ids: + description: A list of [file](/docs/api-reference/files) IDs that the assistant should use. Useful for tools like retrieval and code_interpreter that can access files. A maximum of 10 files can be attached to a message. + default: [] + maxItems: 10 + type: array + items: + type: string + metadata: + description: *metadata_description + type: object + x-oaiTypeLabel: map + nullable: true + required: + - id + - object + - created_at + - thread_id + - role + - content + - assistant_id + - run_id + - file_ids + - metadata + x-oaiMeta: + name: The message object + beta: true + example: | + { + "id": "msg_abc123", + "object": "thread.message", + "created_at": 1698983503, + "thread_id": "thread_abc123", + "role": "assistant", + "content": [ + { + "type": "text", + "text": { + "value": "Hi! How can I help you today?", + "annotations": [] + } + } + ], + "file_ids": [], + "assistant_id": "asst_abc123", + "run_id": "run_abc123", + "metadata": {} + } + + CreateMessageRequest: + type: object + additionalProperties: false + required: + - role + - content + properties: + role: + type: string + enum: ["user"] + description: The role of the entity that is creating the message. Currently only `user` is supported. + content: + type: string + minLength: 1 + maxLength: 32768 + description: The content of the message. + file_ids: + description: A list of [File](/docs/api-reference/files) IDs that the message should use. There can be a maximum of 10 files attached to a message. Useful for tools like `retrieval` and `code_interpreter` that can access and use files. + default: [] + type: array + minItems: 1 + maxItems: 10 + items: + type: string + metadata: + description: *metadata_description + type: object + x-oaiTypeLabel: map + nullable: true + + ModifyMessageRequest: + type: object + additionalProperties: false + properties: + metadata: + description: *metadata_description + type: object + x-oaiTypeLabel: map + nullable: true + + DeleteMessageResponse: + type: object + properties: + id: + type: string + deleted: + type: boolean + object: + type: string + enum: [thread.message.deleted] + required: + - id + - object + - deleted + + ListMessagesResponse: + properties: + object: + type: string + example: "list" + data: + type: array + items: + $ref: "#/components/schemas/MessageObject" + first_id: + type: string + example: "msg_abc123" + last_id: + type: string + example: "msg_abc123" + has_more: + type: boolean + example: false + required: + - object + - data + - first_id + - last_id + - has_more + + MessageContentImageFileObject: + title: Image file + type: object + description: References an image [File](/docs/api-reference/files) in the content of a message. + properties: + type: + description: Always `image_file`. + type: string + enum: ["image_file"] + image_file: + type: object + properties: + file_id: + description: The [File](/docs/api-reference/files) ID of the image in the message content. + type: string + required: + - file_id + required: + - type + - image_file + + MessageContentTextObject: + title: Text + type: object + description: The text content that is part of a message. + properties: + type: + description: Always `text`. + type: string + enum: ["text"] + text: + type: object + properties: + value: + description: The data that makes up the text. + type: string + annotations: + type: array + items: + oneOf: + - $ref: "#/components/schemas/MessageContentTextAnnotationsFileCitationObject" + - $ref: "#/components/schemas/MessageContentTextAnnotationsFilePathObject" + x-oaiExpandable: true + required: + - value + - annotations + required: + - type + - text + + MessageContentTextAnnotationsFileCitationObject: + title: File citation + type: object + description: A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "retrieval" tool to search files. + properties: + type: + description: Always `file_citation`. + type: string + enum: ["file_citation"] + text: + description: The text in the message content that needs to be replaced. + type: string + file_citation: + type: object + properties: + file_id: + description: The ID of the specific File the citation is from. + type: string + quote: + description: The specific quote in the file. + type: string + required: + - file_id + - quote + start_index: + type: integer + minimum: 0 + end_index: + type: integer + minimum: 0 + required: + - type + - text + - file_citation + - start_index + - end_index + + MessageContentTextAnnotationsFilePathObject: + title: File path + type: object + description: A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. + properties: + type: + description: Always `file_path`. + type: string + enum: ["file_path"] + text: + description: The text in the message content that needs to be replaced. + type: string + file_path: + type: object + properties: + file_id: + description: The ID of the file that was generated. + type: string + required: + - file_id + start_index: + type: integer + minimum: 0 + end_index: + type: integer + minimum: 0 + required: + - type + - text + - file_path + - start_index + - end_index + + RunStepObject: + type: object + title: Run steps + description: | + Represents a step in execution of a run. + properties: + id: + description: The identifier of the run step, which can be referenced in API endpoints. + type: string + object: + description: The object type, which is always `thread.run.step`. + type: string + enum: ["thread.run.step"] + created_at: + description: The Unix timestamp (in seconds) for when the run step was created. + type: integer + assistant_id: + description: The ID of the [assistant](/docs/api-reference/assistants) associated with the run step. + type: string + thread_id: + description: The ID of the [thread](/docs/api-reference/threads) that was run. + type: string + run_id: + description: The ID of the [run](/docs/api-reference/runs) that this run step is a part of. + type: string + type: + description: The type of run step, which can be either `message_creation` or `tool_calls`. + type: string + enum: ["message_creation", "tool_calls"] + status: + description: The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. + type: string + enum: ["in_progress", "cancelled", "failed", "completed", "expired"] + step_details: + type: object + description: The details of the run step. + oneOf: + - $ref: "#/components/schemas/RunStepDetailsMessageCreationObject" + - $ref: "#/components/schemas/RunStepDetailsToolCallsObject" + x-oaiExpandable: true + last_error: + type: object + description: The last error associated with this run step. Will be `null` if there are no errors. + nullable: true + properties: + code: + type: string + description: One of `server_error` or `rate_limit_exceeded`. + enum: ["server_error", "rate_limit_exceeded"] + message: + type: string + description: A human-readable description of the error. + required: + - code + - message + expired_at: + description: The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. + type: integer + nullable: true + cancelled_at: + description: The Unix timestamp (in seconds) for when the run step was cancelled. + type: integer + nullable: true + failed_at: + description: The Unix timestamp (in seconds) for when the run step failed. + type: integer + nullable: true + completed_at: + description: The Unix timestamp (in seconds) for when the run step completed. + type: integer + nullable: true + metadata: + description: *metadata_description + type: object + x-oaiTypeLabel: map + nullable: true + required: + - id + - object + - created_at + - assistant_id + - thread_id + - run_id + - type + - status + - step_details + - last_error + - expired_at + - cancelled_at + - failed_at + - completed_at + - metadata + x-oaiMeta: + name: The run step object + beta: true + example: *run_step_object_example + + ListRunStepsResponse: + properties: + object: + type: string + example: "list" + data: + type: array + items: + $ref: "#/components/schemas/RunStepObject" + first_id: + type: string + example: "step_abc123" + last_id: + type: string + example: "step_abc456" + has_more: + type: boolean + example: false + required: + - object + - data + - first_id + - last_id + - has_more + + RunStepDetailsMessageCreationObject: + title: Message creation + type: object + description: Details of the message creation by the run step. + properties: + type: + description: Always `message_creation`. + type: string + enum: ["message_creation"] + message_creation: + type: object + properties: + message_id: + type: string + description: The ID of the message that was created by this run step. + required: + - message_id + required: + - type + - message_creation + + RunStepDetailsToolCallsObject: + title: Tool calls + type: object + description: Details of the tool call. + properties: + type: + description: Always `tool_calls`. + type: string + enum: ["tool_calls"] + tool_calls: + type: array + description: | + An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `retrieval`, or `function`. + items: + type: object + oneOf: + - $ref: "#/components/schemas/RunStepDetailsToolCallsCodeObject" + - $ref: "#/components/schemas/RunStepDetailsToolCallsRetrievalObject" + - $ref: "#/components/schemas/RunStepDetailsToolCallsFunctionObject" + x-oaiExpandable: true + required: + - type + - tool_calls + + RunStepDetailsToolCallsCodeObject: + title: Code interpreter tool call + type: object + description: Details of the Code Interpreter tool call the run step was involved in. + properties: + id: + type: string + description: The ID of the tool call. + type: + type: string + description: The type of tool call. This is always going to be `code_interpreter` for this type of tool call. + enum: ["code_interpreter"] + code_interpreter: + type: object + description: The Code Interpreter tool call definition. + required: + - input + - outputs + properties: + input: + type: string + description: The input to the Code Interpreter tool call. + outputs: + type: array + description: The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. + items: + type: object + oneOf: + - $ref: "#/components/schemas/RunStepDetailsToolCallsCodeOutputLogsObject" + - $ref: "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject" + x-oaiExpandable: true + required: + - id + - type + - code_interpreter + + RunStepDetailsToolCallsCodeOutputLogsObject: + title: Code interpreter log output + type: object + description: Text output from the Code Interpreter tool call as part of a run step. + properties: + type: + description: Always `logs`. + type: string + enum: ["logs"] + logs: + type: string + description: The text output from the Code Interpreter tool call. + required: + - type + - logs + + RunStepDetailsToolCallsCodeOutputImageObject: + title: Code interpreter image output + type: object + properties: + type: + description: Always `image`. + type: string + enum: ["image"] + image: + type: object + properties: + file_id: + description: The [file](/docs/api-reference/files) ID of the image. + type: string + required: + - file_id + required: + - type + - image + + RunStepDetailsToolCallsRetrievalObject: + title: Retrieval tool call + type: object + properties: + id: + type: string + description: The ID of the tool call object. + type: + type: string + description: The type of tool call. This is always going to be `retrieval` for this type of tool call. + enum: ["retrieval"] + retrieval: + type: object + description: For now, this is always going to be an empty object. + x-oaiTypeLabel: map + required: + - id + - type + - retrieval + + RunStepDetailsToolCallsFunctionObject: + type: object + title: Function tool call + properties: + id: + type: string + description: The ID of the tool call object. + type: + type: string + description: The type of tool call. This is always going to be `function` for this type of tool call. + enum: ["function"] + function: + type: object + description: The definition of the function that was called. + properties: + name: + type: string + description: The name of the function. + arguments: + type: string + description: The arguments passed to the function. + output: + type: string + description: The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. + nullable: true + required: + - name + - arguments + - output + required: + - id + - type + - function + + AssistantFileObject: + type: object + title: Assistant files + description: A list of [Files](/docs/api-reference/files) attached to an `assistant`. + properties: + id: + description: The identifier, which can be referenced in API endpoints. + type: string + object: + description: The object type, which is always `assistant.file`. + type: string + enum: [assistant.file] + created_at: + description: The Unix timestamp (in seconds) for when the assistant file was created. + type: integer + assistant_id: + description: The assistant ID that the file is attached to. + type: string + required: + - id + - object + - created_at + - assistant_id + x-oaiMeta: + name: The assistant file object + beta: true + example: | + { + "id": "file-abc123", + "object": "assistant.file", + "created_at": 1699055364, + "assistant_id": "asst_abc123" + } + + CreateAssistantFileRequest: + type: object + additionalProperties: false + properties: + file_id: + description: A [File](/docs/api-reference/files) ID (with `purpose="assistants"`) that the assistant should use. Useful for tools like `retrieval` and `code_interpreter` that can access files. + type: string + required: + - file_id + + DeleteAssistantFileResponse: + type: object + description: Deletes the association between the assistant and the file, but does not delete the [File](/docs/api-reference/files) object itself. + properties: + id: + type: string + deleted: + type: boolean + object: + type: string + enum: [assistant.file.deleted] + required: + - id + - object + - deleted + ListAssistantFilesResponse: + properties: + object: + type: string + example: "list" + data: + type: array + items: + $ref: "#/components/schemas/AssistantFileObject" + first_id: + type: string + example: "file-abc123" + last_id: + type: string + example: "file-abc456" + has_more: + type: boolean + example: false + required: + - object + - data + - items + - first_id + - last_id + - has_more + + MessageFileObject: + type: object + title: Message files + description: A list of files attached to a `message`. + properties: + id: + description: The identifier, which can be referenced in API endpoints. + type: string + object: + description: The object type, which is always `thread.message.file`. + type: string + enum: ["thread.message.file"] + created_at: + description: The Unix timestamp (in seconds) for when the message file was created. + type: integer + message_id: + description: The ID of the [message](/docs/api-reference/messages) that the [File](/docs/api-reference/files) is attached to. + type: string + required: + - id + - object + - created_at + - message_id + x-oaiMeta: + name: The message file object + beta: true + example: | + { + "id": "file-abc123", + "object": "thread.message.file", + "created_at": 1698107661, + "message_id": "message_QLoItBbqwyAJEzlTy4y9kOMM", + "file_id": "file-abc123" + } + + ListMessageFilesResponse: + properties: + object: + type: string + example: "list" + data: + type: array + items: + $ref: "#/components/schemas/MessageFileObject" + first_id: + type: string + example: "file-abc123" + last_id: + type: string + example: "file-abc456" + has_more: + type: boolean + example: false + required: + - object + - data + - items + - first_id + - last_id + - has_more + +security: + - ApiKeyAuth: [] +x-oaiMeta: + groups: + # > General Notes + # The `groups` section is used to generate the API reference pages and navigation, in the same + # order listed below. Additionally, each `group` can have a list of `sections`, each of which + # will become a navigation subroute and subsection under the group. Each section has: + # - `type`: Currently, either an `endpoint` or `object`, depending on how the section needs to + # be rendered + # - `key`: The reference key that can be used to lookup the section definition + # - `path`: The path (url) of the section, which is used to generate the navigation link. + # + # > The `object` sections maps to a schema component and the following fields are read for rendering + # - `x-oaiMeta.name`: The name of the object, which will become the section title + # - `x-oaiMeta.example`: The example object, which will be used to generate the example sample (always JSON) + # - `description`: The description of the object, which will be used to generate the section description + # + # > The `endpoint` section maps to an operation path and the following fields are read for rendering: + # - `x-oaiMeta.name`: The name of the endpoint, which will become the section title + # - `x-oaiMeta.examples`: The endpoint examples, which can be an object (meaning a single variation, most + # endpoints, or an array of objects, meaning multiple variations, e.g. the + # chat completion and completion endpoints, with streamed and non-streamed examples. + # - `x-oaiMeta.returns`: text describing what the endpoint returns. + # - `summary`: The summary of the endpoint, which will be used to generate the section description + - id: audio + title: Audio + description: | + Learn how to turn audio into text or text into audio. + + Related guide: [Speech to text](/docs/guides/speech-to-text) + sections: + - type: endpoint + key: createSpeech + path: createSpeech + - type: endpoint + key: createTranscription + path: createTranscription + - type: endpoint + key: createTranslation + path: createTranslation + - id: chat + title: Chat + description: | + Given a list of messages comprising a conversation, the model will return a response. + + Related guide: [Chat Completions](/docs/guides/text-generation) + sections: + - type: object + key: CreateChatCompletionResponse + path: object + - type: object + key: CreateChatCompletionStreamResponse + path: streaming + - type: endpoint + key: createChatCompletion + path: create + - id: embeddings + title: Embeddings + description: | + Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms. + + Related guide: [Embeddings](/docs/guides/embeddings) + sections: + - type: object + key: Embedding + path: object + - type: endpoint + key: createEmbedding + path: create + - id: fine-tuning + title: Fine-tuning + description: | + Manage fine-tuning jobs to tailor a model to your specific training data. + + Related guide: [Fine-tune models](/docs/guides/fine-tuning) + sections: + - type: object + key: FineTuningJob + path: object + - type: endpoint + key: createFineTuningJob + path: create + - type: endpoint + key: listPaginatedFineTuningJobs + path: list + - type: endpoint + key: retrieveFineTuningJob + path: retrieve + - type: endpoint + key: cancelFineTuningJob + path: cancel + - type: object + key: FineTuningJobEvent + path: event-object + - type: endpoint + key: listFineTuningEvents + path: list-events + - id: files + title: Files + description: | + Files are used to upload documents that can be used with features like [Assistants](/docs/api-reference/assistants) and [Fine-tuning](/docs/api-reference/fine-tuning). + sections: + - type: object + key: OpenAIFile + path: object + - type: endpoint + key: listFiles + path: list + - type: endpoint + key: createFile + path: create + - type: endpoint + key: deleteFile + path: delete + - type: endpoint + key: retrieveFile + path: retrieve + - type: endpoint + key: downloadFile + path: retrieve-contents + - id: images + title: Images + description: | + Given a prompt and/or an input image, the model will generate a new image. + + Related guide: [Image generation](/docs/guides/images) + sections: + - type: object + key: Image + path: object + - type: endpoint + key: createImage + path: create + - type: endpoint + key: createImageEdit + path: createEdit + - type: endpoint + key: createImageVariation + path: createVariation + - id: models + title: Models + description: | + List and describe the various models available in the API. You can refer to the [Models](/docs/models) documentation to understand what models are available and the differences between them. + sections: + - type: object + key: Model + path: object + - type: endpoint + key: listModels + path: list + - type: endpoint + key: retrieveModel + path: retrieve + - type: endpoint + key: deleteModel + path: delete + - id: moderations + title: Moderations + description: | + Given a input text, outputs if the model classifies it as violating OpenAI's content policy. + + Related guide: [Moderations](/docs/guides/moderation) + sections: + - type: object + key: CreateModerationResponse + path: object + - type: endpoint + key: createModeration + path: create + - id: assistants + title: Assistants + beta: true + description: | + Build assistants that can call models and use tools to perform tasks. + + [Get started with the Assistants API](/docs/assistants) + sections: + - type: object + key: AssistantObject + path: object + - type: endpoint + key: createAssistant + path: createAssistant + - type: endpoint + key: getAssistant + path: getAssistant + - type: endpoint + key: modifyAssistant + path: modifyAssistant + - type: endpoint + key: deleteAssistant + path: deleteAssistant + - type: endpoint + key: listAssistants + path: listAssistants + - type: object + key: AssistantFileObject + path: file-object + - type: endpoint + key: createAssistantFile + path: createAssistantFile + - type: endpoint + key: getAssistantFile + path: getAssistantFile + - type: endpoint + key: deleteAssistantFile + path: deleteAssistantFile + - type: endpoint + key: listAssistantFiles + path: listAssistantFiles + - id: threads + title: Threads + beta: true + description: | + Create threads that assistants can interact with. + + Related guide: [Assistants](/docs/assistants/overview) + sections: + - type: object + key: ThreadObject + path: object + - type: endpoint + key: createThread + path: createThread + - type: endpoint + key: getThread + path: getThread + - type: endpoint + key: modifyThread + path: modifyThread + - type: endpoint + key: deleteThread + path: deleteThread + - id: messages + title: Messages + beta: true + description: | + Create messages within threads + + Related guide: [Assistants](/docs/assistants/overview) + sections: + - type: object + key: MessageObject + path: object + - type: endpoint + key: createMessage + path: createMessage + - type: endpoint + key: getMessage + path: getMessage + - type: endpoint + key: modifyMessage + path: modifyMessage + - type: endpoint + key: listMessages + path: listMessages + - type: object + key: MessageFileObject + path: file-object + - type: endpoint + key: getMessageFile + path: getMessageFile + - type: endpoint + key: listMessageFiles + path: listMessageFiles + - id: runs + title: Runs + beta: true + description: | + Represents an execution run on a thread. + + Related guide: [Assistants](/docs/assistants/overview) + sections: + - type: object + key: RunObject + path: object + - type: endpoint + key: createRun + path: createRun + - type: endpoint + key: getRun + path: getRun + - type: endpoint + key: modifyRun + path: modifyRun + - type: endpoint + key: listRuns + path: listRuns + - type: endpoint + key: submitToolOuputsToRun + path: submitToolOutputs + - type: endpoint + key: cancelRun + path: cancelRun + - type: endpoint + key: createThreadAndRun + path: createThreadAndRun + - type: object + key: RunStepObject + path: step-object + - type: endpoint + key: getRunStep + path: getRunStep + - type: endpoint + key: listRunSteps + path: listRunSteps + - id: completions + title: Completions + legacy: true + description: | + Given a prompt, the model will return one or more predicted completions along with the probabilities of alternative tokens at each position. Most developer should use our [Chat Completions API](/docs/guides/text-generation/text-generation-models) to leverage our best and newest models. Most models that support the legacy Completions endpoint [will be shut off on January 4th, 2024](/docs/deprecations/2023-07-06-gpt-and-embeddings). + sections: + - type: object + key: CreateCompletionResponse + path: object + - type: endpoint + key: createCompletion + path: create + - id: edits + title: Edits + deprecated: true + description: | + Given a prompt and an instruction, the model will return an edited version of the prompt. The Edits endpoint is deprecated will be [shut off on January 4th, 2024](/docs/deprecations/edit-models-endpoint). + sections: + - type: object + key: CreateEditResponse + path: object + - type: endpoint + key: createEdit + path: create + - id: fine-tunes + title: Fine-tunes + deprecated: true + description: | + Manage fine-tuning jobs to tailor a model to your specific training data. The [updated Fine-tuning endpoint](/docs/guides/fine-tuning) offers more capabilites and newer models. + + The Fine-tunes endpoint will be [shut off on January 4th, 2024](/docs/deprecations/2023-08-22-fine-tunes-endpoint). + sections: + - type: object + key: FineTune + path: object + - type: endpoint + key: createFineTune + path: create + - type: endpoint + key: listFineTunes + path: list + - type: endpoint + key: retrieveFineTune + path: retrieve + - type: endpoint + key: cancelFineTune + path: cancel + - type: object + key: FineTuneEvent + path: event-object + - type: endpoint + key: listFineTuneEvents + path: list-events \ No newline at end of file diff --git a/src/tests/OpenApiGenerator.UnitTests/Snapshots/Ollama/_.verified.txt b/src/tests/OpenApiGenerator.UnitTests/Snapshots/Ollama/_.verified.txt new file mode 100644 index 0000000000..8728a9c5ba --- /dev/null +++ b/src/tests/OpenApiGenerator.UnitTests/Snapshots/Ollama/_.verified.txt @@ -0,0 +1,1610 @@ +[ + { + Id: GenerateCompletionRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: model, + Name: Model, + Type: string, + IsRequired: true, + Summary: +The model name. + +Model names follow a `model:tag` format. Some examples are `orca-mini:3b-q4_1` and `llama2:70b`. The tag is optional and, if not provided, will default to `latest`. The tag is used to identify a specific version. + +
Example: llama2:7b + }, + { + Id: prompt, + Name: Prompt, + Type: string, + IsRequired: true, + Summary: +The prompt to generate a response. +
Example: Why is the sky blue? + }, + { + Id: images, + Name: Images, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + Summary: (optional) a list of Base64-encoded images to include in the message (for multimodal models such as llava) + }, + { + Id: system, + Name: System, + Type: string?, + IsRequired: false, + Summary: The system prompt to (overrides what is defined in the Modelfile). + }, + { + Id: template, + Name: Template, + Type: string?, + IsRequired: false, + Summary: The full prompt or prompt template (overrides what is defined in the Modelfile). + }, + { + Id: context, + Name: Context, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + Summary: The context parameter returned from a previous request to [generateCompletion], this can be used to keep a short conversational memory. + }, + { + Id: options, + Name: Options, + Type: RequestOptions?, + IsRequired: false, + Summary: Additional model parameters listed in the documentation for the Modelfile such as `temperature`. + }, + { + Id: format, + Name: Format, + Type: GenerateCompletionRequestFormat?, + IsRequired: false, + Summary: +The format to return a response in. Currently the only accepted value is json. + +Enable JSON mode by setting the format parameter to json. This will structure the response as valid JSON. + +Note: it's important to instruct the model to use JSON in the prompt. Otherwise, the model may generate large amounts whitespace. + + }, + { + Id: raw, + Name: Raw, + Type: bool, + IsRequired: false, + Summary: +If `true` no formatting will be applied to the prompt and no context will be returned. + +You may choose to use the `raw` parameter if you are specifying a full templated prompt in your request to the API, and are managing history yourself. + + }, + { + Id: stream, + Name: Stream, + Type: bool, + IsRequired: false, + DefaultValue: false, + Summary: +If `false` the response will be returned as a single response object, otherwise the response will be streamed as a series of objects. + +
Default Value: false + }, + { + Id: keep_alive, + Name: KeepAlive, + Type: int, + IsRequired: false, + Summary: +How long (in minutes) to keep the model loaded in memory. + +- If set to a positive duration (e.g. 20), the model will stay loaded for the provided duration. +- If set to a negative duration (e.g. -1), the model will stay loaded indefinitely. +- If set to 0, the model will be unloaded immediately once finished. +- If not set, the model will stay loaded for 5 minutes by default + + } + ], + Summary: Request class for the generate endpoint., + AdditionalModels: null, + Enumerations: null, + Name: GenerateCompletionRequest, + ClassName: GenerateCompletionRequest, + ExternalClassName: GenerateCompletionRequest, + FileNameWithoutExtension: G.Models.GenerateCompletionRequest + }, + { + Id: format, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: json, + Name: Json, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +The format to return a response in. Currently the only accepted value is json. + +Enable JSON mode by setting the format parameter to json. This will structure the response as valid JSON. + +Note: it's important to instruct the model to use JSON in the prompt. Otherwise, the model may generate large amounts whitespace. +, + AdditionalModels: null, + Enumerations: null, + Name: Format, + ClassName: Format, + ExternalClassName: Format, + FileNameWithoutExtension: G.Models.Format + }, + { + Id: RequestOptions, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: num_keep, + Name: NumKeep, + Type: int, + IsRequired: false, + Summary: +Number of tokens to keep from the prompt. + + }, + { + Id: seed, + Name: Seed, + Type: int, + IsRequired: false, + Summary: +Sets the random number seed to use for generation. Setting this to a specific number will make the model generate the same text for the same prompt. (Default: 0) + + }, + { + Id: num_predict, + Name: NumPredict, + Type: int, + IsRequired: false, + Summary: +Maximum number of tokens to predict when generating text. (Default: 128, -1 = infinite generation, -2 = fill context) + + }, + { + Id: top_k, + Name: TopK, + Type: int, + IsRequired: false, + Summary: +Reduces the probability of generating nonsense. A higher value (e.g. 100) will give more diverse answers, while a lower value (e.g. 10) will be more conservative. (Default: 40) + + }, + { + Id: top_p, + Name: TopP, + Type: float, + IsRequired: false, + Summary: +Works together with top-k. A higher value (e.g., 0.95) will lead to more diverse text, while a lower value (e.g., 0.5) will generate more focused and conservative text. (Default: 0.9) + + }, + { + Id: tfs_z, + Name: TfsZ, + Type: float, + IsRequired: false, + Summary: +Tail free sampling is used to reduce the impact of less probable tokens from the output. A higher value (e.g., 2.0) will reduce the impact more, while a value of 1.0 disables this setting. (default: 1) + + }, + { + Id: typical_p, + Name: TypicalP, + Type: float, + IsRequired: false, + Summary: +Typical p is used to reduce the impact of less probable tokens from the output. + + }, + { + Id: repeat_last_n, + Name: RepeatLastN, + Type: int, + IsRequired: false, + Summary: +Sets how far back for the model to look back to prevent repetition. (Default: 64, 0 = disabled, -1 = num_ctx) + + }, + { + Id: temperature, + Name: Temperature, + Type: float, + IsRequired: false, + Summary: +The temperature of the model. Increasing the temperature will make the model answer more creatively. (Default: 0.8) + + }, + { + Id: repeat_penalty, + Name: RepeatPenalty, + Type: float, + IsRequired: false, + Summary: +Sets how strongly to penalize repetitions. A higher value (e.g., 1.5) will penalize repetitions more strongly, while a lower value (e.g., 0.9) will be more lenient. (Default: 1.1) + + }, + { + Id: presence_penalty, + Name: PresencePenalty, + Type: float, + IsRequired: false, + Summary: +Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + + }, + { + Id: frequency_penalty, + Name: FrequencyPenalty, + Type: float, + IsRequired: false, + Summary: +Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + + }, + { + Id: mirostat, + Name: Mirostat, + Type: int, + IsRequired: false, + Summary: +Enable Mirostat sampling for controlling perplexity. (default: 0, 0 = disabled, 1 = Mirostat, 2 = Mirostat 2.0) + + }, + { + Id: mirostat_tau, + Name: MirostatTau, + Type: float, + IsRequired: false, + Summary: +Controls the balance between coherence and diversity of the output. A lower value will result in more focused and coherent text. (Default: 5.0) + + }, + { + Id: mirostat_eta, + Name: MirostatEta, + Type: float, + IsRequired: false, + Summary: +Influences how quickly the algorithm responds to feedback from the generated text. A lower learning rate will result in slower adjustments, while a higher learning rate will make the algorithm more responsive. (Default: 0.1) + + }, + { + Id: penalize_newline, + Name: PenalizeNewline, + Type: bool, + IsRequired: false, + Summary: +Penalize newlines in the output. (Default: false) + + }, + { + Id: stop, + Name: Stop, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + Summary: Sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. + }, + { + Id: numa, + Name: Numa, + Type: bool, + IsRequired: false, + Summary: +Enable NUMA support. (Default: false) + + }, + { + Id: num_ctx, + Name: NumCtx, + Type: int, + IsRequired: false, + Summary: +Sets the size of the context window used to generate the next token. + + }, + { + Id: num_batch, + Name: NumBatch, + Type: int, + IsRequired: false, + Summary: +Sets the number of batches to use for generation. (Default: 1) + + }, + { + Id: num_gqa, + Name: NumGqa, + Type: int, + IsRequired: false, + Summary: +The number of GQA groups in the transformer layer. Required for some models, for example it is 8 for `llama2:70b`. + + }, + { + Id: num_gpu, + Name: NumGpu, + Type: int, + IsRequired: false, + Summary: +The number of layers to send to the GPU(s). On macOS it defaults to 1 to enable metal support, 0 to disable. + + }, + { + Id: main_gpu, + Name: MainGpu, + Type: int, + IsRequired: false, + Summary: +The GPU to use for the main model. Default is 0. + + }, + { + Id: low_vram, + Name: LowVram, + Type: bool, + IsRequired: false, + Summary: +Enable low VRAM mode. (Default: false) + + }, + { + Id: f16_kv, + Name: F16Kv, + Type: bool, + IsRequired: false, + Summary: +Enable f16 key/value. (Default: false) + + }, + { + Id: logits_all, + Name: LogitsAll, + Type: bool, + IsRequired: false, + Summary: +Enable logits all. (Default: false) + + }, + { + Id: vocab_only, + Name: VocabOnly, + Type: bool, + IsRequired: false, + Summary: +Enable vocab only. (Default: false) + + }, + { + Id: use_mmap, + Name: UseMmap, + Type: bool, + IsRequired: false, + Summary: +Enable mmap. (Default: false) + + }, + { + Id: use_mlock, + Name: UseMlock, + Type: bool, + IsRequired: false, + Summary: +Enable mlock. (Default: false) + + }, + { + Id: embedding_only, + Name: EmbeddingOnly, + Type: bool, + IsRequired: false, + Summary: +Enable embedding only. (Default: false) + + }, + { + Id: rope_frequency_base, + Name: RopeFrequencyBase, + Type: float, + IsRequired: false, + Summary: +The base of the rope frequency scale. (Default: 1.0) + + }, + { + Id: rope_frequency_scale, + Name: RopeFrequencyScale, + Type: float, + IsRequired: false, + Summary: +The scale of the rope frequency. (Default: 1.0) + + }, + { + Id: num_thread, + Name: NumThread, + Type: int, + IsRequired: false, + Summary: +Sets the number of threads to use during computation. By default, Ollama will detect this for optimal performance. It is recommended to set this value to the number of physical CPU cores your system has (as opposed to the logical number of cores). + + } + ], + Summary: Additional model parameters listed in the documentation for the Modelfile such as `temperature`., + AdditionalModels: null, + Enumerations: null, + Name: RequestOptions, + ClassName: RequestOptions, + ExternalClassName: RequestOptions, + FileNameWithoutExtension: G.Models.RequestOptions + }, + { + Id: ResponseFormat, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: +The format to return a response in. Currently the only accepted value is json. + +Enable JSON mode by setting the format parameter to json. This will structure the response as valid JSON. + +Note: it's important to instruct the model to use JSON in the prompt. Otherwise, the model may generate large amounts whitespace. +, + AdditionalModels: null, + Enumerations: null, + Name: ResponseFormat, + ClassName: ResponseFormat, + ExternalClassName: ResponseFormat, + FileNameWithoutExtension: G.Models.ResponseFormat + }, + { + Id: GenerateCompletionResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: model, + Name: Model, + Type: string?, + IsRequired: false, + Summary: +The model name. + +Model names follow a `model:tag` format. Some examples are `orca-mini:3b-q4_1` and `llama2:70b`. The tag is optional and, if not provided, will default to `latest`. The tag is used to identify a specific version. + +
Example: llama2:7b + }, + { + Id: created_at, + Name: CreatedAt, + Type: global::System.DateTime, + IsRequired: false, + Summary: +Date on which a model was created. +
Example: + }, + { + Id: response, + Name: Response, + Type: string?, + IsRequired: false, + Summary: +The response for a given prompt with a provided model. +
Example: The sky appears blue because of a phenomenon called Rayleigh scattering. + }, + { + Id: done, + Name: Done, + Type: bool, + IsRequired: false, + Summary: +Whether the response has completed. +
Example: true + }, + { + Id: context, + Name: Context, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + Summary: +An encoding of the conversation used in this response, this can be sent in the next request to keep a conversational memory. + +
Example: [1, 2, 3] + }, + { + Id: total_duration, + Name: TotalDuration, + Type: int, + IsRequired: false, + Summary: +Time spent generating the response. +
Example: 5589157167 + }, + { + Id: load_duration, + Name: LoadDuration, + Type: int, + IsRequired: false, + Summary: +Time spent in nanoseconds loading the model. +
Example: 3013701500 + }, + { + Id: prompt_eval_count, + Name: PromptEvalCount, + Type: int, + IsRequired: false, + Summary: +Number of tokens in the prompt. +
Example: 46 + }, + { + Id: prompt_eval_duration, + Name: PromptEvalDuration, + Type: int, + IsRequired: false, + Summary: +Time spent in nanoseconds evaluating the prompt. +
Example: 1160282000 + }, + { + Id: eval_count, + Name: EvalCount, + Type: int, + IsRequired: false, + Summary: +Number of tokens the response. +
Example: 113 + }, + { + Id: eval_duration, + Name: EvalDuration, + Type: int, + IsRequired: false, + Summary: +Time in nanoseconds spent generating the response. +
Example: 1325948000 + } + ], + Summary: The response class for the generate endpoint., + AdditionalModels: null, + Enumerations: null, + Name: GenerateCompletionResponse, + ClassName: GenerateCompletionResponse, + ExternalClassName: GenerateCompletionResponse, + FileNameWithoutExtension: G.Models.GenerateCompletionResponse + }, + { + Id: GenerateChatCompletionRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: model, + Name: Model, + Type: string, + IsRequired: true, + Summary: +The model name. + +Model names follow a `model:tag` format. Some examples are `orca-mini:3b-q4_1` and `llama2:70b`. The tag is optional and, if not provided, will default to `latest`. The tag is used to identify a specific version. + +
Example: llama2:7b + }, + { + Id: messages, + Name: Messages, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: The messages of the chat, this can be used to keep a chat memory + }, + { + Id: format, + Name: Format, + Type: GenerateChatCompletionRequestFormat?, + IsRequired: false, + Summary: +The format to return a response in. Currently the only accepted value is json. + +Enable JSON mode by setting the format parameter to json. This will structure the response as valid JSON. + +Note: it's important to instruct the model to use JSON in the prompt. Otherwise, the model may generate large amounts whitespace. + + }, + { + Id: options, + Name: Options, + Type: RequestOptions?, + IsRequired: false, + Summary: Additional model parameters listed in the documentation for the Modelfile such as `temperature`. + }, + { + Id: stream, + Name: Stream, + Type: bool, + IsRequired: false, + DefaultValue: false, + Summary: +If `false` the response will be returned as a single response object, otherwise the response will be streamed as a series of objects. + +
Default Value: false + }, + { + Id: keep_alive, + Name: KeepAlive, + Type: int, + IsRequired: false, + Summary: +How long (in minutes) to keep the model loaded in memory. + +- If set to a positive duration (e.g. 20), the model will stay loaded for the provided duration. +- If set to a negative duration (e.g. -1), the model will stay loaded indefinitely. +- If set to 0, the model will be unloaded immediately once finished. +- If not set, the model will stay loaded for 5 minutes by default + + } + ], + Summary: Request class for the chat endpoint., + AdditionalModels: null, + Enumerations: null, + Name: GenerateChatCompletionRequest, + ClassName: GenerateChatCompletionRequest, + ExternalClassName: GenerateChatCompletionRequest, + FileNameWithoutExtension: G.Models.GenerateChatCompletionRequest + }, + { + Id: format, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: json, + Name: Json, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +The format to return a response in. Currently the only accepted value is json. + +Enable JSON mode by setting the format parameter to json. This will structure the response as valid JSON. + +Note: it's important to instruct the model to use JSON in the prompt. Otherwise, the model may generate large amounts whitespace. +, + AdditionalModels: null, + Enumerations: null, + Name: Format, + ClassName: Format, + ExternalClassName: Format, + FileNameWithoutExtension: G.Models.Format + }, + { + Id: GenerateChatCompletionResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: message, + Name: Message, + Type: Message?, + IsRequired: false, + Summary: A message in the chat endpoint + }, + { + Id: model, + Name: Model, + Type: string?, + IsRequired: false, + Summary: +The model name. + +Model names follow a `model:tag` format. Some examples are `orca-mini:3b-q4_1` and `llama2:70b`. The tag is optional and, if not provided, will default to `latest`. The tag is used to identify a specific version. + +
Example: llama2:7b + }, + { + Id: created_at, + Name: CreatedAt, + Type: global::System.DateTime, + IsRequired: false, + Summary: +Date on which a model was created. +
Example: + }, + { + Id: done, + Name: Done, + Type: bool, + IsRequired: false, + Summary: +Whether the response has completed. +
Example: true + }, + { + Id: total_duration, + Name: TotalDuration, + Type: int, + IsRequired: false, + Summary: +Time spent generating the response. +
Example: 5589157167 + }, + { + Id: load_duration, + Name: LoadDuration, + Type: int, + IsRequired: false, + Summary: +Time spent in nanoseconds loading the model. +
Example: 3013701500 + }, + { + Id: prompt_eval_count, + Name: PromptEvalCount, + Type: int, + IsRequired: false, + Summary: +Number of tokens in the prompt. +
Example: 46 + }, + { + Id: prompt_eval_duration, + Name: PromptEvalDuration, + Type: int, + IsRequired: false, + Summary: +Time spent in nanoseconds evaluating the prompt. +
Example: 1160282000 + }, + { + Id: eval_count, + Name: EvalCount, + Type: int, + IsRequired: false, + Summary: +Number of tokens the response. +
Example: 113 + }, + { + Id: eval_duration, + Name: EvalDuration, + Type: int, + IsRequired: false, + Summary: +Time in nanoseconds spent generating the response. +
Example: 1325948000 + } + ], + Summary: The response class for the chat endpoint., + AdditionalModels: null, + Enumerations: null, + Name: GenerateChatCompletionResponse, + ClassName: GenerateChatCompletionResponse, + ExternalClassName: GenerateChatCompletionResponse, + FileNameWithoutExtension: G.Models.GenerateChatCompletionResponse + }, + { + Id: Message, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: role, + Name: Role, + Type: MessageRole, + IsRequired: true, + Summary: The role of the message + }, + { + Id: content, + Name: Content, + Type: string, + IsRequired: true, + Summary: +The content of the message +
Example: Why is the sky blue? + }, + { + Id: images, + Name: Images, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + Summary: (optional) a list of Base64-encoded images to include in the message (for multimodal models such as llava) + } + ], + Summary: A message in the chat endpoint, + AdditionalModels: null, + Enumerations: null, + Name: Message, + ClassName: Message, + ExternalClassName: Message, + FileNameWithoutExtension: G.Models.Message + }, + { + Id: role, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: system, + Name: System, + Type: , + IsRequired: false, + Summary: + }, + { + Id: user, + Name: User, + Type: , + IsRequired: false, + Summary: + }, + { + Id: assistant, + Name: Assistant, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The role of the message, + AdditionalModels: null, + Enumerations: null, + Name: Role, + ClassName: Role, + ExternalClassName: Role, + FileNameWithoutExtension: G.Models.Role + }, + { + Id: GenerateEmbeddingRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: model, + Name: Model, + Type: string, + IsRequired: true, + Summary: +The model name. + +Model names follow a `model:tag` format. Some examples are `orca-mini:3b-q4_1` and `llama2:70b`. The tag is optional and, if not provided, will default to `latest`. The tag is used to identify a specific version. + +
Example: llama2:7b + }, + { + Id: prompt, + Name: Prompt, + Type: string, + IsRequired: true, + Summary: +Text to generate embeddings for. +
Example: Here is an article about llamas... + }, + { + Id: options, + Name: Options, + Type: RequestOptions?, + IsRequired: false, + Summary: Additional model parameters listed in the documentation for the Modelfile such as `temperature`. + } + ], + Summary: Generate embeddings from a model., + AdditionalModels: null, + Enumerations: null, + Name: GenerateEmbeddingRequest, + ClassName: GenerateEmbeddingRequest, + ExternalClassName: GenerateEmbeddingRequest, + FileNameWithoutExtension: G.Models.GenerateEmbeddingRequest + }, + { + Id: GenerateEmbeddingResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: embedding, + Name: Embedding, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + Summary: +The embedding for the prompt. +
Example: [0.5670403838157654, 0.009260174818336964, ...] + } + ], + Summary: Returns the embedding information., + AdditionalModels: null, + Enumerations: null, + Name: GenerateEmbeddingResponse, + ClassName: GenerateEmbeddingResponse, + ExternalClassName: GenerateEmbeddingResponse, + FileNameWithoutExtension: G.Models.GenerateEmbeddingResponse + }, + { + Id: CreateModelRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: name, + Name: Name, + Type: string, + IsRequired: true, + Summary: +The model name. + +Model names follow a `model:tag` format. Some examples are `orca-mini:3b-q4_1` and `llama2:70b`. The tag is optional and, if not provided, will default to `latest`. The tag is used to identify a specific version. + +
Example: mario + }, + { + Id: modelfile, + Name: Modelfile, + Type: string, + IsRequired: true, + Summary: +The contents of the Modelfile. +
Example: FROM llama2\nSYSTEM You are mario from Super Mario Bros. + }, + { + Id: stream, + Name: Stream, + Type: bool, + IsRequired: false, + DefaultValue: false, + Summary: +If `false` the response will be returned as a single response object, otherwise the response will be streamed as a series of objects. + +
Default Value: false + } + ], + Summary: Create model request object., + AdditionalModels: null, + Enumerations: null, + Name: CreateModelRequest, + ClassName: CreateModelRequest, + ExternalClassName: CreateModelRequest, + FileNameWithoutExtension: G.Models.CreateModelRequest + }, + { + Id: CreateModelResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: status, + Name: Status, + Type: CreateModelResponseStatus?, + IsRequired: false, + Summary: Status creating the model + } + ], + Summary: Response object for creating a model. When finished, `status` is `success`., + AdditionalModels: null, + Enumerations: null, + Name: CreateModelResponse, + ClassName: CreateModelResponse, + ExternalClassName: CreateModelResponse, + FileNameWithoutExtension: G.Models.CreateModelResponse + }, + { + Id: status, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: creating system layer, + Name: CreatingSystemLayer, + Type: , + IsRequired: false, + Summary: + }, + { + Id: parsing modelfile, + Name: ParsingModelfile, + Type: , + IsRequired: false, + Summary: + }, + { + Id: success, + Name: Success, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: Status creating the model, + AdditionalModels: null, + Enumerations: null, + Name: Status, + ClassName: Status, + ExternalClassName: Status, + FileNameWithoutExtension: G.Models.Status + }, + { + Id: CreateModelStatus, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: Status creating the model, + AdditionalModels: null, + Enumerations: null, + Name: CreateModelStatus, + ClassName: CreateModelStatus, + ExternalClassName: CreateModelStatus, + FileNameWithoutExtension: G.Models.CreateModelStatus + }, + { + Id: ModelsResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: models, + Name: Models, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + Summary: List of models available locally. + } + ], + Summary: Response class for the list models endpoint., + AdditionalModels: null, + Enumerations: null, + Name: ModelsResponse, + ClassName: ModelsResponse, + ExternalClassName: ModelsResponse, + FileNameWithoutExtension: G.Models.ModelsResponse + }, + { + Id: Model, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: name, + Name: Name, + Type: string?, + IsRequired: false, + Summary: +The model name. + +Model names follow a `model:tag` format. Some examples are `orca-mini:3b-q4_1` and `llama2:70b`. The tag is optional and, if not provided, will default to `latest`. The tag is used to identify a specific version. + +
Example: llama2:7b + }, + { + Id: modified_at, + Name: ModifiedAt, + Type: global::System.DateTime, + IsRequired: false, + Summary: +Model modification date. +
Example: + }, + { + Id: size, + Name: Size, + Type: int, + IsRequired: false, + Summary: +Size of the model on disk. +
Example: 7323310500 + } + ], + Summary: A model available locally., + AdditionalModels: null, + Enumerations: null, + Name: Model, + ClassName: Model, + ExternalClassName: Model, + FileNameWithoutExtension: G.Models.Model + }, + { + Id: ModelInfoRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: name, + Name: Name, + Type: string, + IsRequired: true, + Summary: +The model name. + +Model names follow a `model:tag` format. Some examples are `orca-mini:3b-q4_1` and `llama2:70b`. The tag is optional and, if not provided, will default to `latest`. The tag is used to identify a specific version. + +
Example: llama2:7b + } + ], + Summary: Request class for the show model info endpoint., + AdditionalModels: null, + Enumerations: null, + Name: ModelInfoRequest, + ClassName: ModelInfoRequest, + ExternalClassName: ModelInfoRequest, + FileNameWithoutExtension: G.Models.ModelInfoRequest + }, + { + Id: ModelInfo, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: license, + Name: License, + Type: string?, + IsRequired: false, + Summary: +The model's license. +
Example: + }, + { + Id: modelfile, + Name: Modelfile, + Type: string?, + IsRequired: false, + Summary: +The modelfile associated with the model. +
Example: Modelfile generated by \"ollama show\"\n# To build a new Modelfile based on this one, replace the FROM line with:\n# FROM llama2:latest\n\nFROM /Users/username/.ollama/models/blobs/sha256:8daa9615cce30c259a9555b1cc250d461d1bc69980a274b44d7eda0be78076d8\nTEMPLATE \"\"\"[INST] {{ if and .First .System }}<>{{ .System }}<>\n\n{{ end }}{{ .Prompt }} [/INST] \"\"\"\nSYSTEM \"\"\"\"\"\"\nPARAMETER stop [INST]\nPARAMETER stop [/INST]\nPARAMETER stop <>\nPARAMETER stop <>\n" + }, + { + Id: parameters, + Name: Parameters, + Type: string?, + IsRequired: false, + Summary: +The model parameters. +
Example: stop [INST]\nstop [/INST]\nstop <>\nstop <> + }, + { + Id: template, + Name: Template, + Type: string?, + IsRequired: false, + Summary: +The prompt template for the model. +
Example: [INST] {{ if and .First .System }}<>{{ .System }}<>\n\n{{ end }}{{ .Prompt }} [/INST] + } + ], + Summary: Details about a model including modelfile, template, parameters, license, and system prompt., + AdditionalModels: null, + Enumerations: null, + Name: ModelInfo, + ClassName: ModelInfo, + ExternalClassName: ModelInfo, + FileNameWithoutExtension: G.Models.ModelInfo + }, + { + Id: CopyModelRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: source, + Name: Source, + Type: string, + IsRequired: true, + Summary: +Name of the model to copy. +
Example: llama2:7b + }, + { + Id: destination, + Name: Destination, + Type: string, + IsRequired: true, + Summary: +Name of the new model. +
Example: llama2-backup + } + ], + Summary: Request class for copying a model., + AdditionalModels: null, + Enumerations: null, + Name: CopyModelRequest, + ClassName: CopyModelRequest, + ExternalClassName: CopyModelRequest, + FileNameWithoutExtension: G.Models.CopyModelRequest + }, + { + Id: DeleteModelRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: name, + Name: Name, + Type: string, + IsRequired: true, + Summary: +The model name. + +Model names follow a `model:tag` format. Some examples are `orca-mini:3b-q4_1` and `llama2:70b`. The tag is optional and, if not provided, will default to `latest`. The tag is used to identify a specific version. + +
Example: llama2:13b + } + ], + Summary: Request class for deleting a model., + AdditionalModels: null, + Enumerations: null, + Name: DeleteModelRequest, + ClassName: DeleteModelRequest, + ExternalClassName: DeleteModelRequest, + FileNameWithoutExtension: G.Models.DeleteModelRequest + }, + { + Id: PullModelRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: name, + Name: Name, + Type: string, + IsRequired: true, + Summary: +The model name. + +Model names follow a `model:tag` format. Some examples are `orca-mini:3b-q4_1` and `llama2:70b`. The tag is optional and, if not provided, will default to `latest`. The tag is used to identify a specific version. + +
Example: llama2:7b + }, + { + Id: insecure, + Name: Insecure, + Type: bool, + IsRequired: false, + DefaultValue: false, + Summary: +Allow insecure connections to the library. + +Only use this if you are pulling from your own library during development. + +
Default Value: false + }, + { + Id: stream, + Name: Stream, + Type: bool, + IsRequired: false, + DefaultValue: false, + Summary: +If `false` the response will be returned as a single response object, otherwise the response will be streamed as a series of objects. + +
Default Value: false + } + ], + Summary: Request class for pulling a model., + AdditionalModels: null, + Enumerations: null, + Name: PullModelRequest, + ClassName: PullModelRequest, + ExternalClassName: PullModelRequest, + FileNameWithoutExtension: G.Models.PullModelRequest + }, + { + Id: PullModelResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: status, + Name: Status, + Type: PullModelResponseStatus?, + IsRequired: false, + Summary: +Status pulling the model. +
Example: pulling manifest + }, + { + Id: digest, + Name: Digest, + Type: string?, + IsRequired: false, + Summary: +The model's digest. +
Example: sha256:bc07c81de745696fdf5afca05e065818a8149fb0c77266fb584d9b2cba3711a + }, + { + Id: total, + Name: Total, + Type: int, + IsRequired: false, + Summary: +Total size of the model. +
Example: 2142590208 + }, + { + Id: completed, + Name: Completed, + Type: int, + IsRequired: false, + Summary: +Total bytes transferred. +
Example: 2142590208 + } + ], + Summary: +Response class for pulling a model. + +The first object is the manifest. Then there is a series of downloading responses. Until any of the download is completed, the `completed` key may not be included. + +The number of files to be downloaded depends on the number of layers specified in the manifest. +, + AdditionalModels: null, + Enumerations: null, + Name: PullModelResponse, + ClassName: PullModelResponse, + ExternalClassName: PullModelResponse, + FileNameWithoutExtension: G.Models.PullModelResponse + }, + { + Id: status, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: pulling manifest, + Name: PullingManifest, + Type: , + IsRequired: false, + Summary: + }, + { + Id: downloading digestname, + Name: DownloadingDigestname, + Type: , + IsRequired: false, + Summary: + }, + { + Id: verifying sha256 digest, + Name: VerifyingSha256Digest, + Type: , + IsRequired: false, + Summary: + }, + { + Id: writing manifest, + Name: WritingManifest, + Type: , + IsRequired: false, + Summary: + }, + { + Id: removing any unused layers, + Name: RemovingAnyUnusedLayers, + Type: , + IsRequired: false, + Summary: + }, + { + Id: success, + Name: Success, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +Status pulling the model. +
Example: pulling manifest, + AdditionalModels: null, + Enumerations: null, + Name: Status, + ClassName: Status, + ExternalClassName: Status, + FileNameWithoutExtension: G.Models.Status + }, + { + Id: PullModelStatus, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: +Status pulling the model. +
Example: pulling manifest, + AdditionalModels: null, + Enumerations: null, + Name: PullModelStatus, + ClassName: PullModelStatus, + ExternalClassName: PullModelStatus, + FileNameWithoutExtension: G.Models.PullModelStatus + }, + { + Id: PushModelRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: name, + Name: Name, + Type: string, + IsRequired: true, + Summary: +The name of the model to push in the form of /:. +
Example: mattw/pygmalion:latest + }, + { + Id: insecure, + Name: Insecure, + Type: bool, + IsRequired: false, + DefaultValue: false, + Summary: +Allow insecure connections to the library. + +Only use this if you are pushing to your library during development. + +
Default Value: false + }, + { + Id: stream, + Name: Stream, + Type: bool, + IsRequired: false, + DefaultValue: false, + Summary: +If `false` the response will be returned as a single response object, otherwise the response will be streamed as a series of objects. + +
Default Value: false + } + ], + Summary: Request class for pushing a model., + AdditionalModels: null, + Enumerations: null, + Name: PushModelRequest, + ClassName: PushModelRequest, + ExternalClassName: PushModelRequest, + FileNameWithoutExtension: G.Models.PushModelRequest + }, + { + Id: PushModelResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: status, + Name: Status, + Type: PushModelResponseStatus?, + IsRequired: false, + Summary: Status pushing the model. + }, + { + Id: digest, + Name: Digest, + Type: string?, + IsRequired: false, + Summary: +the model's digest +
Example: sha256:bc07c81de745696fdf5afca05e065818a8149fb0c77266fb584d9b2cba3711a + }, + { + Id: total, + Name: Total, + Type: int, + IsRequired: false, + Summary: +total size of the model +
Example: 2142590208 + } + ], + Summary: Response class for pushing a model., + AdditionalModels: null, + Enumerations: null, + Name: PushModelResponse, + ClassName: PushModelResponse, + ExternalClassName: PushModelResponse, + FileNameWithoutExtension: G.Models.PushModelResponse + }, + { + Id: status, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: retrieving manifest, + Name: RetrievingManifest, + Type: , + IsRequired: false, + Summary: + }, + { + Id: starting upload, + Name: StartingUpload, + Type: , + IsRequired: false, + Summary: + }, + { + Id: pushing manifest, + Name: PushingManifest, + Type: , + IsRequired: false, + Summary: + }, + { + Id: success, + Name: Success, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: Status pushing the model., + AdditionalModels: null, + Enumerations: null, + Name: Status, + ClassName: Status, + ExternalClassName: Status, + FileNameWithoutExtension: G.Models.Status + }, + { + Id: PushModelStatus, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: Status pushing the model., + AdditionalModels: null, + Enumerations: null, + Name: PushModelStatus, + ClassName: PushModelStatus, + ExternalClassName: PushModelStatus, + FileNameWithoutExtension: G.Models.PushModelStatus + } +] \ No newline at end of file diff --git a/src/tests/OpenApiGenerator.UnitTests/Snapshots/OpenAi/_.verified.txt b/src/tests/OpenApiGenerator.UnitTests/Snapshots/OpenAi/_.verified.txt new file mode 100644 index 0000000000..031e4e4a75 --- /dev/null +++ b/src/tests/OpenApiGenerator.UnitTests/Snapshots/OpenAi/_.verified.txt @@ -0,0 +1,10687 @@ +[ + { + Id: Error, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: code, + Name: Code, + Type: string?, + IsRequired: true, + Summary: + }, + { + Id: message, + Name: Message, + Type: string, + IsRequired: true, + Summary: + }, + { + Id: param, + Name: Param, + Type: string?, + IsRequired: true, + Summary: + }, + { + Id: type, + Name: Type, + Type: string, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Error, + ClassName: Error, + ExternalClassName: Error, + FileNameWithoutExtension: G.Models.Error + }, + { + Id: ErrorResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: error, + Name: Error, + Type: Error, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ErrorResponse, + ClassName: ErrorResponse, + ExternalClassName: ErrorResponse, + FileNameWithoutExtension: G.Models.ErrorResponse + }, + { + Id: ListModelsResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: object, + Name: Object, + Type: ListModelsResponseObject, + IsRequired: true, + Summary: + }, + { + Id: data, + Name: Data, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ListModelsResponse, + ClassName: ListModelsResponse, + ExternalClassName: ListModelsResponse, + FileNameWithoutExtension: G.Models.ListModelsResponse + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: list, + Name: List, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: DeleteModelResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: + }, + { + Id: deleted, + Name: Deleted, + Type: bool, + IsRequired: true, + Summary: + }, + { + Id: object, + Name: Object, + Type: string, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: DeleteModelResponse, + ClassName: DeleteModelResponse, + ExternalClassName: DeleteModelResponse, + FileNameWithoutExtension: G.Models.DeleteModelResponse + }, + { + Id: CreateCompletionRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: model, + Name: Model, + Type: object, + IsRequired: true, + Summary: +ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them. + + }, + { + Id: prompt, + Name: Prompt, + Type: object?, + IsRequired: true, + DefaultValue: <|endoftext|>, + Summary: +The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays. + +Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document. + +
Default Value: <|endoftext|> + }, + { + Id: best_of, + Name: BestOf, + Type: int?, + IsRequired: false, + DefaultValue: 1, + Summary: +Generates `best_of` completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed. + +When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`. + +**Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`. + +
Default Value: 1 + }, + { + Id: echo, + Name: Echo, + Type: bool?, + IsRequired: false, + DefaultValue: false, + Summary: +Echo back the prompt in addition to the completion + +
Default Value: false + }, + { + Id: frequency_penalty, + Name: FrequencyPenalty, + Type: double?, + IsRequired: false, + DefaultValue: 0, + Summary: +Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + +[See more information about frequency and presence penalties.](/docs/guides/text-generation/parameter-details) + +
Default Value: 0 + }, + { + Id: logit_bias, + Name: LogitBias, + Type: CreateCompletionRequestLogitBias?, + IsRequired: false, + Summary: +Modify the likelihood of specified tokens appearing in the completion. + +Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) (which works for both GPT-2 and GPT-3) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. + +As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token from being generated. + +
Default Value: + }, + { + Id: logprobs, + Name: Logprobs, + Type: int?, + IsRequired: false, + Summary: +Include the log probabilities on the `logprobs` most likely output tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. + +The maximum value for `logprobs` is 5. + +
Default Value: + }, + { + Id: max_tokens, + Name: MaxTokens, + Type: int?, + IsRequired: false, + DefaultValue: 16, + Summary: +The maximum number of [tokens](/tokenizer) that can be generated in the completion. + +The token count of your prompt plus `max_tokens` cannot exceed the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. + +
Default Value: 16 +
Example: 16 + }, + { + Id: n, + Name: N, + Type: int?, + IsRequired: false, + DefaultValue: 1, + Summary: +How many completions to generate for each prompt. + +**Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`. + +
Default Value: 1 +
Example: 1 + }, + { + Id: presence_penalty, + Name: PresencePenalty, + Type: double?, + IsRequired: false, + DefaultValue: 0, + Summary: +Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + +[See more information about frequency and presence penalties.](/docs/guides/text-generation/parameter-details) + +
Default Value: 0 + }, + { + Id: seed, + Name: Seed, + Type: int?, + IsRequired: false, + Summary: +If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. + +Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. + + }, + { + Id: stop, + Name: Stop, + Type: object?, + IsRequired: false, + Summary: +Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. + +
Default Value: + }, + { + Id: stream, + Name: Stream, + Type: bool?, + IsRequired: false, + DefaultValue: false, + Summary: +Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). + +
Default Value: false + }, + { + Id: suffix, + Name: Suffix, + Type: string?, + IsRequired: false, + Summary: +The suffix that comes after a completion of inserted text. +
Default Value: +
Example: test. + }, + { + Id: temperature, + Name: Temperature, + Type: double?, + IsRequired: false, + DefaultValue: 1, + Summary: +What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + +We generally recommend altering this or `top_p` but not both. + +
Default Value: 1 +
Example: 1 + }, + { + Id: top_p, + Name: TopP, + Type: double?, + IsRequired: false, + DefaultValue: 1, + Summary: +An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + +We generally recommend altering this or `temperature` but not both. + +
Default Value: 1 +
Example: 1 + }, + { + Id: user, + Name: User, + Type: string?, + IsRequired: false, + Summary: +A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids). + +
Example: user-1234 + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateCompletionRequest, + ClassName: CreateCompletionRequest, + ExternalClassName: CreateCompletionRequest, + FileNameWithoutExtension: G.Models.CreateCompletionRequest + }, + { + Id: logit_bias, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: +Modify the likelihood of specified tokens appearing in the completion. + +Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) (which works for both GPT-2 and GPT-3) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. + +As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token from being generated. + +
Default Value: , + AdditionalModels: null, + Enumerations: null, + Name: LogitBias, + ClassName: LogitBias, + ExternalClassName: LogitBias, + FileNameWithoutExtension: G.Models.LogitBias + }, + { + Id: model, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: babbage-002, + Name: Babbage002, + Type: , + IsRequired: false, + Summary: + }, + { + Id: davinci-002, + Name: Davinci002, + Type: , + IsRequired: false, + Summary: + }, + { + Id: gpt-3.5-turbo-instruct, + Name: Gpt35TurboInstruct, + Type: , + IsRequired: false, + Summary: + }, + { + Id: text-davinci-003, + Name: TextDavinci003, + Type: , + IsRequired: false, + Summary: + }, + { + Id: text-davinci-002, + Name: TextDavinci002, + Type: , + IsRequired: false, + Summary: + }, + { + Id: text-davinci-001, + Name: TextDavinci001, + Type: , + IsRequired: false, + Summary: + }, + { + Id: code-davinci-002, + Name: CodeDavinci002, + Type: , + IsRequired: false, + Summary: + }, + { + Id: text-curie-001, + Name: TextCurie001, + Type: , + IsRequired: false, + Summary: + }, + { + Id: text-babbage-001, + Name: TextBabbage001, + Type: , + IsRequired: false, + Summary: + }, + { + Id: text-ada-001, + Name: TextAda001, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Model, + ClassName: Model, + ExternalClassName: Model, + FileNameWithoutExtension: G.Models.Model + }, + { + Id: CreateCompletionResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: A unique identifier for the completion. + }, + { + Id: choices, + Name: Choices, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: The list of completion choices the model generated for the input prompt. + }, + { + Id: created, + Name: Created, + Type: int, + IsRequired: true, + Summary: The Unix timestamp (in seconds) of when the completion was created. + }, + { + Id: model, + Name: Model, + Type: string, + IsRequired: true, + Summary: The model used for completion. + }, + { + Id: system_fingerprint, + Name: SystemFingerprint, + Type: string?, + IsRequired: false, + Summary: +This fingerprint represents the backend configuration that the model runs with. + +Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. + + }, + { + Id: object, + Name: Object, + Type: CreateCompletionResponseObject, + IsRequired: true, + Summary: The object type, which is always "text_completion" + }, + { + Id: usage, + Name: Usage, + Type: CompletionUsage?, + IsRequired: false, + Summary: Usage statistics for the completion request. + } + ], + Summary: +Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint). +, + AdditionalModels: null, + Enumerations: null, + Name: CreateCompletionResponse, + ClassName: CreateCompletionResponse, + ExternalClassName: CreateCompletionResponse, + FileNameWithoutExtension: G.Models.CreateCompletionResponse + }, + { + Id: choices, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: finish_reason, + Name: FinishReason, + Type: CreateCompletionResponseChoicesFinishReason, + IsRequired: true, + Summary: +The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, +`length` if the maximum number of tokens specified in the request was reached, +or `content_filter` if content was omitted due to a flag from our content filters. + + }, + { + Id: index, + Name: Index, + Type: int, + IsRequired: true, + Summary: + }, + { + Id: logprobs, + Name: Logprobs, + Type: CreateCompletionResponseChoicesLogprobs?, + IsRequired: true, + Summary: + }, + { + Id: text, + Name: Text, + Type: string, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Choices, + ClassName: Choices, + ExternalClassName: Choices, + FileNameWithoutExtension: G.Models.Choices + }, + { + Id: logprobs, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: text_offset, + Name: TextOffset, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + Summary: + }, + { + Id: token_logprobs, + Name: TokenLogprobs, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + Summary: + }, + { + Id: tokens, + Name: Tokens, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + Summary: + }, + { + Id: top_logprobs, + Name: TopLogprobs, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Logprobs, + ClassName: Logprobs, + ExternalClassName: Logprobs, + FileNameWithoutExtension: G.Models.Logprobs + }, + { + Id: top_logprobs, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: TopLogprobs, + ClassName: TopLogprobs, + ExternalClassName: TopLogprobs, + FileNameWithoutExtension: G.Models.TopLogprobs + }, + { + Id: finish_reason, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: stop, + Name: Stop, + Type: , + IsRequired: false, + Summary: + }, + { + Id: length, + Name: Length, + Type: , + IsRequired: false, + Summary: + }, + { + Id: content_filter, + Name: ContentFilter, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, +`length` if the maximum number of tokens specified in the request was reached, +or `content_filter` if content was omitted due to a flag from our content filters. +, + AdditionalModels: null, + Enumerations: null, + Name: FinishReason, + ClassName: FinishReason, + ExternalClassName: FinishReason, + FileNameWithoutExtension: G.Models.FinishReason + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: text_completion, + Name: TextCompletion, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The object type, which is always "text_completion", + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: ChatCompletionRequestMessageContentPart, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ChatCompletionRequestMessageContentPart, + ClassName: ChatCompletionRequestMessageContentPart, + ExternalClassName: ChatCompletionRequestMessageContentPart, + FileNameWithoutExtension: G.Models.ChatCompletionRequestMessageContentPart + }, + { + Id: ChatCompletionRequestMessageContentPartImage, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: type, + Name: Type, + Type: ChatCompletionRequestMessageContentPartImageType, + IsRequired: true, + Summary: The type of the content part. + }, + { + Id: image_url, + Name: ImageUrl, + Type: ChatCompletionRequestMessageContentPartImageImageUrl, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ChatCompletionRequestMessageContentPartImage, + ClassName: ChatCompletionRequestMessageContentPartImage, + ExternalClassName: ChatCompletionRequestMessageContentPartImage, + FileNameWithoutExtension: G.Models.ChatCompletionRequestMessageContentPartImage + }, + { + Id: image_url, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: url, + Name: Url, + Type: string, + IsRequired: true, + Summary: Either a URL of the image or the base64 encoded image data. + }, + { + Id: detail, + Name: Detail, + Type: ChatCompletionRequestMessageContentPartImageImageUrlDetail?, + IsRequired: false, + DefaultValue: auto, + Summary: +Specifies the detail level of the image. Learn more in the [Vision guide](/docs/guides/vision/low-or-high-fidelity-image-understanding). +
Default Value: auto + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ImageUrl, + ClassName: ImageUrl, + ExternalClassName: ImageUrl, + FileNameWithoutExtension: G.Models.ImageUrl + }, + { + Id: detail, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: auto, + Name: Auto, + Type: , + IsRequired: false, + Summary: + }, + { + Id: low, + Name: Low, + Type: , + IsRequired: false, + Summary: + }, + { + Id: high, + Name: High, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +Specifies the detail level of the image. Learn more in the [Vision guide](/docs/guides/vision/low-or-high-fidelity-image-understanding). +
Default Value: auto, + AdditionalModels: null, + Enumerations: null, + Name: Detail, + ClassName: Detail, + ExternalClassName: Detail, + FileNameWithoutExtension: G.Models.Detail + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: image_url, + Name: ImageUrl, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The type of the content part., + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: ChatCompletionRequestMessageContentPartText, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: type, + Name: Type, + Type: ChatCompletionRequestMessageContentPartTextType, + IsRequired: true, + Summary: The type of the content part. + }, + { + Id: text, + Name: Text, + Type: string, + IsRequired: true, + Summary: The text content. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ChatCompletionRequestMessageContentPartText, + ClassName: ChatCompletionRequestMessageContentPartText, + ExternalClassName: ChatCompletionRequestMessageContentPartText, + FileNameWithoutExtension: G.Models.ChatCompletionRequestMessageContentPartText + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: text, + Name: Text, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The type of the content part., + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: ChatCompletionRequestMessage, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ChatCompletionRequestMessage, + ClassName: ChatCompletionRequestMessage, + ExternalClassName: ChatCompletionRequestMessage, + FileNameWithoutExtension: G.Models.ChatCompletionRequestMessage + }, + { + Id: ChatCompletionRequestSystemMessage, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: content, + Name: Content, + Type: string, + IsRequired: true, + Summary: The contents of the system message. + }, + { + Id: role, + Name: Role, + Type: ChatCompletionRequestSystemMessageRole, + IsRequired: true, + Summary: The role of the messages author, in this case `system`. + }, + { + Id: name, + Name: Name, + Type: string?, + IsRequired: false, + Summary: An optional name for the participant. Provides the model information to differentiate between participants of the same role. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ChatCompletionRequestSystemMessage, + ClassName: ChatCompletionRequestSystemMessage, + ExternalClassName: ChatCompletionRequestSystemMessage, + FileNameWithoutExtension: G.Models.ChatCompletionRequestSystemMessage + }, + { + Id: role, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: system, + Name: System, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The role of the messages author, in this case `system`., + AdditionalModels: null, + Enumerations: null, + Name: Role, + ClassName: Role, + ExternalClassName: Role, + FileNameWithoutExtension: G.Models.Role + }, + { + Id: ChatCompletionRequestUserMessage, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: content, + Name: Content, + Type: object, + IsRequired: true, + Summary: +The contents of the user message. + + }, + { + Id: role, + Name: Role, + Type: ChatCompletionRequestUserMessageRole, + IsRequired: true, + Summary: The role of the messages author, in this case `user`. + }, + { + Id: name, + Name: Name, + Type: string?, + IsRequired: false, + Summary: An optional name for the participant. Provides the model information to differentiate between participants of the same role. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ChatCompletionRequestUserMessage, + ClassName: ChatCompletionRequestUserMessage, + ExternalClassName: ChatCompletionRequestUserMessage, + FileNameWithoutExtension: G.Models.ChatCompletionRequestUserMessage + }, + { + Id: role, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: user, + Name: User, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The role of the messages author, in this case `user`., + AdditionalModels: null, + Enumerations: null, + Name: Role, + ClassName: Role, + ExternalClassName: Role, + FileNameWithoutExtension: G.Models.Role + }, + { + Id: ChatCompletionRequestAssistantMessage, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: content, + Name: Content, + Type: string?, + IsRequired: false, + Summary: +The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified. + + }, + { + Id: role, + Name: Role, + Type: ChatCompletionRequestAssistantMessageRole, + IsRequired: true, + Summary: The role of the messages author, in this case `assistant`. + }, + { + Id: name, + Name: Name, + Type: string?, + IsRequired: false, + Summary: An optional name for the participant. Provides the model information to differentiate between participants of the same role. + }, + { + Id: tool_calls, + Name: ToolCalls, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + Summary: The tool calls generated by the model, such as function calls. + }, + { + Id: function_call, + Name: FunctionCall, + Type: ChatCompletionRequestAssistantMessageFunctionCall?, + IsRequired: false, + Summary: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ChatCompletionRequestAssistantMessage, + ClassName: ChatCompletionRequestAssistantMessage, + ExternalClassName: ChatCompletionRequestAssistantMessage, + FileNameWithoutExtension: G.Models.ChatCompletionRequestAssistantMessage + }, + { + Id: function_call, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: arguments, + Name: Arguments, + Type: string, + IsRequired: true, + Summary: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. + }, + { + Id: name, + Name: Name, + Type: string, + IsRequired: true, + Summary: The name of the function to call. + } + ], + Summary: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model., + AdditionalModels: null, + Enumerations: null, + Name: FunctionCall, + ClassName: FunctionCall, + ExternalClassName: FunctionCall, + FileNameWithoutExtension: G.Models.FunctionCall + }, + { + Id: role, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: assistant, + Name: Assistant, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The role of the messages author, in this case `assistant`., + AdditionalModels: null, + Enumerations: null, + Name: Role, + ClassName: Role, + ExternalClassName: Role, + FileNameWithoutExtension: G.Models.Role + }, + { + Id: ChatCompletionRequestToolMessage, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: role, + Name: Role, + Type: ChatCompletionRequestToolMessageRole, + IsRequired: true, + Summary: The role of the messages author, in this case `tool`. + }, + { + Id: content, + Name: Content, + Type: string, + IsRequired: true, + Summary: The contents of the tool message. + }, + { + Id: tool_call_id, + Name: ToolCallId, + Type: string, + IsRequired: true, + Summary: Tool call that this message is responding to. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ChatCompletionRequestToolMessage, + ClassName: ChatCompletionRequestToolMessage, + ExternalClassName: ChatCompletionRequestToolMessage, + FileNameWithoutExtension: G.Models.ChatCompletionRequestToolMessage + }, + { + Id: role, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: tool, + Name: Tool, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The role of the messages author, in this case `tool`., + AdditionalModels: null, + Enumerations: null, + Name: Role, + ClassName: Role, + ExternalClassName: Role, + FileNameWithoutExtension: G.Models.Role + }, + { + Id: ChatCompletionRequestFunctionMessage, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: role, + Name: Role, + Type: ChatCompletionRequestFunctionMessageRole, + IsRequired: true, + Summary: The role of the messages author, in this case `function`. + }, + { + Id: content, + Name: Content, + Type: string?, + IsRequired: true, + Summary: The contents of the function message. + }, + { + Id: name, + Name: Name, + Type: string, + IsRequired: true, + Summary: The name of the function to call. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ChatCompletionRequestFunctionMessage, + ClassName: ChatCompletionRequestFunctionMessage, + ExternalClassName: ChatCompletionRequestFunctionMessage, + FileNameWithoutExtension: G.Models.ChatCompletionRequestFunctionMessage + }, + { + Id: role, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: function, + Name: Function, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The role of the messages author, in this case `function`., + AdditionalModels: null, + Enumerations: null, + Name: Role, + ClassName: Role, + ExternalClassName: Role, + FileNameWithoutExtension: G.Models.Role + }, + { + Id: FunctionParameters, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: +The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/text-generation/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. + +Omitting `parameters` defines a function with an empty parameter list., + AdditionalModels: null, + Enumerations: null, + Name: FunctionParameters, + ClassName: FunctionParameters, + ExternalClassName: FunctionParameters, + FileNameWithoutExtension: G.Models.FunctionParameters + }, + { + Id: ChatCompletionFunctions, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: description, + Name: Description, + Type: string?, + IsRequired: false, + Summary: A description of what the function does, used by the model to choose when and how to call the function. + }, + { + Id: name, + Name: Name, + Type: string, + IsRequired: true, + Summary: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + }, + { + Id: parameters, + Name: Parameters, + Type: FunctionParameters?, + IsRequired: false, + Summary: +The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/text-generation/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. + +Omitting `parameters` defines a function with an empty parameter list. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ChatCompletionFunctions, + ClassName: ChatCompletionFunctions, + ExternalClassName: ChatCompletionFunctions, + FileNameWithoutExtension: G.Models.ChatCompletionFunctions + }, + { + Id: ChatCompletionFunctionCallOption, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: name, + Name: Name, + Type: string, + IsRequired: true, + Summary: The name of the function to call. + } + ], + Summary: +Specifying a particular function via `{"name": "my_function"}` forces the model to call that function. +, + AdditionalModels: null, + Enumerations: null, + Name: ChatCompletionFunctionCallOption, + ClassName: ChatCompletionFunctionCallOption, + ExternalClassName: ChatCompletionFunctionCallOption, + FileNameWithoutExtension: G.Models.ChatCompletionFunctionCallOption + }, + { + Id: ChatCompletionTool, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: type, + Name: Type, + Type: ChatCompletionToolType, + IsRequired: true, + Summary: The type of the tool. Currently, only `function` is supported. + }, + { + Id: function, + Name: Function, + Type: FunctionObject, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ChatCompletionTool, + ClassName: ChatCompletionTool, + ExternalClassName: ChatCompletionTool, + FileNameWithoutExtension: G.Models.ChatCompletionTool + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: function, + Name: Function, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The type of the tool. Currently, only `function` is supported., + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: FunctionObject, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: description, + Name: Description, + Type: string?, + IsRequired: false, + Summary: A description of what the function does, used by the model to choose when and how to call the function. + }, + { + Id: name, + Name: Name, + Type: string, + IsRequired: true, + Summary: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + }, + { + Id: parameters, + Name: Parameters, + Type: FunctionParameters?, + IsRequired: false, + Summary: +The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/text-generation/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. + +Omitting `parameters` defines a function with an empty parameter list. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: FunctionObject, + ClassName: FunctionObject, + ExternalClassName: FunctionObject, + FileNameWithoutExtension: G.Models.FunctionObject + }, + { + Id: ChatCompletionToolChoiceOption, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: +Controls which (if any) function is called by the model. +`none` means the model will not call a function and instead generates a message. +`auto` means the model can pick between generating a message or calling a function. +Specifying a particular function via `{"type: "function", "function": {"name": "my_function"}}` forces the model to call that function. + +`none` is the default when no functions are present. `auto` is the default if functions are present. +, + AdditionalModels: null, + Enumerations: null, + Name: ChatCompletionToolChoiceOption, + ClassName: ChatCompletionToolChoiceOption, + ExternalClassName: ChatCompletionToolChoiceOption, + FileNameWithoutExtension: G.Models.ChatCompletionToolChoiceOption + }, + { + Id: ChatCompletionNamedToolChoice, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: type, + Name: Type, + Type: ChatCompletionNamedToolChoiceType, + IsRequired: true, + Summary: The type of the tool. Currently, only `function` is supported. + }, + { + Id: function, + Name: Function, + Type: ChatCompletionNamedToolChoiceFunction, + IsRequired: true, + Summary: + } + ], + Summary: Specifies a tool the model should use. Use to force the model to call a specific function., + AdditionalModels: null, + Enumerations: null, + Name: ChatCompletionNamedToolChoice, + ClassName: ChatCompletionNamedToolChoice, + ExternalClassName: ChatCompletionNamedToolChoice, + FileNameWithoutExtension: G.Models.ChatCompletionNamedToolChoice + }, + { + Id: function, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: name, + Name: Name, + Type: string, + IsRequired: true, + Summary: The name of the function to call. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Function, + ClassName: Function, + ExternalClassName: Function, + FileNameWithoutExtension: G.Models.Function + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: function, + Name: Function, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The type of the tool. Currently, only `function` is supported., + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: ChatCompletionMessageToolCalls, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: The tool calls generated by the model, such as function calls., + AdditionalModels: null, + Enumerations: null, + Name: ChatCompletionMessageToolCalls, + ClassName: ChatCompletionMessageToolCalls, + ExternalClassName: ChatCompletionMessageToolCalls, + FileNameWithoutExtension: G.Models.ChatCompletionMessageToolCalls + }, + { + Id: ChatCompletionMessageToolCall, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: The ID of the tool call. + }, + { + Id: type, + Name: Type, + Type: ChatCompletionMessageToolCallType, + IsRequired: true, + Summary: The type of the tool. Currently, only `function` is supported. + }, + { + Id: function, + Name: Function, + Type: ChatCompletionMessageToolCallFunction, + IsRequired: true, + Summary: The function that the model called. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ChatCompletionMessageToolCall, + ClassName: ChatCompletionMessageToolCall, + ExternalClassName: ChatCompletionMessageToolCall, + FileNameWithoutExtension: G.Models.ChatCompletionMessageToolCall + }, + { + Id: function, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: name, + Name: Name, + Type: string, + IsRequired: true, + Summary: The name of the function to call. + }, + { + Id: arguments, + Name: Arguments, + Type: string, + IsRequired: true, + Summary: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. + } + ], + Summary: The function that the model called., + AdditionalModels: null, + Enumerations: null, + Name: Function, + ClassName: Function, + ExternalClassName: Function, + FileNameWithoutExtension: G.Models.Function + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: function, + Name: Function, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The type of the tool. Currently, only `function` is supported., + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: ChatCompletionMessageToolCallChunk, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: index, + Name: Index, + Type: int, + IsRequired: true, + Summary: + }, + { + Id: id, + Name: Id, + Type: string?, + IsRequired: false, + Summary: The ID of the tool call. + }, + { + Id: type, + Name: Type, + Type: ChatCompletionMessageToolCallChunkType?, + IsRequired: false, + Summary: The type of the tool. Currently, only `function` is supported. + }, + { + Id: function, + Name: Function, + Type: ChatCompletionMessageToolCallChunkFunction?, + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ChatCompletionMessageToolCallChunk, + ClassName: ChatCompletionMessageToolCallChunk, + ExternalClassName: ChatCompletionMessageToolCallChunk, + FileNameWithoutExtension: G.Models.ChatCompletionMessageToolCallChunk + }, + { + Id: function, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: name, + Name: Name, + Type: string?, + IsRequired: false, + Summary: The name of the function to call. + }, + { + Id: arguments, + Name: Arguments, + Type: string?, + IsRequired: false, + Summary: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Function, + ClassName: Function, + ExternalClassName: Function, + FileNameWithoutExtension: G.Models.Function + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: function, + Name: Function, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The type of the tool. Currently, only `function` is supported., + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: ChatCompletionRole, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: The role of the author of a message, + AdditionalModels: null, + Enumerations: null, + Name: ChatCompletionRole, + ClassName: ChatCompletionRole, + ExternalClassName: ChatCompletionRole, + FileNameWithoutExtension: G.Models.ChatCompletionRole + }, + { + Id: ChatCompletionResponseMessage, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: content, + Name: Content, + Type: string?, + IsRequired: true, + Summary: The contents of the message. + }, + { + Id: tool_calls, + Name: ToolCalls, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + Summary: The tool calls generated by the model, such as function calls. + }, + { + Id: role, + Name: Role, + Type: ChatCompletionResponseMessageRole, + IsRequired: true, + Summary: The role of the author of this message. + }, + { + Id: function_call, + Name: FunctionCall, + Type: ChatCompletionResponseMessageFunctionCall?, + IsRequired: false, + Summary: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. + } + ], + Summary: A chat completion message generated by the model., + AdditionalModels: null, + Enumerations: null, + Name: ChatCompletionResponseMessage, + ClassName: ChatCompletionResponseMessage, + ExternalClassName: ChatCompletionResponseMessage, + FileNameWithoutExtension: G.Models.ChatCompletionResponseMessage + }, + { + Id: function_call, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: arguments, + Name: Arguments, + Type: string, + IsRequired: true, + Summary: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. + }, + { + Id: name, + Name: Name, + Type: string, + IsRequired: true, + Summary: The name of the function to call. + } + ], + Summary: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model., + AdditionalModels: null, + Enumerations: null, + Name: FunctionCall, + ClassName: FunctionCall, + ExternalClassName: FunctionCall, + FileNameWithoutExtension: G.Models.FunctionCall + }, + { + Id: role, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: assistant, + Name: Assistant, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The role of the author of this message., + AdditionalModels: null, + Enumerations: null, + Name: Role, + ClassName: Role, + ExternalClassName: Role, + FileNameWithoutExtension: G.Models.Role + }, + { + Id: ChatCompletionStreamResponseDelta, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: content, + Name: Content, + Type: string?, + IsRequired: false, + Summary: The contents of the chunk message. + }, + { + Id: function_call, + Name: FunctionCall, + Type: ChatCompletionStreamResponseDeltaFunctionCall?, + IsRequired: false, + Summary: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. + }, + { + Id: tool_calls, + Name: ToolCalls, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + Summary: + }, + { + Id: role, + Name: Role, + Type: ChatCompletionStreamResponseDeltaRole?, + IsRequired: false, + Summary: The role of the author of this message. + } + ], + Summary: A chat completion delta generated by streamed model responses., + AdditionalModels: null, + Enumerations: null, + Name: ChatCompletionStreamResponseDelta, + ClassName: ChatCompletionStreamResponseDelta, + ExternalClassName: ChatCompletionStreamResponseDelta, + FileNameWithoutExtension: G.Models.ChatCompletionStreamResponseDelta + }, + { + Id: function_call, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: arguments, + Name: Arguments, + Type: string?, + IsRequired: false, + Summary: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. + }, + { + Id: name, + Name: Name, + Type: string?, + IsRequired: false, + Summary: The name of the function to call. + } + ], + Summary: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model., + AdditionalModels: null, + Enumerations: null, + Name: FunctionCall, + ClassName: FunctionCall, + ExternalClassName: FunctionCall, + FileNameWithoutExtension: G.Models.FunctionCall + }, + { + Id: role, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: system, + Name: System, + Type: , + IsRequired: false, + Summary: + }, + { + Id: user, + Name: User, + Type: , + IsRequired: false, + Summary: + }, + { + Id: assistant, + Name: Assistant, + Type: , + IsRequired: false, + Summary: + }, + { + Id: tool, + Name: Tool, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The role of the author of this message., + AdditionalModels: null, + Enumerations: null, + Name: Role, + ClassName: Role, + ExternalClassName: Role, + FileNameWithoutExtension: G.Models.Role + }, + { + Id: CreateChatCompletionRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: messages, + Name: Messages, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: A list of messages comprising the conversation so far. [Example Python code](https://cookbook.openai.com/examples/how_to_format_inputs_to_chatgpt_models). + }, + { + Id: model, + Name: Model, + Type: object, + IsRequired: true, + Summary: +ID of the model to use. See the [model endpoint compatibility](/docs/models/model-endpoint-compatibility) table for details on which models work with the Chat API. +
Example: gpt-3.5-turbo + }, + { + Id: frequency_penalty, + Name: FrequencyPenalty, + Type: double?, + IsRequired: false, + DefaultValue: 0, + Summary: +Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + +[See more information about frequency and presence penalties.](/docs/guides/text-generation/parameter-details) + +
Default Value: 0 + }, + { + Id: logit_bias, + Name: LogitBias, + Type: CreateChatCompletionRequestLogitBias?, + IsRequired: false, + Summary: +Modify the likelihood of specified tokens appearing in the completion. + +Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. + +
Default Value: + }, + { + Id: logprobs, + Name: Logprobs, + Type: bool?, + IsRequired: false, + DefaultValue: false, + Summary: +Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`. This option is currently not available on the `gpt-4-vision-preview` model. +
Default Value: false + }, + { + Id: top_logprobs, + Name: TopLogprobs, + Type: int?, + IsRequired: false, + Summary: An integer between 0 and 5 specifying the number of most likely tokens to return at each token position, each with an associated log probability. `logprobs` must be set to `true` if this parameter is used. + }, + { + Id: max_tokens, + Name: MaxTokens, + Type: int?, + IsRequired: false, + Summary: +The maximum number of [tokens](/tokenizer) that can be generated in the chat completion. + +The total length of input tokens and generated tokens is limited by the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. + + }, + { + Id: n, + Name: N, + Type: int?, + IsRequired: false, + DefaultValue: 1, + Summary: +How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs. +
Default Value: 1 +
Example: 1 + }, + { + Id: presence_penalty, + Name: PresencePenalty, + Type: double?, + IsRequired: false, + DefaultValue: 0, + Summary: +Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + +[See more information about frequency and presence penalties.](/docs/guides/text-generation/parameter-details) + +
Default Value: 0 + }, + { + Id: response_format, + Name: ResponseFormat, + Type: CreateChatCompletionRequestResponseFormat?, + IsRequired: false, + Summary: +An object specifying the format that the model must output. Compatible with `gpt-4-1106-preview` and `gpt-3.5-turbo-1106`. + +Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON. + +**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + + }, + { + Id: seed, + Name: Seed, + Type: int?, + IsRequired: false, + Summary: +This feature is in Beta. +If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. +Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. + + }, + { + Id: stop, + Name: Stop, + Type: object?, + IsRequired: false, + Summary: +Up to 4 sequences where the API will stop generating further tokens. + +
Default Value: + }, + { + Id: stream, + Name: Stream, + Type: bool?, + IsRequired: false, + DefaultValue: false, + Summary: +If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). + +
Default Value: false + }, + { + Id: temperature, + Name: Temperature, + Type: double?, + IsRequired: false, + DefaultValue: 1, + Summary: +What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + +We generally recommend altering this or `top_p` but not both. + +
Default Value: 1 +
Example: 1 + }, + { + Id: top_p, + Name: TopP, + Type: double?, + IsRequired: false, + DefaultValue: 1, + Summary: +An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + +We generally recommend altering this or `temperature` but not both. + +
Default Value: 1 +
Example: 1 + }, + { + Id: tools, + Name: Tools, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + Summary: +A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. + + }, + { + Id: tool_choice, + Name: ToolChoice, + Type: ChatCompletionToolChoiceOption?, + IsRequired: false, + Summary: +Controls which (if any) function is called by the model. +`none` means the model will not call a function and instead generates a message. +`auto` means the model can pick between generating a message or calling a function. +Specifying a particular function via `{"type: "function", "function": {"name": "my_function"}}` forces the model to call that function. + +`none` is the default when no functions are present. `auto` is the default if functions are present. + + }, + { + Id: user, + Name: User, + Type: string?, + IsRequired: false, + Summary: +A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids). + +
Example: user-1234 + }, + { + Id: function_call, + Name: FunctionCall, + Type: object?, + IsRequired: false, + Summary: +Deprecated in favor of `tool_choice`. + +Controls which (if any) function is called by the model. +`none` means the model will not call a function and instead generates a message. +`auto` means the model can pick between generating a message or calling a function. +Specifying a particular function via `{"name": "my_function"}` forces the model to call that function. + +`none` is the default when no functions are present. `auto` is the default if functions are present. + + }, + { + Id: functions, + Name: Functions, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + Summary: +Deprecated in favor of `tools`. + +A list of functions the model may generate JSON inputs for. + + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateChatCompletionRequest, + ClassName: CreateChatCompletionRequest, + ExternalClassName: CreateChatCompletionRequest, + FileNameWithoutExtension: G.Models.CreateChatCompletionRequest + }, + { + Id: logit_bias, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: +Modify the likelihood of specified tokens appearing in the completion. + +Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. + +
Default Value: , + AdditionalModels: null, + Enumerations: null, + Name: LogitBias, + ClassName: LogitBias, + ExternalClassName: LogitBias, + FileNameWithoutExtension: G.Models.LogitBias + }, + { + Id: response_format, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: type, + Name: Type, + Type: CreateChatCompletionRequestResponseFormatType?, + IsRequired: false, + DefaultValue: text, + Summary: +Must be one of `text` or `json_object`. +
Default Value: text +
Example: json_object + } + ], + Summary: +An object specifying the format that the model must output. Compatible with `gpt-4-1106-preview` and `gpt-3.5-turbo-1106`. + +Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON. + +**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. +, + AdditionalModels: null, + Enumerations: null, + Name: ResponseFormat, + ClassName: ResponseFormat, + ExternalClassName: ResponseFormat, + FileNameWithoutExtension: G.Models.ResponseFormat + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: text, + Name: Text, + Type: , + IsRequired: false, + Summary: + }, + { + Id: json_object, + Name: JsonObject, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +Must be one of `text` or `json_object`. +
Default Value: text +
Example: json_object, + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: model, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: gpt-4-1106-preview, + Name: Gpt41106Preview, + Type: , + IsRequired: false, + Summary: + }, + { + Id: gpt-4-vision-preview, + Name: Gpt4VisionPreview, + Type: , + IsRequired: false, + Summary: + }, + { + Id: gpt-4, + Name: Gpt4, + Type: , + IsRequired: false, + Summary: + }, + { + Id: gpt-4-0314, + Name: Gpt40314, + Type: , + IsRequired: false, + Summary: + }, + { + Id: gpt-4-0613, + Name: Gpt40613, + Type: , + IsRequired: false, + Summary: + }, + { + Id: gpt-4-32k, + Name: Gpt432k, + Type: , + IsRequired: false, + Summary: + }, + { + Id: gpt-4-32k-0314, + Name: Gpt432k0314, + Type: , + IsRequired: false, + Summary: + }, + { + Id: gpt-4-32k-0613, + Name: Gpt432k0613, + Type: , + IsRequired: false, + Summary: + }, + { + Id: gpt-3.5-turbo, + Name: Gpt35Turbo, + Type: , + IsRequired: false, + Summary: + }, + { + Id: gpt-3.5-turbo-16k, + Name: Gpt35Turbo16k, + Type: , + IsRequired: false, + Summary: + }, + { + Id: gpt-3.5-turbo-0301, + Name: Gpt35Turbo0301, + Type: , + IsRequired: false, + Summary: + }, + { + Id: gpt-3.5-turbo-0613, + Name: Gpt35Turbo0613, + Type: , + IsRequired: false, + Summary: + }, + { + Id: gpt-3.5-turbo-1106, + Name: Gpt35Turbo1106, + Type: , + IsRequired: false, + Summary: + }, + { + Id: gpt-3.5-turbo-16k-0613, + Name: Gpt35Turbo16k0613, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Model, + ClassName: Model, + ExternalClassName: Model, + FileNameWithoutExtension: G.Models.Model + }, + { + Id: tool_choice, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: none, + Name: None, + Type: , + IsRequired: false, + Summary: + }, + { + Id: auto, + Name: Auto, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +`none` means the model will not call a function and instead generates a message. `auto` means the model can pick between generating a message or calling a function. +, + AdditionalModels: null, + Enumerations: null, + Name: ToolChoice, + ClassName: ToolChoice, + ExternalClassName: ToolChoice, + FileNameWithoutExtension: G.Models.ToolChoice + }, + { + Id: function_call, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: none, + Name: None, + Type: , + IsRequired: false, + Summary: + }, + { + Id: auto, + Name: Auto, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +`none` means the model will not call a function and instead generates a message. `auto` means the model can pick between generating a message or calling a function. +, + AdditionalModels: null, + Enumerations: null, + Name: FunctionCall, + ClassName: FunctionCall, + ExternalClassName: FunctionCall, + FileNameWithoutExtension: G.Models.FunctionCall + }, + { + Id: CreateChatCompletionResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: A unique identifier for the chat completion. + }, + { + Id: choices, + Name: Choices, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: A list of chat completion choices. Can be more than one if `n` is greater than 1. + }, + { + Id: created, + Name: Created, + Type: int, + IsRequired: true, + Summary: The Unix timestamp (in seconds) of when the chat completion was created. + }, + { + Id: model, + Name: Model, + Type: string, + IsRequired: true, + Summary: The model used for the chat completion. + }, + { + Id: system_fingerprint, + Name: SystemFingerprint, + Type: string?, + IsRequired: false, + Summary: +This fingerprint represents the backend configuration that the model runs with. + +Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. + + }, + { + Id: object, + Name: Object, + Type: CreateChatCompletionResponseObject, + IsRequired: true, + Summary: The object type, which is always `chat.completion`. + }, + { + Id: usage, + Name: Usage, + Type: CompletionUsage?, + IsRequired: false, + Summary: Usage statistics for the completion request. + } + ], + Summary: Represents a chat completion response returned by model, based on the provided input., + AdditionalModels: null, + Enumerations: null, + Name: CreateChatCompletionResponse, + ClassName: CreateChatCompletionResponse, + ExternalClassName: CreateChatCompletionResponse, + FileNameWithoutExtension: G.Models.CreateChatCompletionResponse + }, + { + Id: choices, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: finish_reason, + Name: FinishReason, + Type: CreateChatCompletionResponseChoicesFinishReason, + IsRequired: true, + Summary: +The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, +`length` if the maximum number of tokens specified in the request was reached, +`content_filter` if content was omitted due to a flag from our content filters, +`tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function. + + }, + { + Id: index, + Name: Index, + Type: int, + IsRequired: true, + Summary: The index of the choice in the list of choices. + }, + { + Id: message, + Name: Message, + Type: ChatCompletionResponseMessage, + IsRequired: true, + Summary: A chat completion message generated by the model. + }, + { + Id: logprobs, + Name: Logprobs, + Type: CreateChatCompletionResponseChoicesLogprobs?, + IsRequired: true, + Summary: Log probability information for the choice. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Choices, + ClassName: Choices, + ExternalClassName: Choices, + FileNameWithoutExtension: G.Models.Choices + }, + { + Id: logprobs, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: content, + Name: Content, + Type: global::System.Collections.Generic.IList?, + IsRequired: true, + Summary: A list of message content tokens with log probability information. + } + ], + Summary: Log probability information for the choice., + AdditionalModels: null, + Enumerations: null, + Name: Logprobs, + ClassName: Logprobs, + ExternalClassName: Logprobs, + FileNameWithoutExtension: G.Models.Logprobs + }, + { + Id: finish_reason, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: stop, + Name: Stop, + Type: , + IsRequired: false, + Summary: + }, + { + Id: length, + Name: Length, + Type: , + IsRequired: false, + Summary: + }, + { + Id: tool_calls, + Name: ToolCalls, + Type: , + IsRequired: false, + Summary: + }, + { + Id: content_filter, + Name: ContentFilter, + Type: , + IsRequired: false, + Summary: + }, + { + Id: function_call, + Name: FunctionCall, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, +`length` if the maximum number of tokens specified in the request was reached, +`content_filter` if content was omitted due to a flag from our content filters, +`tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function. +, + AdditionalModels: null, + Enumerations: null, + Name: FinishReason, + ClassName: FinishReason, + ExternalClassName: FinishReason, + FileNameWithoutExtension: G.Models.FinishReason + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: chat.completion, + Name: Chatcompletion, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The object type, which is always `chat.completion`., + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: CreateChatCompletionFunctionResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: A unique identifier for the chat completion. + }, + { + Id: choices, + Name: Choices, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: A list of chat completion choices. Can be more than one if `n` is greater than 1. + }, + { + Id: created, + Name: Created, + Type: int, + IsRequired: true, + Summary: The Unix timestamp (in seconds) of when the chat completion was created. + }, + { + Id: model, + Name: Model, + Type: string, + IsRequired: true, + Summary: The model used for the chat completion. + }, + { + Id: system_fingerprint, + Name: SystemFingerprint, + Type: string?, + IsRequired: false, + Summary: +This fingerprint represents the backend configuration that the model runs with. + +Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. + + }, + { + Id: object, + Name: Object, + Type: CreateChatCompletionFunctionResponseObject, + IsRequired: true, + Summary: The object type, which is always `chat.completion`. + }, + { + Id: usage, + Name: Usage, + Type: CompletionUsage?, + IsRequired: false, + Summary: Usage statistics for the completion request. + } + ], + Summary: Represents a chat completion response returned by model, based on the provided input., + AdditionalModels: null, + Enumerations: null, + Name: CreateChatCompletionFunctionResponse, + ClassName: CreateChatCompletionFunctionResponse, + ExternalClassName: CreateChatCompletionFunctionResponse, + FileNameWithoutExtension: G.Models.CreateChatCompletionFunctionResponse + }, + { + Id: choices, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: finish_reason, + Name: FinishReason, + Type: CreateChatCompletionFunctionResponseChoicesFinishReason, + IsRequired: true, + Summary: +The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, or `function_call` if the model called a function. + + }, + { + Id: index, + Name: Index, + Type: int, + IsRequired: true, + Summary: The index of the choice in the list of choices. + }, + { + Id: message, + Name: Message, + Type: ChatCompletionResponseMessage, + IsRequired: true, + Summary: A chat completion message generated by the model. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Choices, + ClassName: Choices, + ExternalClassName: Choices, + FileNameWithoutExtension: G.Models.Choices + }, + { + Id: finish_reason, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: stop, + Name: Stop, + Type: , + IsRequired: false, + Summary: + }, + { + Id: length, + Name: Length, + Type: , + IsRequired: false, + Summary: + }, + { + Id: function_call, + Name: FunctionCall, + Type: , + IsRequired: false, + Summary: + }, + { + Id: content_filter, + Name: ContentFilter, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, or `function_call` if the model called a function. +, + AdditionalModels: null, + Enumerations: null, + Name: FinishReason, + ClassName: FinishReason, + ExternalClassName: FinishReason, + FileNameWithoutExtension: G.Models.FinishReason + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: chat.completion, + Name: Chatcompletion, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The object type, which is always `chat.completion`., + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: ChatCompletionTokenLogprob, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: token, + Name: Token, + Type: string, + IsRequired: true, + Summary: The token. + }, + { + Id: logprob, + Name: Logprob, + Type: double, + IsRequired: true, + Summary: The log probability of this token. + }, + { + Id: bytes, + Name: Bytes, + Type: global::System.Collections.Generic.IList?, + IsRequired: true, + Summary: A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token. + }, + { + Id: top_logprobs, + Name: TopLogprobs, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ChatCompletionTokenLogprob, + ClassName: ChatCompletionTokenLogprob, + ExternalClassName: ChatCompletionTokenLogprob, + FileNameWithoutExtension: G.Models.ChatCompletionTokenLogprob + }, + { + Id: top_logprobs, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: token, + Name: Token, + Type: string, + IsRequired: true, + Summary: The token. + }, + { + Id: logprob, + Name: Logprob, + Type: double, + IsRequired: true, + Summary: The log probability of this token. + }, + { + Id: bytes, + Name: Bytes, + Type: global::System.Collections.Generic.IList?, + IsRequired: true, + Summary: A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: TopLogprobs, + ClassName: TopLogprobs, + ExternalClassName: TopLogprobs, + FileNameWithoutExtension: G.Models.TopLogprobs + }, + { + Id: ListPaginatedFineTuningJobsResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: data, + Name: Data, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: + }, + { + Id: has_more, + Name: HasMore, + Type: bool, + IsRequired: true, + Summary: + }, + { + Id: object, + Name: Object, + Type: ListPaginatedFineTuningJobsResponseObject, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ListPaginatedFineTuningJobsResponse, + ClassName: ListPaginatedFineTuningJobsResponse, + ExternalClassName: ListPaginatedFineTuningJobsResponse, + FileNameWithoutExtension: G.Models.ListPaginatedFineTuningJobsResponse + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: list, + Name: List, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: CreateChatCompletionStreamResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: A unique identifier for the chat completion. Each chunk has the same ID. + }, + { + Id: choices, + Name: Choices, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: A list of chat completion choices. Can be more than one if `n` is greater than 1. + }, + { + Id: created, + Name: Created, + Type: int, + IsRequired: true, + Summary: The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp. + }, + { + Id: model, + Name: Model, + Type: string, + IsRequired: true, + Summary: The model to generate the completion. + }, + { + Id: system_fingerprint, + Name: SystemFingerprint, + Type: string?, + IsRequired: false, + Summary: +This fingerprint represents the backend configuration that the model runs with. +Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. + + }, + { + Id: object, + Name: Object, + Type: CreateChatCompletionStreamResponseObject, + IsRequired: true, + Summary: The object type, which is always `chat.completion.chunk`. + } + ], + Summary: Represents a streamed chunk of a chat completion response returned by model, based on the provided input., + AdditionalModels: null, + Enumerations: null, + Name: CreateChatCompletionStreamResponse, + ClassName: CreateChatCompletionStreamResponse, + ExternalClassName: CreateChatCompletionStreamResponse, + FileNameWithoutExtension: G.Models.CreateChatCompletionStreamResponse + }, + { + Id: choices, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: delta, + Name: Delta, + Type: ChatCompletionStreamResponseDelta, + IsRequired: true, + Summary: A chat completion delta generated by streamed model responses. + }, + { + Id: logprobs, + Name: Logprobs, + Type: CreateChatCompletionStreamResponseChoicesLogprobs?, + IsRequired: false, + Summary: Log probability information for the choice. + }, + { + Id: finish_reason, + Name: FinishReason, + Type: CreateChatCompletionStreamResponseChoicesFinishReason?, + IsRequired: true, + Summary: +The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, +`length` if the maximum number of tokens specified in the request was reached, +`content_filter` if content was omitted due to a flag from our content filters, +`tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function. + + }, + { + Id: index, + Name: Index, + Type: int, + IsRequired: true, + Summary: The index of the choice in the list of choices. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Choices, + ClassName: Choices, + ExternalClassName: Choices, + FileNameWithoutExtension: G.Models.Choices + }, + { + Id: logprobs, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: content, + Name: Content, + Type: global::System.Collections.Generic.IList?, + IsRequired: true, + Summary: A list of message content tokens with log probability information. + } + ], + Summary: Log probability information for the choice., + AdditionalModels: null, + Enumerations: null, + Name: Logprobs, + ClassName: Logprobs, + ExternalClassName: Logprobs, + FileNameWithoutExtension: G.Models.Logprobs + }, + { + Id: finish_reason, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: stop, + Name: Stop, + Type: , + IsRequired: false, + Summary: + }, + { + Id: length, + Name: Length, + Type: , + IsRequired: false, + Summary: + }, + { + Id: tool_calls, + Name: ToolCalls, + Type: , + IsRequired: false, + Summary: + }, + { + Id: content_filter, + Name: ContentFilter, + Type: , + IsRequired: false, + Summary: + }, + { + Id: function_call, + Name: FunctionCall, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, +`length` if the maximum number of tokens specified in the request was reached, +`content_filter` if content was omitted due to a flag from our content filters, +`tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function. +, + AdditionalModels: null, + Enumerations: null, + Name: FinishReason, + ClassName: FinishReason, + ExternalClassName: FinishReason, + FileNameWithoutExtension: G.Models.FinishReason + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: chat.completion.chunk, + Name: Chatcompletionchunk, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The object type, which is always `chat.completion.chunk`., + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: CreateChatCompletionImageResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: Represents a streamed chunk of a chat completion response returned by model, based on the provided input., + AdditionalModels: null, + Enumerations: null, + Name: CreateChatCompletionImageResponse, + ClassName: CreateChatCompletionImageResponse, + ExternalClassName: CreateChatCompletionImageResponse, + FileNameWithoutExtension: G.Models.CreateChatCompletionImageResponse + }, + { + Id: CreateEditRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: instruction, + Name: Instruction, + Type: string, + IsRequired: true, + Summary: +The instruction that tells the model how to edit the prompt. +
Example: Fix the spelling mistakes. + }, + { + Id: model, + Name: Model, + Type: object, + IsRequired: true, + Summary: +ID of the model to use. You can use the `text-davinci-edit-001` or `code-davinci-edit-001` model with this endpoint. +
Example: text-davinci-edit-001 + }, + { + Id: input, + Name: Input, + Type: string?, + IsRequired: false, + DefaultValue: , + Summary: +The input text to use as a starting point for the edit. +
Default Value: +
Example: What day of the wek is it? + }, + { + Id: n, + Name: N, + Type: int?, + IsRequired: false, + DefaultValue: 1, + Summary: +How many edits to generate for the input and instruction. +
Default Value: 1 +
Example: 1 + }, + { + Id: temperature, + Name: Temperature, + Type: double?, + IsRequired: false, + DefaultValue: 1, + Summary: +What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + +We generally recommend altering this or `top_p` but not both. + +
Default Value: 1 +
Example: 1 + }, + { + Id: top_p, + Name: TopP, + Type: double?, + IsRequired: false, + DefaultValue: 1, + Summary: +An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + +We generally recommend altering this or `temperature` but not both. + +
Default Value: 1 +
Example: 1 + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateEditRequest, + ClassName: CreateEditRequest, + ExternalClassName: CreateEditRequest, + FileNameWithoutExtension: G.Models.CreateEditRequest + }, + { + Id: model, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: text-davinci-edit-001, + Name: TextDavinciEdit001, + Type: , + IsRequired: false, + Summary: + }, + { + Id: code-davinci-edit-001, + Name: CodeDavinciEdit001, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Model, + ClassName: Model, + ExternalClassName: Model, + FileNameWithoutExtension: G.Models.Model + }, + { + Id: CreateEditResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: choices, + Name: Choices, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: A list of edit choices. Can be more than one if `n` is greater than 1. + }, + { + Id: object, + Name: Object, + Type: CreateEditResponseObject, + IsRequired: true, + Summary: The object type, which is always `edit`. + }, + { + Id: created, + Name: Created, + Type: int, + IsRequired: true, + Summary: The Unix timestamp (in seconds) of when the edit was created. + }, + { + Id: usage, + Name: Usage, + Type: CompletionUsage, + IsRequired: true, + Summary: Usage statistics for the completion request. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateEditResponse, + ClassName: CreateEditResponse, + ExternalClassName: CreateEditResponse, + FileNameWithoutExtension: G.Models.CreateEditResponse + }, + { + Id: choices, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: finish_reason, + Name: FinishReason, + Type: CreateEditResponseChoicesFinishReason, + IsRequired: true, + Summary: +The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, +`length` if the maximum number of tokens specified in the request was reached, +or `content_filter` if content was omitted due to a flag from our content filters. + + }, + { + Id: index, + Name: Index, + Type: int, + IsRequired: true, + Summary: The index of the choice in the list of choices. + }, + { + Id: text, + Name: Text, + Type: string, + IsRequired: true, + Summary: The edited result. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Choices, + ClassName: Choices, + ExternalClassName: Choices, + FileNameWithoutExtension: G.Models.Choices + }, + { + Id: finish_reason, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: stop, + Name: Stop, + Type: , + IsRequired: false, + Summary: + }, + { + Id: length, + Name: Length, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, +`length` if the maximum number of tokens specified in the request was reached, +or `content_filter` if content was omitted due to a flag from our content filters. +, + AdditionalModels: null, + Enumerations: null, + Name: FinishReason, + ClassName: FinishReason, + ExternalClassName: FinishReason, + FileNameWithoutExtension: G.Models.FinishReason + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: edit, + Name: Edit, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The object type, which is always `edit`., + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: CreateImageRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: prompt, + Name: Prompt, + Type: string, + IsRequired: true, + Summary: +A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`. +
Example: A cute baby sea otter + }, + { + Id: model, + Name: Model, + Type: object?, + IsRequired: false, + DefaultValue: dall-e-2, + Summary: +The model to use for image generation. +
Default Value: dall-e-2 +
Example: dall-e-3 + }, + { + Id: n, + Name: N, + Type: int?, + IsRequired: false, + DefaultValue: 1, + Summary: +The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported. +
Default Value: 1 +
Example: 1 + }, + { + Id: quality, + Name: Quality, + Type: CreateImageRequestQuality?, + IsRequired: false, + DefaultValue: standard, + Summary: +The quality of the image that will be generated. `hd` creates images with finer details and greater consistency across the image. This param is only supported for `dall-e-3`. +
Default Value: standard +
Example: standard + }, + { + Id: response_format, + Name: ResponseFormat, + Type: CreateImageRequestResponseFormat?, + IsRequired: false, + DefaultValue: url, + Summary: +The format in which the generated images are returned. Must be one of `url` or `b64_json`. +
Default Value: url +
Example: url + }, + { + Id: size, + Name: Size, + Type: CreateImageRequestSize?, + IsRequired: false, + DefaultValue: 1024x1024, + Summary: +The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3` models. +
Default Value: 1024x1024 +
Example: 1024x1024 + }, + { + Id: style, + Name: Style, + Type: CreateImageRequestStyle?, + IsRequired: false, + DefaultValue: vivid, + Summary: +The style of the generated images. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for `dall-e-3`. +
Default Value: vivid +
Example: vivid + }, + { + Id: user, + Name: User, + Type: string?, + IsRequired: false, + Summary: +A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids). + +
Example: user-1234 + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateImageRequest, + ClassName: CreateImageRequest, + ExternalClassName: CreateImageRequest, + FileNameWithoutExtension: G.Models.CreateImageRequest + }, + { + Id: quality, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: standard, + Name: Standard, + Type: , + IsRequired: false, + Summary: + }, + { + Id: hd, + Name: Hd, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +The quality of the image that will be generated. `hd` creates images with finer details and greater consistency across the image. This param is only supported for `dall-e-3`. +
Default Value: standard +
Example: standard, + AdditionalModels: null, + Enumerations: null, + Name: Quality, + ClassName: Quality, + ExternalClassName: Quality, + FileNameWithoutExtension: G.Models.Quality + }, + { + Id: response_format, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: url, + Name: Url, + Type: , + IsRequired: false, + Summary: + }, + { + Id: b64_json, + Name: B64Json, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +The format in which the generated images are returned. Must be one of `url` or `b64_json`. +
Default Value: url +
Example: url, + AdditionalModels: null, + Enumerations: null, + Name: ResponseFormat, + ClassName: ResponseFormat, + ExternalClassName: ResponseFormat, + FileNameWithoutExtension: G.Models.ResponseFormat + }, + { + Id: size, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: 256x256, + Name: 256x256, + Type: , + IsRequired: false, + Summary: + }, + { + Id: 512x512, + Name: 512x512, + Type: , + IsRequired: false, + Summary: + }, + { + Id: 1024x1024, + Name: 1024x1024, + Type: , + IsRequired: false, + Summary: + }, + { + Id: 1792x1024, + Name: 1792x1024, + Type: , + IsRequired: false, + Summary: + }, + { + Id: 1024x1792, + Name: 1024x1792, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3` models. +
Default Value: 1024x1024 +
Example: 1024x1024, + AdditionalModels: null, + Enumerations: null, + Name: Size, + ClassName: Size, + ExternalClassName: Size, + FileNameWithoutExtension: G.Models.Size + }, + { + Id: style, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: vivid, + Name: Vivid, + Type: , + IsRequired: false, + Summary: + }, + { + Id: natural, + Name: Natural, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +The style of the generated images. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for `dall-e-3`. +
Default Value: vivid +
Example: vivid, + AdditionalModels: null, + Enumerations: null, + Name: Style, + ClassName: Style, + ExternalClassName: Style, + FileNameWithoutExtension: G.Models.Style + }, + { + Id: model, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: dall-e-2, + Name: DallE2, + Type: , + IsRequired: false, + Summary: + }, + { + Id: dall-e-3, + Name: DallE3, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Model, + ClassName: Model, + ExternalClassName: Model, + FileNameWithoutExtension: G.Models.Model + }, + { + Id: ImagesResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: created, + Name: Created, + Type: int, + IsRequired: true, + Summary: + }, + { + Id: data, + Name: Data, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ImagesResponse, + ClassName: ImagesResponse, + ExternalClassName: ImagesResponse, + FileNameWithoutExtension: G.Models.ImagesResponse + }, + { + Id: Image, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: b64_json, + Name: B64Json, + Type: string?, + IsRequired: false, + Summary: The base64-encoded JSON of the generated image, if `response_format` is `b64_json`. + }, + { + Id: url, + Name: Url, + Type: string?, + IsRequired: false, + Summary: The URL of the generated image, if `response_format` is `url` (default). + }, + { + Id: revised_prompt, + Name: RevisedPrompt, + Type: string?, + IsRequired: false, + Summary: The prompt that was used to generate the image, if there was any revision to the prompt. + } + ], + Summary: Represents the url or the content of an image generated by the OpenAI API., + AdditionalModels: null, + Enumerations: null, + Name: Image, + ClassName: Image, + ExternalClassName: Image, + FileNameWithoutExtension: G.Models.Image + }, + { + Id: CreateImageEditRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: image, + Name: Image, + Type: byte[], + IsRequired: true, + Summary: The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask. + }, + { + Id: prompt, + Name: Prompt, + Type: string, + IsRequired: true, + Summary: +A text description of the desired image(s). The maximum length is 1000 characters. +
Example: A cute baby sea otter wearing a beret + }, + { + Id: mask, + Name: Mask, + Type: byte[]?, + IsRequired: false, + Summary: An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. + }, + { + Id: model, + Name: Model, + Type: object?, + IsRequired: false, + DefaultValue: dall-e-2, + Summary: +The model to use for image generation. Only `dall-e-2` is supported at this time. +
Default Value: dall-e-2 +
Example: dall-e-2 + }, + { + Id: n, + Name: N, + Type: int?, + IsRequired: false, + DefaultValue: 1, + Summary: +The number of images to generate. Must be between 1 and 10. +
Default Value: 1 +
Example: 1 + }, + { + Id: size, + Name: Size, + Type: CreateImageEditRequestSize?, + IsRequired: false, + DefaultValue: 1024x1024, + Summary: +The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`. +
Default Value: 1024x1024 +
Example: 1024x1024 + }, + { + Id: response_format, + Name: ResponseFormat, + Type: CreateImageEditRequestResponseFormat?, + IsRequired: false, + DefaultValue: url, + Summary: +The format in which the generated images are returned. Must be one of `url` or `b64_json`. +
Default Value: url +
Example: url + }, + { + Id: user, + Name: User, + Type: string?, + IsRequired: false, + Summary: +A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids). + +
Example: user-1234 + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateImageEditRequest, + ClassName: CreateImageEditRequest, + ExternalClassName: CreateImageEditRequest, + FileNameWithoutExtension: G.Models.CreateImageEditRequest + }, + { + Id: size, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: 256x256, + Name: 256x256, + Type: , + IsRequired: false, + Summary: + }, + { + Id: 512x512, + Name: 512x512, + Type: , + IsRequired: false, + Summary: + }, + { + Id: 1024x1024, + Name: 1024x1024, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`. +
Default Value: 1024x1024 +
Example: 1024x1024, + AdditionalModels: null, + Enumerations: null, + Name: Size, + ClassName: Size, + ExternalClassName: Size, + FileNameWithoutExtension: G.Models.Size + }, + { + Id: response_format, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: url, + Name: Url, + Type: , + IsRequired: false, + Summary: + }, + { + Id: b64_json, + Name: B64Json, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +The format in which the generated images are returned. Must be one of `url` or `b64_json`. +
Default Value: url +
Example: url, + AdditionalModels: null, + Enumerations: null, + Name: ResponseFormat, + ClassName: ResponseFormat, + ExternalClassName: ResponseFormat, + FileNameWithoutExtension: G.Models.ResponseFormat + }, + { + Id: model, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: dall-e-2, + Name: DallE2, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Model, + ClassName: Model, + ExternalClassName: Model, + FileNameWithoutExtension: G.Models.Model + }, + { + Id: CreateImageVariationRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: image, + Name: Image, + Type: byte[], + IsRequired: true, + Summary: The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. + }, + { + Id: model, + Name: Model, + Type: object?, + IsRequired: false, + DefaultValue: dall-e-2, + Summary: +The model to use for image generation. Only `dall-e-2` is supported at this time. +
Default Value: dall-e-2 +
Example: dall-e-2 + }, + { + Id: n, + Name: N, + Type: int?, + IsRequired: false, + DefaultValue: 1, + Summary: +The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported. +
Default Value: 1 +
Example: 1 + }, + { + Id: response_format, + Name: ResponseFormat, + Type: CreateImageVariationRequestResponseFormat?, + IsRequired: false, + DefaultValue: url, + Summary: +The format in which the generated images are returned. Must be one of `url` or `b64_json`. +
Default Value: url +
Example: url + }, + { + Id: size, + Name: Size, + Type: CreateImageVariationRequestSize?, + IsRequired: false, + DefaultValue: 1024x1024, + Summary: +The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`. +
Default Value: 1024x1024 +
Example: 1024x1024 + }, + { + Id: user, + Name: User, + Type: string?, + IsRequired: false, + Summary: +A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids). + +
Example: user-1234 + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateImageVariationRequest, + ClassName: CreateImageVariationRequest, + ExternalClassName: CreateImageVariationRequest, + FileNameWithoutExtension: G.Models.CreateImageVariationRequest + }, + { + Id: response_format, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: url, + Name: Url, + Type: , + IsRequired: false, + Summary: + }, + { + Id: b64_json, + Name: B64Json, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +The format in which the generated images are returned. Must be one of `url` or `b64_json`. +
Default Value: url +
Example: url, + AdditionalModels: null, + Enumerations: null, + Name: ResponseFormat, + ClassName: ResponseFormat, + ExternalClassName: ResponseFormat, + FileNameWithoutExtension: G.Models.ResponseFormat + }, + { + Id: size, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: 256x256, + Name: 256x256, + Type: , + IsRequired: false, + Summary: + }, + { + Id: 512x512, + Name: 512x512, + Type: , + IsRequired: false, + Summary: + }, + { + Id: 1024x1024, + Name: 1024x1024, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`. +
Default Value: 1024x1024 +
Example: 1024x1024, + AdditionalModels: null, + Enumerations: null, + Name: Size, + ClassName: Size, + ExternalClassName: Size, + FileNameWithoutExtension: G.Models.Size + }, + { + Id: model, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: dall-e-2, + Name: DallE2, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Model, + ClassName: Model, + ExternalClassName: Model, + FileNameWithoutExtension: G.Models.Model + }, + { + Id: CreateModerationRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: input, + Name: Input, + Type: object, + IsRequired: true, + Summary: The input text to classify + }, + { + Id: model, + Name: Model, + Type: object?, + IsRequired: false, + DefaultValue: text-moderation-latest, + Summary: +Two content moderations models are available: `text-moderation-stable` and `text-moderation-latest`. + +The default is `text-moderation-latest` which will be automatically upgraded over time. This ensures you are always using our most accurate model. If you use `text-moderation-stable`, we will provide advanced notice before updating the model. Accuracy of `text-moderation-stable` may be slightly lower than for `text-moderation-latest`. + +
Default Value: text-moderation-latest +
Example: text-moderation-stable + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateModerationRequest, + ClassName: CreateModerationRequest, + ExternalClassName: CreateModerationRequest, + FileNameWithoutExtension: G.Models.CreateModerationRequest + }, + { + Id: model, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: text-moderation-latest, + Name: TextModerationLatest, + Type: , + IsRequired: false, + Summary: + }, + { + Id: text-moderation-stable, + Name: TextModerationStable, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Model, + ClassName: Model, + ExternalClassName: Model, + FileNameWithoutExtension: G.Models.Model + }, + { + Id: CreateModerationResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: The unique identifier for the moderation request. + }, + { + Id: model, + Name: Model, + Type: string, + IsRequired: true, + Summary: The model used to generate the moderation results. + }, + { + Id: results, + Name: Results, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: A list of moderation objects. + } + ], + Summary: Represents policy compliance report by OpenAI's content moderation model against a given input., + AdditionalModels: null, + Enumerations: null, + Name: CreateModerationResponse, + ClassName: CreateModerationResponse, + ExternalClassName: CreateModerationResponse, + FileNameWithoutExtension: G.Models.CreateModerationResponse + }, + { + Id: results, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: flagged, + Name: Flagged, + Type: bool, + IsRequired: true, + Summary: Whether the content violates [OpenAI's usage policies](/policies/usage-policies). + }, + { + Id: categories, + Name: Categories, + Type: CreateModerationResponseResultsCategories, + IsRequired: true, + Summary: A list of the categories, and whether they are flagged or not. + }, + { + Id: category_scores, + Name: CategoryScores, + Type: CreateModerationResponseResultsCategoryScores, + IsRequired: true, + Summary: A list of the categories along with their scores as predicted by model. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Results, + ClassName: Results, + ExternalClassName: Results, + FileNameWithoutExtension: G.Models.Results + }, + { + Id: categories, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: hate, + Name: Hate, + Type: bool, + IsRequired: true, + Summary: Content that expresses, incites, or promotes hate based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. Hateful content aimed at non-protected groups (e.g., chess players) is harassment. + }, + { + Id: hate/threatening, + Name: HateThreatening, + Type: bool, + IsRequired: true, + Summary: Hateful content that also includes violence or serious harm towards the targeted group based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. + }, + { + Id: harassment, + Name: Harassment, + Type: bool, + IsRequired: true, + Summary: Content that expresses, incites, or promotes harassing language towards any target. + }, + { + Id: harassment/threatening, + Name: HarassmentThreatening, + Type: bool, + IsRequired: true, + Summary: Harassment content that also includes violence or serious harm towards any target. + }, + { + Id: self-harm, + Name: SelfHarm, + Type: bool, + IsRequired: true, + Summary: Content that promotes, encourages, or depicts acts of self-harm, such as suicide, cutting, and eating disorders. + }, + { + Id: self-harm/intent, + Name: SelfHarmIntent, + Type: bool, + IsRequired: true, + Summary: Content where the speaker expresses that they are engaging or intend to engage in acts of self-harm, such as suicide, cutting, and eating disorders. + }, + { + Id: self-harm/instructions, + Name: SelfHarmInstructions, + Type: bool, + IsRequired: true, + Summary: Content that encourages performing acts of self-harm, such as suicide, cutting, and eating disorders, or that gives instructions or advice on how to commit such acts. + }, + { + Id: sexual, + Name: Sexual, + Type: bool, + IsRequired: true, + Summary: Content meant to arouse sexual excitement, such as the description of sexual activity, or that promotes sexual services (excluding sex education and wellness). + }, + { + Id: sexual/minors, + Name: SexualMinors, + Type: bool, + IsRequired: true, + Summary: Sexual content that includes an individual who is under 18 years old. + }, + { + Id: violence, + Name: Violence, + Type: bool, + IsRequired: true, + Summary: Content that depicts death, violence, or physical injury. + }, + { + Id: violence/graphic, + Name: ViolenceGraphic, + Type: bool, + IsRequired: true, + Summary: Content that depicts death, violence, or physical injury in graphic detail. + } + ], + Summary: A list of the categories, and whether they are flagged or not., + AdditionalModels: null, + Enumerations: null, + Name: Categories, + ClassName: Categories, + ExternalClassName: Categories, + FileNameWithoutExtension: G.Models.Categories + }, + { + Id: category_scores, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: hate, + Name: Hate, + Type: double, + IsRequired: true, + Summary: The score for the category 'hate'. + }, + { + Id: hate/threatening, + Name: HateThreatening, + Type: double, + IsRequired: true, + Summary: The score for the category 'hate/threatening'. + }, + { + Id: harassment, + Name: Harassment, + Type: double, + IsRequired: true, + Summary: The score for the category 'harassment'. + }, + { + Id: harassment/threatening, + Name: HarassmentThreatening, + Type: double, + IsRequired: true, + Summary: The score for the category 'harassment/threatening'. + }, + { + Id: self-harm, + Name: SelfHarm, + Type: double, + IsRequired: true, + Summary: The score for the category 'self-harm'. + }, + { + Id: self-harm/intent, + Name: SelfHarmIntent, + Type: double, + IsRequired: true, + Summary: The score for the category 'self-harm/intent'. + }, + { + Id: self-harm/instructions, + Name: SelfHarmInstructions, + Type: double, + IsRequired: true, + Summary: The score for the category 'self-harm/instructions'. + }, + { + Id: sexual, + Name: Sexual, + Type: double, + IsRequired: true, + Summary: The score for the category 'sexual'. + }, + { + Id: sexual/minors, + Name: SexualMinors, + Type: double, + IsRequired: true, + Summary: The score for the category 'sexual/minors'. + }, + { + Id: violence, + Name: Violence, + Type: double, + IsRequired: true, + Summary: The score for the category 'violence'. + }, + { + Id: violence/graphic, + Name: ViolenceGraphic, + Type: double, + IsRequired: true, + Summary: The score for the category 'violence/graphic'. + } + ], + Summary: A list of the categories along with their scores as predicted by model., + AdditionalModels: null, + Enumerations: null, + Name: CategoryScores, + ClassName: CategoryScores, + ExternalClassName: CategoryScores, + FileNameWithoutExtension: G.Models.CategoryScores + }, + { + Id: ListFilesResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: data, + Name: Data, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: + }, + { + Id: object, + Name: Object, + Type: ListFilesResponseObject, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ListFilesResponse, + ClassName: ListFilesResponse, + ExternalClassName: ListFilesResponse, + FileNameWithoutExtension: G.Models.ListFilesResponse + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: list, + Name: List, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: CreateFileRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: file, + Name: File, + Type: byte[], + IsRequired: true, + Summary: +The File object (not file name) to be uploaded. + + }, + { + Id: purpose, + Name: Purpose, + Type: CreateFileRequestPurpose, + IsRequired: true, + Summary: +The intended purpose of the uploaded file. + +Use "fine-tune" for [Fine-tuning](/docs/api-reference/fine-tuning) and "assistants" for [Assistants](/docs/api-reference/assistants) and [Messages](/docs/api-reference/messages). This allows us to validate the format of the uploaded file is correct for fine-tuning. + + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateFileRequest, + ClassName: CreateFileRequest, + ExternalClassName: CreateFileRequest, + FileNameWithoutExtension: G.Models.CreateFileRequest + }, + { + Id: purpose, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: fine-tune, + Name: FineTune, + Type: , + IsRequired: false, + Summary: + }, + { + Id: assistants, + Name: Assistants, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +The intended purpose of the uploaded file. + +Use "fine-tune" for [Fine-tuning](/docs/api-reference/fine-tuning) and "assistants" for [Assistants](/docs/api-reference/assistants) and [Messages](/docs/api-reference/messages). This allows us to validate the format of the uploaded file is correct for fine-tuning. +, + AdditionalModels: null, + Enumerations: null, + Name: Purpose, + ClassName: Purpose, + ExternalClassName: Purpose, + FileNameWithoutExtension: G.Models.Purpose + }, + { + Id: DeleteFileResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: + }, + { + Id: object, + Name: Object, + Type: DeleteFileResponseObject, + IsRequired: true, + Summary: + }, + { + Id: deleted, + Name: Deleted, + Type: bool, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: DeleteFileResponse, + ClassName: DeleteFileResponse, + ExternalClassName: DeleteFileResponse, + FileNameWithoutExtension: G.Models.DeleteFileResponse + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: file, + Name: File, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: CreateFineTuningJobRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: model, + Name: Model, + Type: object, + IsRequired: true, + Summary: +The name of the model to fine-tune. You can select one of the +[supported models](/docs/guides/fine-tuning/what-models-can-be-fine-tuned). + +
Example: gpt-3.5-turbo + }, + { + Id: training_file, + Name: TrainingFile, + Type: string, + IsRequired: true, + Summary: +The ID of an uploaded file that contains training data. + +See [upload file](/docs/api-reference/files/upload) for how to upload a file. + +Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose `fine-tune`. + +See the [fine-tuning guide](/docs/guides/fine-tuning) for more details. + +
Example: file-abc123 + }, + { + Id: hyperparameters, + Name: Hyperparameters, + Type: CreateFineTuningJobRequestHyperparameters?, + IsRequired: false, + Summary: The hyperparameters used for the fine-tuning job. + }, + { + Id: suffix, + Name: Suffix, + Type: string?, + IsRequired: false, + Summary: +A string of up to 18 characters that will be added to your fine-tuned model name. + +For example, a `suffix` of "custom-model-name" would produce a model name like `ft:gpt-3.5-turbo:openai:custom-model-name:7p4lURel`. + +
Default Value: + }, + { + Id: validation_file, + Name: ValidationFile, + Type: string?, + IsRequired: false, + Summary: +The ID of an uploaded file that contains validation data. + +If you provide this file, the data is used to generate validation +metrics periodically during fine-tuning. These metrics can be viewed in +the fine-tuning results file. +The same data should not be present in both train and validation files. + +Your dataset must be formatted as a JSONL file. You must upload your file with the purpose `fine-tune`. + +See the [fine-tuning guide](/docs/guides/fine-tuning) for more details. + +
Example: file-abc123 + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateFineTuningJobRequest, + ClassName: CreateFineTuningJobRequest, + ExternalClassName: CreateFineTuningJobRequest, + FileNameWithoutExtension: G.Models.CreateFineTuningJobRequest + }, + { + Id: hyperparameters, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: batch_size, + Name: BatchSize, + Type: object?, + IsRequired: false, + DefaultValue: auto, + Summary: +Number of examples in each batch. A larger batch size means that model parameters +are updated less frequently, but with lower variance. + +
Default Value: auto + }, + { + Id: learning_rate_multiplier, + Name: LearningRateMultiplier, + Type: object?, + IsRequired: false, + DefaultValue: auto, + Summary: +Scaling factor for the learning rate. A smaller learning rate may be useful to avoid +overfitting. + +
Default Value: auto + }, + { + Id: n_epochs, + Name: NEpochs, + Type: object?, + IsRequired: false, + DefaultValue: auto, + Summary: +The number of epochs to train the model for. An epoch refers to one full cycle +through the training dataset. + +
Default Value: auto + } + ], + Summary: The hyperparameters used for the fine-tuning job., + AdditionalModels: null, + Enumerations: null, + Name: Hyperparameters, + ClassName: Hyperparameters, + ExternalClassName: Hyperparameters, + FileNameWithoutExtension: G.Models.Hyperparameters + }, + { + Id: batch_size, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: auto, + Name: Auto, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: BatchSize, + ClassName: BatchSize, + ExternalClassName: BatchSize, + FileNameWithoutExtension: G.Models.BatchSize + }, + { + Id: learning_rate_multiplier, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: auto, + Name: Auto, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: LearningRateMultiplier, + ClassName: LearningRateMultiplier, + ExternalClassName: LearningRateMultiplier, + FileNameWithoutExtension: G.Models.LearningRateMultiplier + }, + { + Id: n_epochs, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: auto, + Name: Auto, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: NEpochs, + ClassName: NEpochs, + ExternalClassName: NEpochs, + FileNameWithoutExtension: G.Models.NEpochs + }, + { + Id: model, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: babbage-002, + Name: Babbage002, + Type: , + IsRequired: false, + Summary: + }, + { + Id: davinci-002, + Name: Davinci002, + Type: , + IsRequired: false, + Summary: + }, + { + Id: gpt-3.5-turbo, + Name: Gpt35Turbo, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Model, + ClassName: Model, + ExternalClassName: Model, + FileNameWithoutExtension: G.Models.Model + }, + { + Id: ListFineTuningJobEventsResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: data, + Name: Data, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: + }, + { + Id: object, + Name: Object, + Type: ListFineTuningJobEventsResponseObject, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ListFineTuningJobEventsResponse, + ClassName: ListFineTuningJobEventsResponse, + ExternalClassName: ListFineTuningJobEventsResponse, + FileNameWithoutExtension: G.Models.ListFineTuningJobEventsResponse + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: list, + Name: List, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: CreateFineTuneRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: training_file, + Name: TrainingFile, + Type: string, + IsRequired: true, + Summary: +The ID of an uploaded file that contains training data. + +See [upload file](/docs/api-reference/files/upload) for how to upload a file. + +Your dataset must be formatted as a JSONL file, where each training +example is a JSON object with the keys "prompt" and "completion". +Additionally, you must upload your file with the purpose `fine-tune`. + +See the [fine-tuning guide](/docs/guides/legacy-fine-tuning/creating-training-data) for more details. + +
Example: file-abc123 + }, + { + Id: batch_size, + Name: BatchSize, + Type: int?, + IsRequired: false, + Summary: +The batch size to use for training. The batch size is the number of +training examples used to train a single forward and backward pass. + +By default, the batch size will be dynamically configured to be +~0.2% of the number of examples in the training set, capped at 256 - +in general, we've found that larger batch sizes tend to work better +for larger datasets. + +
Default Value: + }, + { + Id: classification_betas, + Name: ClassificationBetas, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + Summary: +If this is provided, we calculate F-beta scores at the specified +beta values. The F-beta score is a generalization of F-1 score. +This is only used for binary classification. + +With a beta of 1 (i.e. the F-1 score), precision and recall are +given the same weight. A larger beta score puts more weight on +recall and less on precision. A smaller beta score puts more weight +on precision and less on recall. + +
Default Value: +
Example: [0.6, 1, 1.5, 2] + }, + { + Id: classification_n_classes, + Name: ClassificationNClasses, + Type: int?, + IsRequired: false, + Summary: +The number of classes in a classification task. + +This parameter is required for multiclass classification. + +
Default Value: + }, + { + Id: classification_positive_class, + Name: ClassificationPositiveClass, + Type: string?, + IsRequired: false, + Summary: +The positive class in binary classification. + +This parameter is needed to generate precision, recall, and F1 +metrics when doing binary classification. + +
Default Value: + }, + { + Id: compute_classification_metrics, + Name: ComputeClassificationMetrics, + Type: bool?, + IsRequired: false, + DefaultValue: false, + Summary: +If set, we calculate classification-specific metrics such as accuracy +and F-1 score using the validation set at the end of every epoch. +These metrics can be viewed in the [results file](/docs/guides/legacy-fine-tuning/analyzing-your-fine-tuned-model). + +In order to compute classification metrics, you must provide a +`validation_file`. Additionally, you must +specify `classification_n_classes` for multiclass classification or +`classification_positive_class` for binary classification. + +
Default Value: false + }, + { + Id: hyperparameters, + Name: Hyperparameters, + Type: CreateFineTuneRequestHyperparameters?, + IsRequired: false, + Summary: The hyperparameters used for the fine-tuning job. + }, + { + Id: learning_rate_multiplier, + Name: LearningRateMultiplier, + Type: double?, + IsRequired: false, + Summary: +The learning rate multiplier to use for training. +The fine-tuning learning rate is the original learning rate used for +pretraining multiplied by this value. + +By default, the learning rate multiplier is the 0.05, 0.1, or 0.2 +depending on final `batch_size` (larger learning rates tend to +perform better with larger batch sizes). We recommend experimenting +with values in the range 0.02 to 0.2 to see what produces the best +results. + +
Default Value: + }, + { + Id: model, + Name: Model, + Type: object?, + IsRequired: false, + DefaultValue: curie, + Summary: +The name of the base model to fine-tune. You can select one of "ada", +"babbage", "curie", "davinci", or a fine-tuned model created after 2022-04-21 and before 2023-08-22. +To learn more about these models, see the +[Models](/docs/models) documentation. + +
Default Value: curie +
Example: curie + }, + { + Id: prompt_loss_weight, + Name: PromptLossWeight, + Type: double?, + IsRequired: false, + DefaultValue: 0.01, + Summary: +The weight to use for loss on the prompt tokens. This controls how +much the model tries to learn to generate the prompt (as compared +to the completion which always has a weight of 1.0), and can add +a stabilizing effect to training when completions are short. + +If prompts are extremely long (relative to completions), it may make +sense to reduce this weight so as to avoid over-prioritizing +learning the prompt. + +
Default Value: 0.01 + }, + { + Id: suffix, + Name: Suffix, + Type: string?, + IsRequired: false, + Summary: +A string of up to 40 characters that will be added to your fine-tuned model name. + +For example, a `suffix` of "custom-model-name" would produce a model name like `ada:ft-your-org:custom-model-name-2022-02-15-04-21-04`. + +
Default Value: + }, + { + Id: validation_file, + Name: ValidationFile, + Type: string?, + IsRequired: false, + Summary: +The ID of an uploaded file that contains validation data. + +If you provide this file, the data is used to generate validation +metrics periodically during fine-tuning. These metrics can be viewed in +the [fine-tuning results file](/docs/guides/legacy-fine-tuning/analyzing-your-fine-tuned-model). +Your train and validation data should be mutually exclusive. + +Your dataset must be formatted as a JSONL file, where each validation +example is a JSON object with the keys "prompt" and "completion". +Additionally, you must upload your file with the purpose `fine-tune`. + +See the [fine-tuning guide](/docs/guides/legacy-fine-tuning/creating-training-data) for more details. + +
Example: file-abc123 + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateFineTuneRequest, + ClassName: CreateFineTuneRequest, + ExternalClassName: CreateFineTuneRequest, + FileNameWithoutExtension: G.Models.CreateFineTuneRequest + }, + { + Id: hyperparameters, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: n_epochs, + Name: NEpochs, + Type: object?, + IsRequired: false, + DefaultValue: auto, + Summary: +The number of epochs to train the model for. An epoch refers to one +full cycle through the training dataset. + +
Default Value: auto + } + ], + Summary: The hyperparameters used for the fine-tuning job., + AdditionalModels: null, + Enumerations: null, + Name: Hyperparameters, + ClassName: Hyperparameters, + ExternalClassName: Hyperparameters, + FileNameWithoutExtension: G.Models.Hyperparameters + }, + { + Id: n_epochs, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: auto, + Name: Auto, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: NEpochs, + ClassName: NEpochs, + ExternalClassName: NEpochs, + FileNameWithoutExtension: G.Models.NEpochs + }, + { + Id: model, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: ada, + Name: Ada, + Type: , + IsRequired: false, + Summary: + }, + { + Id: babbage, + Name: Babbage, + Type: , + IsRequired: false, + Summary: + }, + { + Id: curie, + Name: Curie, + Type: , + IsRequired: false, + Summary: + }, + { + Id: davinci, + Name: Davinci, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Model, + ClassName: Model, + ExternalClassName: Model, + FileNameWithoutExtension: G.Models.Model + }, + { + Id: ListFineTunesResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: data, + Name: Data, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: + }, + { + Id: object, + Name: Object, + Type: ListFineTunesResponseObject, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ListFineTunesResponse, + ClassName: ListFineTunesResponse, + ExternalClassName: ListFineTunesResponse, + FileNameWithoutExtension: G.Models.ListFineTunesResponse + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: list, + Name: List, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: ListFineTuneEventsResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: data, + Name: Data, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: + }, + { + Id: object, + Name: Object, + Type: ListFineTuneEventsResponseObject, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ListFineTuneEventsResponse, + ClassName: ListFineTuneEventsResponse, + ExternalClassName: ListFineTuneEventsResponse, + FileNameWithoutExtension: G.Models.ListFineTuneEventsResponse + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: list, + Name: List, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: CreateEmbeddingRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: input, + Name: Input, + Type: object, + IsRequired: true, + Summary: +Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for `text-embedding-ada-002`), cannot be an empty string, and any array must be 2048 dimensions or less. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. + +
Example: The quick brown fox jumped over the lazy dog + }, + { + Id: model, + Name: Model, + Type: object, + IsRequired: true, + Summary: +ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them. + +
Example: text-embedding-ada-002 + }, + { + Id: encoding_format, + Name: EncodingFormat, + Type: CreateEmbeddingRequestEncodingFormat?, + IsRequired: false, + DefaultValue: float, + Summary: +The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/). +
Default Value: float +
Example: float + }, + { + Id: user, + Name: User, + Type: string?, + IsRequired: false, + Summary: +A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids). + +
Example: user-1234 + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateEmbeddingRequest, + ClassName: CreateEmbeddingRequest, + ExternalClassName: CreateEmbeddingRequest, + FileNameWithoutExtension: G.Models.CreateEmbeddingRequest + }, + { + Id: encoding_format, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: float, + Name: Float, + Type: , + IsRequired: false, + Summary: + }, + { + Id: base64, + Name: Base64, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/). +
Default Value: float +
Example: float, + AdditionalModels: null, + Enumerations: null, + Name: EncodingFormat, + ClassName: EncodingFormat, + ExternalClassName: EncodingFormat, + FileNameWithoutExtension: G.Models.EncodingFormat + }, + { + Id: model, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: text-embedding-ada-002, + Name: TextEmbeddingAda002, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Model, + ClassName: Model, + ExternalClassName: Model, + FileNameWithoutExtension: G.Models.Model + }, + { + Id: CreateEmbeddingResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: data, + Name: Data, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: The list of embeddings generated by the model. + }, + { + Id: model, + Name: Model, + Type: string, + IsRequired: true, + Summary: The name of the model used to generate the embedding. + }, + { + Id: object, + Name: Object, + Type: CreateEmbeddingResponseObject, + IsRequired: true, + Summary: The object type, which is always "list". + }, + { + Id: usage, + Name: Usage, + Type: CreateEmbeddingResponseUsage, + IsRequired: true, + Summary: The usage information for the request. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateEmbeddingResponse, + ClassName: CreateEmbeddingResponse, + ExternalClassName: CreateEmbeddingResponse, + FileNameWithoutExtension: G.Models.CreateEmbeddingResponse + }, + { + Id: usage, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: prompt_tokens, + Name: PromptTokens, + Type: int, + IsRequired: true, + Summary: The number of tokens used by the prompt. + }, + { + Id: total_tokens, + Name: TotalTokens, + Type: int, + IsRequired: true, + Summary: The total number of tokens used by the request. + } + ], + Summary: The usage information for the request., + AdditionalModels: null, + Enumerations: null, + Name: Usage, + ClassName: Usage, + ExternalClassName: Usage, + FileNameWithoutExtension: G.Models.Usage + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: list, + Name: List, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The object type, which is always "list"., + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: CreateTranscriptionRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: file, + Name: File, + Type: byte[], + IsRequired: true, + Summary: +The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. + + }, + { + Id: model, + Name: Model, + Type: object, + IsRequired: true, + Summary: +ID of the model to use. Only `whisper-1` is currently available. + +
Example: whisper-1 + }, + { + Id: language, + Name: Language, + Type: string?, + IsRequired: false, + Summary: +The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format will improve accuracy and latency. + + }, + { + Id: prompt, + Name: Prompt, + Type: string?, + IsRequired: false, + Summary: +An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should match the audio language. + + }, + { + Id: response_format, + Name: ResponseFormat, + Type: CreateTranscriptionRequestResponseFormat?, + IsRequired: false, + DefaultValue: json, + Summary: +The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`. + +
Default Value: json + }, + { + Id: temperature, + Name: Temperature, + Type: double, + IsRequired: false, + DefaultValue: 0, + Summary: +The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit. + +
Default Value: 0 + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateTranscriptionRequest, + ClassName: CreateTranscriptionRequest, + ExternalClassName: CreateTranscriptionRequest, + FileNameWithoutExtension: G.Models.CreateTranscriptionRequest + }, + { + Id: response_format, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: json, + Name: Json, + Type: , + IsRequired: false, + Summary: + }, + { + Id: text, + Name: Text, + Type: , + IsRequired: false, + Summary: + }, + { + Id: srt, + Name: Srt, + Type: , + IsRequired: false, + Summary: + }, + { + Id: verbose_json, + Name: VerboseJson, + Type: , + IsRequired: false, + Summary: + }, + { + Id: vtt, + Name: Vtt, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`. + +
Default Value: json, + AdditionalModels: null, + Enumerations: null, + Name: ResponseFormat, + ClassName: ResponseFormat, + ExternalClassName: ResponseFormat, + FileNameWithoutExtension: G.Models.ResponseFormat + }, + { + Id: model, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: whisper-1, + Name: Whisper1, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Model, + ClassName: Model, + ExternalClassName: Model, + FileNameWithoutExtension: G.Models.Model + }, + { + Id: CreateTranscriptionResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: text, + Name: Text, + Type: string, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateTranscriptionResponse, + ClassName: CreateTranscriptionResponse, + ExternalClassName: CreateTranscriptionResponse, + FileNameWithoutExtension: G.Models.CreateTranscriptionResponse + }, + { + Id: CreateTranslationRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: file, + Name: File, + Type: byte[], + IsRequired: true, + Summary: +The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. + + }, + { + Id: model, + Name: Model, + Type: object, + IsRequired: true, + Summary: +ID of the model to use. Only `whisper-1` is currently available. + +
Example: whisper-1 + }, + { + Id: prompt, + Name: Prompt, + Type: string?, + IsRequired: false, + Summary: +An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should be in English. + + }, + { + Id: response_format, + Name: ResponseFormat, + Type: string?, + IsRequired: false, + DefaultValue: json, + Summary: +The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`. + +
Default Value: json + }, + { + Id: temperature, + Name: Temperature, + Type: double, + IsRequired: false, + DefaultValue: 0, + Summary: +The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit. + +
Default Value: 0 + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateTranslationRequest, + ClassName: CreateTranslationRequest, + ExternalClassName: CreateTranslationRequest, + FileNameWithoutExtension: G.Models.CreateTranslationRequest + }, + { + Id: model, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: whisper-1, + Name: Whisper1, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Model, + ClassName: Model, + ExternalClassName: Model, + FileNameWithoutExtension: G.Models.Model + }, + { + Id: CreateTranslationResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: text, + Name: Text, + Type: string, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateTranslationResponse, + ClassName: CreateTranslationResponse, + ExternalClassName: CreateTranslationResponse, + FileNameWithoutExtension: G.Models.CreateTranslationResponse + }, + { + Id: CreateSpeechRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: model, + Name: Model, + Type: object, + IsRequired: true, + Summary: +One of the available [TTS models](/docs/models/tts): `tts-1` or `tts-1-hd` + + }, + { + Id: input, + Name: Input, + Type: string, + IsRequired: true, + Summary: The text to generate audio for. The maximum length is 4096 characters. + }, + { + Id: voice, + Name: Voice, + Type: CreateSpeechRequestVoice, + IsRequired: true, + Summary: The voice to use when generating the audio. Supported voices are `alloy`, `echo`, `fable`, `onyx`, `nova`, and `shimmer`. Previews of the voices are available in the [Text to speech guide](/docs/guides/text-to-speech/voice-options). + }, + { + Id: response_format, + Name: ResponseFormat, + Type: CreateSpeechRequestResponseFormat?, + IsRequired: false, + DefaultValue: mp3, + Summary: +The format to audio in. Supported formats are `mp3`, `opus`, `aac`, and `flac`. +
Default Value: mp3 + }, + { + Id: speed, + Name: Speed, + Type: double, + IsRequired: false, + DefaultValue: 1, + Summary: +The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default. +
Default Value: 1 + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateSpeechRequest, + ClassName: CreateSpeechRequest, + ExternalClassName: CreateSpeechRequest, + FileNameWithoutExtension: G.Models.CreateSpeechRequest + }, + { + Id: voice, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: alloy, + Name: Alloy, + Type: , + IsRequired: false, + Summary: + }, + { + Id: echo, + Name: Echo, + Type: , + IsRequired: false, + Summary: + }, + { + Id: fable, + Name: Fable, + Type: , + IsRequired: false, + Summary: + }, + { + Id: onyx, + Name: Onyx, + Type: , + IsRequired: false, + Summary: + }, + { + Id: nova, + Name: Nova, + Type: , + IsRequired: false, + Summary: + }, + { + Id: shimmer, + Name: Shimmer, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The voice to use when generating the audio. Supported voices are `alloy`, `echo`, `fable`, `onyx`, `nova`, and `shimmer`. Previews of the voices are available in the [Text to speech guide](/docs/guides/text-to-speech/voice-options)., + AdditionalModels: null, + Enumerations: null, + Name: Voice, + ClassName: Voice, + ExternalClassName: Voice, + FileNameWithoutExtension: G.Models.Voice + }, + { + Id: response_format, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: mp3, + Name: Mp3, + Type: , + IsRequired: false, + Summary: + }, + { + Id: opus, + Name: Opus, + Type: , + IsRequired: false, + Summary: + }, + { + Id: aac, + Name: Aac, + Type: , + IsRequired: false, + Summary: + }, + { + Id: flac, + Name: Flac, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: +The format to audio in. Supported formats are `mp3`, `opus`, `aac`, and `flac`. +
Default Value: mp3, + AdditionalModels: null, + Enumerations: null, + Name: ResponseFormat, + ClassName: ResponseFormat, + ExternalClassName: ResponseFormat, + FileNameWithoutExtension: G.Models.ResponseFormat + }, + { + Id: model, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: tts-1, + Name: Tts1, + Type: , + IsRequired: false, + Summary: + }, + { + Id: tts-1-hd, + Name: Tts1Hd, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Model, + ClassName: Model, + ExternalClassName: Model, + FileNameWithoutExtension: G.Models.Model + }, + { + Id: Model, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: The model identifier, which can be referenced in the API endpoints. + }, + { + Id: created, + Name: Created, + Type: int, + IsRequired: true, + Summary: The Unix timestamp (in seconds) when the model was created. + }, + { + Id: object, + Name: Object, + Type: ModelObject, + IsRequired: true, + Summary: The object type, which is always "model". + }, + { + Id: owned_by, + Name: OwnedBy, + Type: string, + IsRequired: true, + Summary: The organization that owns the model. + } + ], + Summary: Describes an OpenAI model offering that can be used with the API., + AdditionalModels: null, + Enumerations: null, + Name: Model, + ClassName: Model, + ExternalClassName: Model, + FileNameWithoutExtension: G.Models.Model + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: model, + Name: Model, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The object type, which is always "model"., + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: OpenAIFile, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: The file identifier, which can be referenced in the API endpoints. + }, + { + Id: bytes, + Name: Bytes, + Type: int, + IsRequired: true, + Summary: The size of the file, in bytes. + }, + { + Id: created_at, + Name: CreatedAt, + Type: int, + IsRequired: true, + Summary: The Unix timestamp (in seconds) for when the file was created. + }, + { + Id: filename, + Name: Filename, + Type: string, + IsRequired: true, + Summary: The name of the file. + }, + { + Id: object, + Name: Object, + Type: OpenAIFileObject, + IsRequired: true, + Summary: The object type, which is always `file`. + }, + { + Id: purpose, + Name: Purpose, + Type: OpenAIFilePurpose, + IsRequired: true, + Summary: The intended purpose of the file. Supported values are `fine-tune`, `fine-tune-results`, `assistants`, and `assistants_output`. + }, + { + Id: status, + Name: Status, + Type: OpenAIFileStatus, + IsRequired: true, + Summary: Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`. + }, + { + Id: status_details, + Name: StatusDetails, + Type: string?, + IsRequired: false, + Summary: Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`. + } + ], + Summary: The `File` object represents a document that has been uploaded to OpenAI., + AdditionalModels: null, + Enumerations: null, + Name: OpenAIFile, + ClassName: OpenAIFile, + ExternalClassName: OpenAIFile, + FileNameWithoutExtension: G.Models.OpenAIFile + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: file, + Name: File, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The object type, which is always `file`., + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: purpose, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: fine-tune, + Name: FineTune, + Type: , + IsRequired: false, + Summary: + }, + { + Id: fine-tune-results, + Name: FineTuneResults, + Type: , + IsRequired: false, + Summary: + }, + { + Id: assistants, + Name: Assistants, + Type: , + IsRequired: false, + Summary: + }, + { + Id: assistants_output, + Name: AssistantsOutput, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The intended purpose of the file. Supported values are `fine-tune`, `fine-tune-results`, `assistants`, and `assistants_output`., + AdditionalModels: null, + Enumerations: null, + Name: Purpose, + ClassName: Purpose, + ExternalClassName: Purpose, + FileNameWithoutExtension: G.Models.Purpose + }, + { + Id: status, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: uploaded, + Name: Uploaded, + Type: , + IsRequired: false, + Summary: + }, + { + Id: processed, + Name: Processed, + Type: , + IsRequired: false, + Summary: + }, + { + Id: error, + Name: Error, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`., + AdditionalModels: null, + Enumerations: null, + Name: Status, + ClassName: Status, + ExternalClassName: Status, + FileNameWithoutExtension: G.Models.Status + }, + { + Id: Embedding, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: index, + Name: Index, + Type: int, + IsRequired: true, + Summary: The index of the embedding in the list of embeddings. + }, + { + Id: embedding, + Name: Embedding1, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: +The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the [embedding guide](/docs/guides/embeddings). + + }, + { + Id: object, + Name: Object, + Type: EmbeddingObject, + IsRequired: true, + Summary: The object type, which is always "embedding". + } + ], + Summary: +Represents an embedding vector returned by embedding endpoint. +, + AdditionalModels: null, + Enumerations: null, + Name: Embedding, + ClassName: Embedding, + ExternalClassName: Embedding, + FileNameWithoutExtension: G.Models.Embedding + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: embedding, + Name: Embedding, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The object type, which is always "embedding"., + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: FineTuningJob, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: The object identifier, which can be referenced in the API endpoints. + }, + { + Id: created_at, + Name: CreatedAt, + Type: int, + IsRequired: true, + Summary: The Unix timestamp (in seconds) for when the fine-tuning job was created. + }, + { + Id: error, + Name: Error, + Type: FineTuningJobError?, + IsRequired: true, + Summary: For fine-tuning jobs that have `failed`, this will contain more information on the cause of the failure. + }, + { + Id: fine_tuned_model, + Name: FineTunedModel, + Type: string?, + IsRequired: true, + Summary: The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running. + }, + { + Id: finished_at, + Name: FinishedAt, + Type: int?, + IsRequired: true, + Summary: The Unix timestamp (in seconds) for when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running. + }, + { + Id: hyperparameters, + Name: Hyperparameters, + Type: FineTuningJobHyperparameters, + IsRequired: true, + Summary: The hyperparameters used for the fine-tuning job. See the [fine-tuning guide](/docs/guides/fine-tuning) for more details. + }, + { + Id: model, + Name: Model, + Type: string, + IsRequired: true, + Summary: The base model that is being fine-tuned. + }, + { + Id: object, + Name: Object, + Type: FineTuningJobObject, + IsRequired: true, + Summary: The object type, which is always "fine_tuning.job". + }, + { + Id: organization_id, + Name: OrganizationId, + Type: string, + IsRequired: true, + Summary: The organization that owns the fine-tuning job. + }, + { + Id: result_files, + Name: ResultFiles, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/docs/api-reference/files/retrieve-contents). + }, + { + Id: status, + Name: Status, + Type: FineTuningJobStatus, + IsRequired: true, + Summary: The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`. + }, + { + Id: trained_tokens, + Name: TrainedTokens, + Type: int?, + IsRequired: true, + Summary: The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running. + }, + { + Id: training_file, + Name: TrainingFile, + Type: string, + IsRequired: true, + Summary: The file ID used for training. You can retrieve the training data with the [Files API](/docs/api-reference/files/retrieve-contents). + }, + { + Id: validation_file, + Name: ValidationFile, + Type: string?, + IsRequired: true, + Summary: The file ID used for validation. You can retrieve the validation results with the [Files API](/docs/api-reference/files/retrieve-contents). + } + ], + Summary: +The `fine_tuning.job` object represents a fine-tuning job that has been created through the API. +, + AdditionalModels: null, + Enumerations: null, + Name: FineTuningJob, + ClassName: FineTuningJob, + ExternalClassName: FineTuningJob, + FileNameWithoutExtension: G.Models.FineTuningJob + }, + { + Id: error, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: code, + Name: Code, + Type: string, + IsRequired: true, + Summary: A machine-readable error code. + }, + { + Id: message, + Name: Message, + Type: string, + IsRequired: true, + Summary: A human-readable error message. + }, + { + Id: param, + Name: Param, + Type: string?, + IsRequired: true, + Summary: The parameter that was invalid, usually `training_file` or `validation_file`. This field will be null if the failure was not parameter-specific. + } + ], + Summary: For fine-tuning jobs that have `failed`, this will contain more information on the cause of the failure., + AdditionalModels: null, + Enumerations: null, + Name: Error, + ClassName: Error, + ExternalClassName: Error, + FileNameWithoutExtension: G.Models.Error + }, + { + Id: hyperparameters, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: n_epochs, + Name: NEpochs, + Type: object, + IsRequired: true, + DefaultValue: auto, + Summary: +The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. +"auto" decides the optimal number of epochs based on the size of the dataset. If setting the number manually, we support any number between 1 and 50 epochs. +
Default Value: auto + } + ], + Summary: The hyperparameters used for the fine-tuning job. See the [fine-tuning guide](/docs/guides/fine-tuning) for more details., + AdditionalModels: null, + Enumerations: null, + Name: Hyperparameters, + ClassName: Hyperparameters, + ExternalClassName: Hyperparameters, + FileNameWithoutExtension: G.Models.Hyperparameters + }, + { + Id: n_epochs, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: auto, + Name: Auto, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: NEpochs, + ClassName: NEpochs, + ExternalClassName: NEpochs, + FileNameWithoutExtension: G.Models.NEpochs + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: fine_tuning.job, + Name: FineTuningjob, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The object type, which is always "fine_tuning.job"., + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: status, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: validating_files, + Name: ValidatingFiles, + Type: , + IsRequired: false, + Summary: + }, + { + Id: queued, + Name: Queued, + Type: , + IsRequired: false, + Summary: + }, + { + Id: running, + Name: Running, + Type: , + IsRequired: false, + Summary: + }, + { + Id: succeeded, + Name: Succeeded, + Type: , + IsRequired: false, + Summary: + }, + { + Id: failed, + Name: Failed, + Type: , + IsRequired: false, + Summary: + }, + { + Id: cancelled, + Name: Cancelled, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`., + AdditionalModels: null, + Enumerations: null, + Name: Status, + ClassName: Status, + ExternalClassName: Status, + FileNameWithoutExtension: G.Models.Status + }, + { + Id: FineTuningJobEvent, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: + }, + { + Id: created_at, + Name: CreatedAt, + Type: int, + IsRequired: true, + Summary: + }, + { + Id: level, + Name: Level, + Type: FineTuningJobEventLevel, + IsRequired: true, + Summary: + }, + { + Id: message, + Name: Message, + Type: string, + IsRequired: true, + Summary: + }, + { + Id: object, + Name: Object, + Type: FineTuningJobEventObject, + IsRequired: true, + Summary: + } + ], + Summary: Fine-tuning job event object, + AdditionalModels: null, + Enumerations: null, + Name: FineTuningJobEvent, + ClassName: FineTuningJobEvent, + ExternalClassName: FineTuningJobEvent, + FileNameWithoutExtension: G.Models.FineTuningJobEvent + }, + { + Id: level, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: info, + Name: Info, + Type: , + IsRequired: false, + Summary: + }, + { + Id: warn, + Name: Warn, + Type: , + IsRequired: false, + Summary: + }, + { + Id: error, + Name: Error, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Level, + ClassName: Level, + ExternalClassName: Level, + FileNameWithoutExtension: G.Models.Level + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: fine_tuning.job.event, + Name: FineTuningjobevent, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: FineTune, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: The object identifier, which can be referenced in the API endpoints. + }, + { + Id: created_at, + Name: CreatedAt, + Type: int, + IsRequired: true, + Summary: The Unix timestamp (in seconds) for when the fine-tuning job was created. + }, + { + Id: events, + Name: Events, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + Summary: The list of events that have been observed in the lifecycle of the FineTune job. + }, + { + Id: fine_tuned_model, + Name: FineTunedModel, + Type: string?, + IsRequired: true, + Summary: The name of the fine-tuned model that is being created. + }, + { + Id: hyperparams, + Name: Hyperparams, + Type: FineTuneHyperparams, + IsRequired: true, + Summary: The hyperparameters used for the fine-tuning job. See the [fine-tuning guide](/docs/guides/legacy-fine-tuning/hyperparameters) for more details. + }, + { + Id: model, + Name: Model, + Type: string, + IsRequired: true, + Summary: The base model that is being fine-tuned. + }, + { + Id: object, + Name: Object, + Type: FineTuneObject, + IsRequired: true, + Summary: The object type, which is always "fine-tune". + }, + { + Id: organization_id, + Name: OrganizationId, + Type: string, + IsRequired: true, + Summary: The organization that owns the fine-tuning job. + }, + { + Id: result_files, + Name: ResultFiles, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: The compiled results files for the fine-tuning job. + }, + { + Id: status, + Name: Status, + Type: string, + IsRequired: true, + Summary: The current status of the fine-tuning job, which can be either `created`, `running`, `succeeded`, `failed`, or `cancelled`. + }, + { + Id: training_files, + Name: TrainingFiles, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: The list of files used for training. + }, + { + Id: updated_at, + Name: UpdatedAt, + Type: int, + IsRequired: true, + Summary: The Unix timestamp (in seconds) for when the fine-tuning job was last updated. + }, + { + Id: validation_files, + Name: ValidationFiles, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: The list of files used for validation. + } + ], + Summary: +The `FineTune` object represents a legacy fine-tune job that has been created through the API. +, + AdditionalModels: null, + Enumerations: null, + Name: FineTune, + ClassName: FineTune, + ExternalClassName: FineTune, + FileNameWithoutExtension: G.Models.FineTune + }, + { + Id: hyperparams, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: batch_size, + Name: BatchSize, + Type: int, + IsRequired: true, + Summary: +The batch size to use for training. The batch size is the number of +training examples used to train a single forward and backward pass. + + }, + { + Id: classification_n_classes, + Name: ClassificationNClasses, + Type: int, + IsRequired: false, + Summary: +The number of classes to use for computing classification metrics. + + }, + { + Id: classification_positive_class, + Name: ClassificationPositiveClass, + Type: string?, + IsRequired: false, + Summary: +The positive class to use for computing classification metrics. + + }, + { + Id: compute_classification_metrics, + Name: ComputeClassificationMetrics, + Type: bool, + IsRequired: false, + Summary: +The classification metrics to compute using the validation dataset at the end of every epoch. + + }, + { + Id: learning_rate_multiplier, + Name: LearningRateMultiplier, + Type: double, + IsRequired: true, + Summary: +The learning rate multiplier to use for training. + + }, + { + Id: n_epochs, + Name: NEpochs, + Type: int, + IsRequired: true, + Summary: +The number of epochs to train the model for. An epoch refers to one +full cycle through the training dataset. + + }, + { + Id: prompt_loss_weight, + Name: PromptLossWeight, + Type: double, + IsRequired: true, + Summary: +The weight to use for loss on the prompt tokens. + + } + ], + Summary: The hyperparameters used for the fine-tuning job. See the [fine-tuning guide](/docs/guides/legacy-fine-tuning/hyperparameters) for more details., + AdditionalModels: null, + Enumerations: null, + Name: Hyperparams, + ClassName: Hyperparams, + ExternalClassName: Hyperparams, + FileNameWithoutExtension: G.Models.Hyperparams + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: fine-tune, + Name: FineTune, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The object type, which is always "fine-tune"., + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: FineTuneEvent, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: created_at, + Name: CreatedAt, + Type: int, + IsRequired: true, + Summary: + }, + { + Id: level, + Name: Level, + Type: string, + IsRequired: true, + Summary: + }, + { + Id: message, + Name: Message, + Type: string, + IsRequired: true, + Summary: + }, + { + Id: object, + Name: Object, + Type: FineTuneEventObject, + IsRequired: true, + Summary: + } + ], + Summary: Fine-tune event object, + AdditionalModels: null, + Enumerations: null, + Name: FineTuneEvent, + ClassName: FineTuneEvent, + ExternalClassName: FineTuneEvent, + FileNameWithoutExtension: G.Models.FineTuneEvent + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: fine-tune-event, + Name: FineTuneEvent, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: CompletionUsage, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: completion_tokens, + Name: CompletionTokens, + Type: int, + IsRequired: true, + Summary: Number of tokens in the generated completion. + }, + { + Id: prompt_tokens, + Name: PromptTokens, + Type: int, + IsRequired: true, + Summary: Number of tokens in the prompt. + }, + { + Id: total_tokens, + Name: TotalTokens, + Type: int, + IsRequired: true, + Summary: Total number of tokens used in the request (prompt + completion). + } + ], + Summary: Usage statistics for the completion request., + AdditionalModels: null, + Enumerations: null, + Name: CompletionUsage, + ClassName: CompletionUsage, + ExternalClassName: CompletionUsage, + FileNameWithoutExtension: G.Models.CompletionUsage + }, + { + Id: AssistantObject, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: The identifier, which can be referenced in API endpoints. + }, + { + Id: object, + Name: Object, + Type: AssistantObjectObject, + IsRequired: true, + Summary: The object type, which is always `assistant`. + }, + { + Id: created_at, + Name: CreatedAt, + Type: int, + IsRequired: true, + Summary: The Unix timestamp (in seconds) for when the assistant was created. + }, + { + Id: name, + Name: Name, + Type: string?, + IsRequired: true, + Summary: +The name of the assistant. The maximum length is 256 characters. + + }, + { + Id: description, + Name: Description, + Type: string?, + IsRequired: true, + Summary: +The description of the assistant. The maximum length is 512 characters. + + }, + { + Id: model, + Name: Model, + Type: string, + IsRequired: true, + Summary: +ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them. + + }, + { + Id: instructions, + Name: Instructions, + Type: string?, + IsRequired: true, + Summary: +The system instructions that the assistant uses. The maximum length is 32768 characters. + + }, + { + Id: tools, + Name: Tools, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + DefaultValue: [], + Summary: +A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`. + +
Default Value: [] + }, + { + Id: file_ids, + Name: FileIds, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + DefaultValue: [], + Summary: +A list of [file](/docs/api-reference/files) IDs attached to this assistant. There can be a maximum of 20 files attached to the assistant. Files are ordered by their creation date in ascending order. + +
Default Value: [] + }, + { + Id: metadata, + Name: Metadata, + Type: AssistantObjectMetadata?, + IsRequired: true, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + + } + ], + Summary: Represents an `assistant` that can call the model and use tools., + AdditionalModels: null, + Enumerations: null, + Name: AssistantObject, + ClassName: AssistantObject, + ExternalClassName: AssistantObject, + FileNameWithoutExtension: G.Models.AssistantObject + }, + { + Id: metadata, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +, + AdditionalModels: null, + Enumerations: null, + Name: Metadata, + ClassName: Metadata, + ExternalClassName: Metadata, + FileNameWithoutExtension: G.Models.Metadata + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: assistant, + Name: Assistant, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The object type, which is always `assistant`., + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: CreateAssistantRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: model, + Name: Model, + Type: object, + IsRequired: true, + Summary: +ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them. + + }, + { + Id: name, + Name: Name, + Type: string?, + IsRequired: false, + Summary: +The name of the assistant. The maximum length is 256 characters. + + }, + { + Id: description, + Name: Description, + Type: string?, + IsRequired: false, + Summary: +The description of the assistant. The maximum length is 512 characters. + + }, + { + Id: instructions, + Name: Instructions, + Type: string?, + IsRequired: false, + Summary: +The system instructions that the assistant uses. The maximum length is 32768 characters. + + }, + { + Id: tools, + Name: Tools, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + DefaultValue: [], + Summary: +A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`. + +
Default Value: [] + }, + { + Id: file_ids, + Name: FileIds, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + DefaultValue: [], + Summary: +A list of [file](/docs/api-reference/files) IDs attached to this assistant. There can be a maximum of 20 files attached to the assistant. Files are ordered by their creation date in ascending order. + +
Default Value: [] + }, + { + Id: metadata, + Name: Metadata, + Type: CreateAssistantRequestMetadata?, + IsRequired: false, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateAssistantRequest, + ClassName: CreateAssistantRequest, + ExternalClassName: CreateAssistantRequest, + FileNameWithoutExtension: G.Models.CreateAssistantRequest + }, + { + Id: metadata, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +, + AdditionalModels: null, + Enumerations: null, + Name: Metadata, + ClassName: Metadata, + ExternalClassName: Metadata, + FileNameWithoutExtension: G.Models.Metadata + }, + { + Id: ModifyAssistantRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: model, + Name: Model, + Type: object?, + IsRequired: false, + Summary: +ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them. + + }, + { + Id: name, + Name: Name, + Type: string?, + IsRequired: false, + Summary: +The name of the assistant. The maximum length is 256 characters. + + }, + { + Id: description, + Name: Description, + Type: string?, + IsRequired: false, + Summary: +The description of the assistant. The maximum length is 512 characters. + + }, + { + Id: instructions, + Name: Instructions, + Type: string?, + IsRequired: false, + Summary: +The system instructions that the assistant uses. The maximum length is 32768 characters. + + }, + { + Id: tools, + Name: Tools, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + DefaultValue: [], + Summary: +A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`. + +
Default Value: [] + }, + { + Id: file_ids, + Name: FileIds, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + DefaultValue: [], + Summary: +A list of [File](/docs/api-reference/files) IDs attached to this assistant. There can be a maximum of 20 files attached to the assistant. Files are ordered by their creation date in ascending order. If a file was previously attached to the list but does not show up in the list, it will be deleted from the assistant. + +
Default Value: [] + }, + { + Id: metadata, + Name: Metadata, + Type: ModifyAssistantRequestMetadata?, + IsRequired: false, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ModifyAssistantRequest, + ClassName: ModifyAssistantRequest, + ExternalClassName: ModifyAssistantRequest, + FileNameWithoutExtension: G.Models.ModifyAssistantRequest + }, + { + Id: metadata, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +, + AdditionalModels: null, + Enumerations: null, + Name: Metadata, + ClassName: Metadata, + ExternalClassName: Metadata, + FileNameWithoutExtension: G.Models.Metadata + }, + { + Id: DeleteAssistantResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: + }, + { + Id: deleted, + Name: Deleted, + Type: bool, + IsRequired: true, + Summary: + }, + { + Id: object, + Name: Object, + Type: DeleteAssistantResponseObject, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: DeleteAssistantResponse, + ClassName: DeleteAssistantResponse, + ExternalClassName: DeleteAssistantResponse, + FileNameWithoutExtension: G.Models.DeleteAssistantResponse + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: assistant.deleted, + Name: Assistantdeleted, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: ListAssistantsResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: object, + Name: Object, + Type: string, + IsRequired: true, + Summary: +
Example: list + }, + { + Id: data, + Name: Data, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: + }, + { + Id: first_id, + Name: FirstId, + Type: string, + IsRequired: true, + Summary: +
Example: asst_abc123 + }, + { + Id: last_id, + Name: LastId, + Type: string, + IsRequired: true, + Summary: +
Example: asst_abc456 + }, + { + Id: has_more, + Name: HasMore, + Type: bool, + IsRequired: true, + Summary: +
Example: false + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ListAssistantsResponse, + ClassName: ListAssistantsResponse, + ExternalClassName: ListAssistantsResponse, + FileNameWithoutExtension: G.Models.ListAssistantsResponse + }, + { + Id: AssistantToolsCode, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: type, + Name: Type, + Type: AssistantToolsCodeType, + IsRequired: true, + Summary: The type of tool being defined: `code_interpreter` + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: AssistantToolsCode, + ClassName: AssistantToolsCode, + ExternalClassName: AssistantToolsCode, + FileNameWithoutExtension: G.Models.AssistantToolsCode + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: code_interpreter, + Name: CodeInterpreter, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The type of tool being defined: `code_interpreter`, + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: AssistantToolsRetrieval, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: type, + Name: Type, + Type: AssistantToolsRetrievalType, + IsRequired: true, + Summary: The type of tool being defined: `retrieval` + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: AssistantToolsRetrieval, + ClassName: AssistantToolsRetrieval, + ExternalClassName: AssistantToolsRetrieval, + FileNameWithoutExtension: G.Models.AssistantToolsRetrieval + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: retrieval, + Name: Retrieval, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The type of tool being defined: `retrieval`, + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: AssistantToolsFunction, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: type, + Name: Type, + Type: AssistantToolsFunctionType, + IsRequired: true, + Summary: The type of tool being defined: `function` + }, + { + Id: function, + Name: Function, + Type: FunctionObject, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: AssistantToolsFunction, + ClassName: AssistantToolsFunction, + ExternalClassName: AssistantToolsFunction, + FileNameWithoutExtension: G.Models.AssistantToolsFunction + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: function, + Name: Function, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The type of tool being defined: `function`, + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: RunObject, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: The identifier, which can be referenced in API endpoints. + }, + { + Id: object, + Name: Object, + Type: RunObjectObject, + IsRequired: true, + Summary: The object type, which is always `thread.run`. + }, + { + Id: created_at, + Name: CreatedAt, + Type: int, + IsRequired: true, + Summary: The Unix timestamp (in seconds) for when the run was created. + }, + { + Id: thread_id, + Name: ThreadId, + Type: string, + IsRequired: true, + Summary: The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. + }, + { + Id: assistant_id, + Name: AssistantId, + Type: string, + IsRequired: true, + Summary: The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. + }, + { + Id: status, + Name: Status, + Type: RunObjectStatus, + IsRequired: true, + Summary: The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, or `expired`. + }, + { + Id: required_action, + Name: RequiredAction, + Type: RunObjectRequiredAction?, + IsRequired: true, + Summary: Details on the action required to continue the run. Will be `null` if no action is required. + }, + { + Id: last_error, + Name: LastError, + Type: RunObjectLastError?, + IsRequired: true, + Summary: The last error associated with this run. Will be `null` if there are no errors. + }, + { + Id: expires_at, + Name: ExpiresAt, + Type: int, + IsRequired: true, + Summary: The Unix timestamp (in seconds) for when the run will expire. + }, + { + Id: started_at, + Name: StartedAt, + Type: int?, + IsRequired: true, + Summary: The Unix timestamp (in seconds) for when the run was started. + }, + { + Id: cancelled_at, + Name: CancelledAt, + Type: int?, + IsRequired: true, + Summary: The Unix timestamp (in seconds) for when the run was cancelled. + }, + { + Id: failed_at, + Name: FailedAt, + Type: int?, + IsRequired: true, + Summary: The Unix timestamp (in seconds) for when the run failed. + }, + { + Id: completed_at, + Name: CompletedAt, + Type: int?, + IsRequired: true, + Summary: The Unix timestamp (in seconds) for when the run was completed. + }, + { + Id: model, + Name: Model, + Type: string, + IsRequired: true, + Summary: The model that the [assistant](/docs/api-reference/assistants) used for this run. + }, + { + Id: instructions, + Name: Instructions, + Type: string, + IsRequired: true, + Summary: The instructions that the [assistant](/docs/api-reference/assistants) used for this run. + }, + { + Id: tools, + Name: Tools, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + DefaultValue: [], + Summary: +The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. +
Default Value: [] + }, + { + Id: file_ids, + Name: FileIds, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + DefaultValue: [], + Summary: +The list of [File](/docs/api-reference/files) IDs the [assistant](/docs/api-reference/assistants) used for this run. +
Default Value: [] + }, + { + Id: metadata, + Name: Metadata, + Type: RunObjectMetadata?, + IsRequired: true, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + + } + ], + Summary: Represents an execution run on a [thread](/docs/api-reference/threads)., + AdditionalModels: null, + Enumerations: null, + Name: RunObject, + ClassName: RunObject, + ExternalClassName: RunObject, + FileNameWithoutExtension: G.Models.RunObject + }, + { + Id: required_action, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: type, + Name: Type, + Type: RunObjectRequiredActionType, + IsRequired: true, + Summary: For now, this is always `submit_tool_outputs`. + }, + { + Id: submit_tool_outputs, + Name: SubmitToolOutputs, + Type: RunObjectRequiredActionSubmitToolOutputs, + IsRequired: true, + Summary: Details on the tool outputs needed for this run to continue. + } + ], + Summary: Details on the action required to continue the run. Will be `null` if no action is required., + AdditionalModels: null, + Enumerations: null, + Name: RequiredAction, + ClassName: RequiredAction, + ExternalClassName: RequiredAction, + FileNameWithoutExtension: G.Models.RequiredAction + }, + { + Id: submit_tool_outputs, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: tool_calls, + Name: ToolCalls, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: A list of the relevant tool calls. + } + ], + Summary: Details on the tool outputs needed for this run to continue., + AdditionalModels: null, + Enumerations: null, + Name: SubmitToolOutputs, + ClassName: SubmitToolOutputs, + ExternalClassName: SubmitToolOutputs, + FileNameWithoutExtension: G.Models.SubmitToolOutputs + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: submit_tool_outputs, + Name: SubmitToolOutputs, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: For now, this is always `submit_tool_outputs`., + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: last_error, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: code, + Name: Code, + Type: RunObjectLastErrorCode, + IsRequired: true, + Summary: One of `server_error` or `rate_limit_exceeded`. + }, + { + Id: message, + Name: Message, + Type: string, + IsRequired: true, + Summary: A human-readable description of the error. + } + ], + Summary: The last error associated with this run. Will be `null` if there are no errors., + AdditionalModels: null, + Enumerations: null, + Name: LastError, + ClassName: LastError, + ExternalClassName: LastError, + FileNameWithoutExtension: G.Models.LastError + }, + { + Id: code, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: server_error, + Name: ServerError, + Type: , + IsRequired: false, + Summary: + }, + { + Id: rate_limit_exceeded, + Name: RateLimitExceeded, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: One of `server_error` or `rate_limit_exceeded`., + AdditionalModels: null, + Enumerations: null, + Name: Code, + ClassName: Code, + ExternalClassName: Code, + FileNameWithoutExtension: G.Models.Code + }, + { + Id: metadata, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +, + AdditionalModels: null, + Enumerations: null, + Name: Metadata, + ClassName: Metadata, + ExternalClassName: Metadata, + FileNameWithoutExtension: G.Models.Metadata + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: thread.run, + Name: Threadrun, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The object type, which is always `thread.run`., + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: status, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: queued, + Name: Queued, + Type: , + IsRequired: false, + Summary: + }, + { + Id: in_progress, + Name: InProgress, + Type: , + IsRequired: false, + Summary: + }, + { + Id: requires_action, + Name: RequiresAction, + Type: , + IsRequired: false, + Summary: + }, + { + Id: cancelling, + Name: Cancelling, + Type: , + IsRequired: false, + Summary: + }, + { + Id: cancelled, + Name: Cancelled, + Type: , + IsRequired: false, + Summary: + }, + { + Id: failed, + Name: Failed, + Type: , + IsRequired: false, + Summary: + }, + { + Id: completed, + Name: Completed, + Type: , + IsRequired: false, + Summary: + }, + { + Id: expired, + Name: Expired, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, or `expired`., + AdditionalModels: null, + Enumerations: null, + Name: Status, + ClassName: Status, + ExternalClassName: Status, + FileNameWithoutExtension: G.Models.Status + }, + { + Id: CreateRunRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: assistant_id, + Name: AssistantId, + Type: string, + IsRequired: true, + Summary: The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run. + }, + { + Id: model, + Name: Model, + Type: string?, + IsRequired: false, + Summary: The ID of the [Model](/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. + }, + { + Id: instructions, + Name: Instructions, + Type: string?, + IsRequired: false, + Summary: Overrides the [instructions](/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis. + }, + { + Id: additional_instructions, + Name: AdditionalInstructions, + Type: string?, + IsRequired: false, + Summary: Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions. + }, + { + Id: tools, + Name: Tools, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + Summary: Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. + }, + { + Id: metadata, + Name: Metadata, + Type: CreateRunRequestMetadata?, + IsRequired: false, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateRunRequest, + ClassName: CreateRunRequest, + ExternalClassName: CreateRunRequest, + FileNameWithoutExtension: G.Models.CreateRunRequest + }, + { + Id: metadata, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +, + AdditionalModels: null, + Enumerations: null, + Name: Metadata, + ClassName: Metadata, + ExternalClassName: Metadata, + FileNameWithoutExtension: G.Models.Metadata + }, + { + Id: ListRunsResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: object, + Name: Object, + Type: string, + IsRequired: true, + Summary: +
Example: list + }, + { + Id: data, + Name: Data, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: + }, + { + Id: first_id, + Name: FirstId, + Type: string, + IsRequired: true, + Summary: +
Example: run_abc123 + }, + { + Id: last_id, + Name: LastId, + Type: string, + IsRequired: true, + Summary: +
Example: run_abc456 + }, + { + Id: has_more, + Name: HasMore, + Type: bool, + IsRequired: true, + Summary: +
Example: false + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ListRunsResponse, + ClassName: ListRunsResponse, + ExternalClassName: ListRunsResponse, + FileNameWithoutExtension: G.Models.ListRunsResponse + }, + { + Id: ModifyRunRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: metadata, + Name: Metadata, + Type: ModifyRunRequestMetadata?, + IsRequired: false, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ModifyRunRequest, + ClassName: ModifyRunRequest, + ExternalClassName: ModifyRunRequest, + FileNameWithoutExtension: G.Models.ModifyRunRequest + }, + { + Id: metadata, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +, + AdditionalModels: null, + Enumerations: null, + Name: Metadata, + ClassName: Metadata, + ExternalClassName: Metadata, + FileNameWithoutExtension: G.Models.Metadata + }, + { + Id: SubmitToolOutputsRunRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: tool_outputs, + Name: ToolOutputs, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: A list of tools for which the outputs are being submitted. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: SubmitToolOutputsRunRequest, + ClassName: SubmitToolOutputsRunRequest, + ExternalClassName: SubmitToolOutputsRunRequest, + FileNameWithoutExtension: G.Models.SubmitToolOutputsRunRequest + }, + { + Id: tool_outputs, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: tool_call_id, + Name: ToolCallId, + Type: string?, + IsRequired: false, + Summary: The ID of the tool call in the `required_action` object within the run object the output is being submitted for. + }, + { + Id: output, + Name: Output, + Type: string?, + IsRequired: false, + Summary: The output of the tool call to be submitted to continue the run. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ToolOutputs, + ClassName: ToolOutputs, + ExternalClassName: ToolOutputs, + FileNameWithoutExtension: G.Models.ToolOutputs + }, + { + Id: RunToolCallObject, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. + }, + { + Id: type, + Name: Type, + Type: RunToolCallObjectType, + IsRequired: true, + Summary: The type of tool call the output is required for. For now, this is always `function`. + }, + { + Id: function, + Name: Function, + Type: RunToolCallObjectFunction, + IsRequired: true, + Summary: The function definition. + } + ], + Summary: Tool call objects, + AdditionalModels: null, + Enumerations: null, + Name: RunToolCallObject, + ClassName: RunToolCallObject, + ExternalClassName: RunToolCallObject, + FileNameWithoutExtension: G.Models.RunToolCallObject + }, + { + Id: function, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: name, + Name: Name, + Type: string, + IsRequired: true, + Summary: The name of the function. + }, + { + Id: arguments, + Name: Arguments, + Type: string, + IsRequired: true, + Summary: The arguments that the model expects you to pass to the function. + } + ], + Summary: The function definition., + AdditionalModels: null, + Enumerations: null, + Name: Function, + ClassName: Function, + ExternalClassName: Function, + FileNameWithoutExtension: G.Models.Function + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: function, + Name: Function, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The type of tool call the output is required for. For now, this is always `function`., + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: CreateThreadAndRunRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: assistant_id, + Name: AssistantId, + Type: string, + IsRequired: true, + Summary: The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run. + }, + { + Id: thread, + Name: Thread, + Type: CreateThreadRequest?, + IsRequired: false, + Summary: + }, + { + Id: model, + Name: Model, + Type: string?, + IsRequired: false, + Summary: The ID of the [Model](/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. + }, + { + Id: instructions, + Name: Instructions, + Type: string?, + IsRequired: false, + Summary: Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. + }, + { + Id: tools, + Name: Tools, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + Summary: Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. + }, + { + Id: metadata, + Name: Metadata, + Type: CreateThreadAndRunRequestMetadata?, + IsRequired: false, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateThreadAndRunRequest, + ClassName: CreateThreadAndRunRequest, + ExternalClassName: CreateThreadAndRunRequest, + FileNameWithoutExtension: G.Models.CreateThreadAndRunRequest + }, + { + Id: metadata, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +, + AdditionalModels: null, + Enumerations: null, + Name: Metadata, + ClassName: Metadata, + ExternalClassName: Metadata, + FileNameWithoutExtension: G.Models.Metadata + }, + { + Id: ThreadObject, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: The identifier, which can be referenced in API endpoints. + }, + { + Id: object, + Name: Object, + Type: ThreadObjectObject, + IsRequired: true, + Summary: The object type, which is always `thread`. + }, + { + Id: created_at, + Name: CreatedAt, + Type: int, + IsRequired: true, + Summary: The Unix timestamp (in seconds) for when the thread was created. + }, + { + Id: metadata, + Name: Metadata, + Type: ThreadObjectMetadata?, + IsRequired: true, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + + } + ], + Summary: Represents a thread that contains [messages](/docs/api-reference/messages)., + AdditionalModels: null, + Enumerations: null, + Name: ThreadObject, + ClassName: ThreadObject, + ExternalClassName: ThreadObject, + FileNameWithoutExtension: G.Models.ThreadObject + }, + { + Id: metadata, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +, + AdditionalModels: null, + Enumerations: null, + Name: Metadata, + ClassName: Metadata, + ExternalClassName: Metadata, + FileNameWithoutExtension: G.Models.Metadata + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: thread, + Name: Thread, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The object type, which is always `thread`., + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: CreateThreadRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: messages, + Name: Messages, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + Summary: A list of [messages](/docs/api-reference/messages) to start the thread with. + }, + { + Id: metadata, + Name: Metadata, + Type: CreateThreadRequestMetadata?, + IsRequired: false, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateThreadRequest, + ClassName: CreateThreadRequest, + ExternalClassName: CreateThreadRequest, + FileNameWithoutExtension: G.Models.CreateThreadRequest + }, + { + Id: metadata, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +, + AdditionalModels: null, + Enumerations: null, + Name: Metadata, + ClassName: Metadata, + ExternalClassName: Metadata, + FileNameWithoutExtension: G.Models.Metadata + }, + { + Id: ModifyThreadRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: metadata, + Name: Metadata, + Type: ModifyThreadRequestMetadata?, + IsRequired: false, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ModifyThreadRequest, + ClassName: ModifyThreadRequest, + ExternalClassName: ModifyThreadRequest, + FileNameWithoutExtension: G.Models.ModifyThreadRequest + }, + { + Id: metadata, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +, + AdditionalModels: null, + Enumerations: null, + Name: Metadata, + ClassName: Metadata, + ExternalClassName: Metadata, + FileNameWithoutExtension: G.Models.Metadata + }, + { + Id: DeleteThreadResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: + }, + { + Id: deleted, + Name: Deleted, + Type: bool, + IsRequired: true, + Summary: + }, + { + Id: object, + Name: Object, + Type: DeleteThreadResponseObject, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: DeleteThreadResponse, + ClassName: DeleteThreadResponse, + ExternalClassName: DeleteThreadResponse, + FileNameWithoutExtension: G.Models.DeleteThreadResponse + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: thread.deleted, + Name: Threaddeleted, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: ListThreadsResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: object, + Name: Object, + Type: string, + IsRequired: true, + Summary: +
Example: list + }, + { + Id: data, + Name: Data, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: + }, + { + Id: first_id, + Name: FirstId, + Type: string, + IsRequired: true, + Summary: +
Example: asst_abc123 + }, + { + Id: last_id, + Name: LastId, + Type: string, + IsRequired: true, + Summary: +
Example: asst_abc456 + }, + { + Id: has_more, + Name: HasMore, + Type: bool, + IsRequired: true, + Summary: +
Example: false + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ListThreadsResponse, + ClassName: ListThreadsResponse, + ExternalClassName: ListThreadsResponse, + FileNameWithoutExtension: G.Models.ListThreadsResponse + }, + { + Id: MessageObject, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: The identifier, which can be referenced in API endpoints. + }, + { + Id: object, + Name: Object, + Type: MessageObjectObject, + IsRequired: true, + Summary: The object type, which is always `thread.message`. + }, + { + Id: created_at, + Name: CreatedAt, + Type: int, + IsRequired: true, + Summary: The Unix timestamp (in seconds) for when the message was created. + }, + { + Id: thread_id, + Name: ThreadId, + Type: string, + IsRequired: true, + Summary: The [thread](/docs/api-reference/threads) ID that this message belongs to. + }, + { + Id: role, + Name: Role, + Type: MessageObjectRole, + IsRequired: true, + Summary: The entity that produced the message. One of `user` or `assistant`. + }, + { + Id: content, + Name: Content, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: The content of the message in array of text and/or images. + }, + { + Id: assistant_id, + Name: AssistantId, + Type: string?, + IsRequired: true, + Summary: If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. + }, + { + Id: run_id, + Name: RunId, + Type: string?, + IsRequired: true, + Summary: If applicable, the ID of the [run](/docs/api-reference/runs) associated with the authoring of this message. + }, + { + Id: file_ids, + Name: FileIds, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + DefaultValue: [], + Summary: +A list of [file](/docs/api-reference/files) IDs that the assistant should use. Useful for tools like retrieval and code_interpreter that can access files. A maximum of 10 files can be attached to a message. +
Default Value: [] + }, + { + Id: metadata, + Name: Metadata, + Type: MessageObjectMetadata?, + IsRequired: true, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + + } + ], + Summary: Represents a message within a [thread](/docs/api-reference/threads)., + AdditionalModels: null, + Enumerations: null, + Name: MessageObject, + ClassName: MessageObject, + ExternalClassName: MessageObject, + FileNameWithoutExtension: G.Models.MessageObject + }, + { + Id: metadata, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +, + AdditionalModels: null, + Enumerations: null, + Name: Metadata, + ClassName: Metadata, + ExternalClassName: Metadata, + FileNameWithoutExtension: G.Models.Metadata + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: thread.message, + Name: Threadmessage, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The object type, which is always `thread.message`., + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: role, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: user, + Name: User, + Type: , + IsRequired: false, + Summary: + }, + { + Id: assistant, + Name: Assistant, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The entity that produced the message. One of `user` or `assistant`., + AdditionalModels: null, + Enumerations: null, + Name: Role, + ClassName: Role, + ExternalClassName: Role, + FileNameWithoutExtension: G.Models.Role + }, + { + Id: CreateMessageRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: role, + Name: Role, + Type: CreateMessageRequestRole, + IsRequired: true, + Summary: The role of the entity that is creating the message. Currently only `user` is supported. + }, + { + Id: content, + Name: Content, + Type: string, + IsRequired: true, + Summary: The content of the message. + }, + { + Id: file_ids, + Name: FileIds, + Type: global::System.Collections.Generic.IList?, + IsRequired: false, + DefaultValue: [], + Summary: +A list of [File](/docs/api-reference/files) IDs that the message should use. There can be a maximum of 10 files attached to a message. Useful for tools like `retrieval` and `code_interpreter` that can access and use files. +
Default Value: [] + }, + { + Id: metadata, + Name: Metadata, + Type: CreateMessageRequestMetadata?, + IsRequired: false, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateMessageRequest, + ClassName: CreateMessageRequest, + ExternalClassName: CreateMessageRequest, + FileNameWithoutExtension: G.Models.CreateMessageRequest + }, + { + Id: metadata, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +, + AdditionalModels: null, + Enumerations: null, + Name: Metadata, + ClassName: Metadata, + ExternalClassName: Metadata, + FileNameWithoutExtension: G.Models.Metadata + }, + { + Id: role, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: user, + Name: User, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The role of the entity that is creating the message. Currently only `user` is supported., + AdditionalModels: null, + Enumerations: null, + Name: Role, + ClassName: Role, + ExternalClassName: Role, + FileNameWithoutExtension: G.Models.Role + }, + { + Id: ModifyMessageRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: metadata, + Name: Metadata, + Type: ModifyMessageRequestMetadata?, + IsRequired: false, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ModifyMessageRequest, + ClassName: ModifyMessageRequest, + ExternalClassName: ModifyMessageRequest, + FileNameWithoutExtension: G.Models.ModifyMessageRequest + }, + { + Id: metadata, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +, + AdditionalModels: null, + Enumerations: null, + Name: Metadata, + ClassName: Metadata, + ExternalClassName: Metadata, + FileNameWithoutExtension: G.Models.Metadata + }, + { + Id: DeleteMessageResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: + }, + { + Id: deleted, + Name: Deleted, + Type: bool, + IsRequired: true, + Summary: + }, + { + Id: object, + Name: Object, + Type: DeleteMessageResponseObject, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: DeleteMessageResponse, + ClassName: DeleteMessageResponse, + ExternalClassName: DeleteMessageResponse, + FileNameWithoutExtension: G.Models.DeleteMessageResponse + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: thread.message.deleted, + Name: Threadmessagedeleted, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: ListMessagesResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: object, + Name: Object, + Type: string, + IsRequired: true, + Summary: +
Example: list + }, + { + Id: data, + Name: Data, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: + }, + { + Id: first_id, + Name: FirstId, + Type: string, + IsRequired: true, + Summary: +
Example: msg_abc123 + }, + { + Id: last_id, + Name: LastId, + Type: string, + IsRequired: true, + Summary: +
Example: msg_abc123 + }, + { + Id: has_more, + Name: HasMore, + Type: bool, + IsRequired: true, + Summary: +
Example: false + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ListMessagesResponse, + ClassName: ListMessagesResponse, + ExternalClassName: ListMessagesResponse, + FileNameWithoutExtension: G.Models.ListMessagesResponse + }, + { + Id: MessageContentImageFileObject, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: type, + Name: Type, + Type: MessageContentImageFileObjectType, + IsRequired: true, + Summary: Always `image_file`. + }, + { + Id: image_file, + Name: ImageFile, + Type: MessageContentImageFileObjectImageFile, + IsRequired: true, + Summary: + } + ], + Summary: References an image [File](/docs/api-reference/files) in the content of a message., + AdditionalModels: null, + Enumerations: null, + Name: MessageContentImageFileObject, + ClassName: MessageContentImageFileObject, + ExternalClassName: MessageContentImageFileObject, + FileNameWithoutExtension: G.Models.MessageContentImageFileObject + }, + { + Id: image_file, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: file_id, + Name: FileId, + Type: string, + IsRequired: true, + Summary: The [File](/docs/api-reference/files) ID of the image in the message content. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ImageFile, + ClassName: ImageFile, + ExternalClassName: ImageFile, + FileNameWithoutExtension: G.Models.ImageFile + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: image_file, + Name: ImageFile, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: Always `image_file`., + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: MessageContentTextObject, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: type, + Name: Type, + Type: MessageContentTextObjectType, + IsRequired: true, + Summary: Always `text`. + }, + { + Id: text, + Name: Text, + Type: MessageContentTextObjectText, + IsRequired: true, + Summary: + } + ], + Summary: The text content that is part of a message., + AdditionalModels: null, + Enumerations: null, + Name: MessageContentTextObject, + ClassName: MessageContentTextObject, + ExternalClassName: MessageContentTextObject, + FileNameWithoutExtension: G.Models.MessageContentTextObject + }, + { + Id: text, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: value, + Name: Value, + Type: string, + IsRequired: true, + Summary: The data that makes up the text. + }, + { + Id: annotations, + Name: Annotations, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Text, + ClassName: Text, + ExternalClassName: Text, + FileNameWithoutExtension: G.Models.Text + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: text, + Name: Text, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: Always `text`., + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: MessageContentTextAnnotationsFileCitationObject, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: type, + Name: Type, + Type: MessageContentTextAnnotationsFileCitationObjectType, + IsRequired: true, + Summary: Always `file_citation`. + }, + { + Id: text, + Name: Text, + Type: string, + IsRequired: true, + Summary: The text in the message content that needs to be replaced. + }, + { + Id: file_citation, + Name: FileCitation, + Type: MessageContentTextAnnotationsFileCitationObjectFileCitation, + IsRequired: true, + Summary: + }, + { + Id: start_index, + Name: StartIndex, + Type: int, + IsRequired: true, + Summary: + }, + { + Id: end_index, + Name: EndIndex, + Type: int, + IsRequired: true, + Summary: + } + ], + Summary: A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "retrieval" tool to search files., + AdditionalModels: null, + Enumerations: null, + Name: MessageContentTextAnnotationsFileCitationObject, + ClassName: MessageContentTextAnnotationsFileCitationObject, + ExternalClassName: MessageContentTextAnnotationsFileCitationObject, + FileNameWithoutExtension: G.Models.MessageContentTextAnnotationsFileCitationObject + }, + { + Id: file_citation, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: file_id, + Name: FileId, + Type: string, + IsRequired: true, + Summary: The ID of the specific File the citation is from. + }, + { + Id: quote, + Name: Quote, + Type: string, + IsRequired: true, + Summary: The specific quote in the file. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: FileCitation, + ClassName: FileCitation, + ExternalClassName: FileCitation, + FileNameWithoutExtension: G.Models.FileCitation + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: file_citation, + Name: FileCitation, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: Always `file_citation`., + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: MessageContentTextAnnotationsFilePathObject, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: type, + Name: Type, + Type: MessageContentTextAnnotationsFilePathObjectType, + IsRequired: true, + Summary: Always `file_path`. + }, + { + Id: text, + Name: Text, + Type: string, + IsRequired: true, + Summary: The text in the message content that needs to be replaced. + }, + { + Id: file_path, + Name: FilePath, + Type: MessageContentTextAnnotationsFilePathObjectFilePath, + IsRequired: true, + Summary: + }, + { + Id: start_index, + Name: StartIndex, + Type: int, + IsRequired: true, + Summary: + }, + { + Id: end_index, + Name: EndIndex, + Type: int, + IsRequired: true, + Summary: + } + ], + Summary: A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file., + AdditionalModels: null, + Enumerations: null, + Name: MessageContentTextAnnotationsFilePathObject, + ClassName: MessageContentTextAnnotationsFilePathObject, + ExternalClassName: MessageContentTextAnnotationsFilePathObject, + FileNameWithoutExtension: G.Models.MessageContentTextAnnotationsFilePathObject + }, + { + Id: file_path, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: file_id, + Name: FileId, + Type: string, + IsRequired: true, + Summary: The ID of the file that was generated. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: FilePath, + ClassName: FilePath, + ExternalClassName: FilePath, + FileNameWithoutExtension: G.Models.FilePath + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: file_path, + Name: FilePath, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: Always `file_path`., + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: RunStepObject, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: The identifier of the run step, which can be referenced in API endpoints. + }, + { + Id: object, + Name: Object, + Type: RunStepObjectObject, + IsRequired: true, + Summary: The object type, which is always `thread.run.step`. + }, + { + Id: created_at, + Name: CreatedAt, + Type: int, + IsRequired: true, + Summary: The Unix timestamp (in seconds) for when the run step was created. + }, + { + Id: assistant_id, + Name: AssistantId, + Type: string, + IsRequired: true, + Summary: The ID of the [assistant](/docs/api-reference/assistants) associated with the run step. + }, + { + Id: thread_id, + Name: ThreadId, + Type: string, + IsRequired: true, + Summary: The ID of the [thread](/docs/api-reference/threads) that was run. + }, + { + Id: run_id, + Name: RunId, + Type: string, + IsRequired: true, + Summary: The ID of the [run](/docs/api-reference/runs) that this run step is a part of. + }, + { + Id: type, + Name: Type, + Type: RunStepObjectType, + IsRequired: true, + Summary: The type of run step, which can be either `message_creation` or `tool_calls`. + }, + { + Id: status, + Name: Status, + Type: RunStepObjectStatus, + IsRequired: true, + Summary: The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. + }, + { + Id: step_details, + Name: StepDetails, + Type: RunStepObjectStepDetails, + IsRequired: true, + Summary: The details of the run step. + }, + { + Id: last_error, + Name: LastError, + Type: RunStepObjectLastError?, + IsRequired: true, + Summary: The last error associated with this run step. Will be `null` if there are no errors. + }, + { + Id: expired_at, + Name: ExpiredAt, + Type: int?, + IsRequired: true, + Summary: The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. + }, + { + Id: cancelled_at, + Name: CancelledAt, + Type: int?, + IsRequired: true, + Summary: The Unix timestamp (in seconds) for when the run step was cancelled. + }, + { + Id: failed_at, + Name: FailedAt, + Type: int?, + IsRequired: true, + Summary: The Unix timestamp (in seconds) for when the run step failed. + }, + { + Id: completed_at, + Name: CompletedAt, + Type: int?, + IsRequired: true, + Summary: The Unix timestamp (in seconds) for when the run step completed. + }, + { + Id: metadata, + Name: Metadata, + Type: RunStepObjectMetadata?, + IsRequired: true, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. + + } + ], + Summary: +Represents a step in execution of a run. +, + AdditionalModels: null, + Enumerations: null, + Name: RunStepObject, + ClassName: RunStepObject, + ExternalClassName: RunStepObject, + FileNameWithoutExtension: G.Models.RunStepObject + }, + { + Id: step_details, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: The details of the run step., + AdditionalModels: null, + Enumerations: null, + Name: StepDetails, + ClassName: StepDetails, + ExternalClassName: StepDetails, + FileNameWithoutExtension: G.Models.StepDetails + }, + { + Id: last_error, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: code, + Name: Code, + Type: RunStepObjectLastErrorCode, + IsRequired: true, + Summary: One of `server_error` or `rate_limit_exceeded`. + }, + { + Id: message, + Name: Message, + Type: string, + IsRequired: true, + Summary: A human-readable description of the error. + } + ], + Summary: The last error associated with this run step. Will be `null` if there are no errors., + AdditionalModels: null, + Enumerations: null, + Name: LastError, + ClassName: LastError, + ExternalClassName: LastError, + FileNameWithoutExtension: G.Models.LastError + }, + { + Id: code, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: server_error, + Name: ServerError, + Type: , + IsRequired: false, + Summary: + }, + { + Id: rate_limit_exceeded, + Name: RateLimitExceeded, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: One of `server_error` or `rate_limit_exceeded`., + AdditionalModels: null, + Enumerations: null, + Name: Code, + ClassName: Code, + ExternalClassName: Code, + FileNameWithoutExtension: G.Models.Code + }, + { + Id: metadata, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: +Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. +, + AdditionalModels: null, + Enumerations: null, + Name: Metadata, + ClassName: Metadata, + ExternalClassName: Metadata, + FileNameWithoutExtension: G.Models.Metadata + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: thread.run.step, + Name: Threadrunstep, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The object type, which is always `thread.run.step`., + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: message_creation, + Name: MessageCreation, + Type: , + IsRequired: false, + Summary: + }, + { + Id: tool_calls, + Name: ToolCalls, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The type of run step, which can be either `message_creation` or `tool_calls`., + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: status, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: in_progress, + Name: InProgress, + Type: , + IsRequired: false, + Summary: + }, + { + Id: cancelled, + Name: Cancelled, + Type: , + IsRequired: false, + Summary: + }, + { + Id: failed, + Name: Failed, + Type: , + IsRequired: false, + Summary: + }, + { + Id: completed, + Name: Completed, + Type: , + IsRequired: false, + Summary: + }, + { + Id: expired, + Name: Expired, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`., + AdditionalModels: null, + Enumerations: null, + Name: Status, + ClassName: Status, + ExternalClassName: Status, + FileNameWithoutExtension: G.Models.Status + }, + { + Id: ListRunStepsResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: object, + Name: Object, + Type: string, + IsRequired: true, + Summary: +
Example: list + }, + { + Id: data, + Name: Data, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: + }, + { + Id: first_id, + Name: FirstId, + Type: string, + IsRequired: true, + Summary: +
Example: step_abc123 + }, + { + Id: last_id, + Name: LastId, + Type: string, + IsRequired: true, + Summary: +
Example: step_abc456 + }, + { + Id: has_more, + Name: HasMore, + Type: bool, + IsRequired: true, + Summary: +
Example: false + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ListRunStepsResponse, + ClassName: ListRunStepsResponse, + ExternalClassName: ListRunStepsResponse, + FileNameWithoutExtension: G.Models.ListRunStepsResponse + }, + { + Id: RunStepDetailsMessageCreationObject, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: type, + Name: Type, + Type: RunStepDetailsMessageCreationObjectType, + IsRequired: true, + Summary: Always `message_creation`. + }, + { + Id: message_creation, + Name: MessageCreation, + Type: RunStepDetailsMessageCreationObjectMessageCreation, + IsRequired: true, + Summary: + } + ], + Summary: Details of the message creation by the run step., + AdditionalModels: null, + Enumerations: null, + Name: RunStepDetailsMessageCreationObject, + ClassName: RunStepDetailsMessageCreationObject, + ExternalClassName: RunStepDetailsMessageCreationObject, + FileNameWithoutExtension: G.Models.RunStepDetailsMessageCreationObject + }, + { + Id: message_creation, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: message_id, + Name: MessageId, + Type: string, + IsRequired: true, + Summary: The ID of the message that was created by this run step. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: MessageCreation, + ClassName: MessageCreation, + ExternalClassName: MessageCreation, + FileNameWithoutExtension: G.Models.MessageCreation + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: message_creation, + Name: MessageCreation, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: Always `message_creation`., + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: RunStepDetailsToolCallsObject, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: type, + Name: Type, + Type: RunStepDetailsToolCallsObjectType, + IsRequired: true, + Summary: Always `tool_calls`. + }, + { + Id: tool_calls, + Name: ToolCalls, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: +An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `retrieval`, or `function`. + + } + ], + Summary: Details of the tool call., + AdditionalModels: null, + Enumerations: null, + Name: RunStepDetailsToolCallsObject, + ClassName: RunStepDetailsToolCallsObject, + ExternalClassName: RunStepDetailsToolCallsObject, + FileNameWithoutExtension: G.Models.RunStepDetailsToolCallsObject + }, + { + Id: tool_calls, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ToolCalls, + ClassName: ToolCalls, + ExternalClassName: ToolCalls, + FileNameWithoutExtension: G.Models.ToolCalls + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: tool_calls, + Name: ToolCalls, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: Always `tool_calls`., + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: RunStepDetailsToolCallsCodeObject, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: The ID of the tool call. + }, + { + Id: type, + Name: Type, + Type: RunStepDetailsToolCallsCodeObjectType, + IsRequired: true, + Summary: The type of tool call. This is always going to be `code_interpreter` for this type of tool call. + }, + { + Id: code_interpreter, + Name: CodeInterpreter, + Type: RunStepDetailsToolCallsCodeObjectCodeInterpreter, + IsRequired: true, + Summary: The Code Interpreter tool call definition. + } + ], + Summary: Details of the Code Interpreter tool call the run step was involved in., + AdditionalModels: null, + Enumerations: null, + Name: RunStepDetailsToolCallsCodeObject, + ClassName: RunStepDetailsToolCallsCodeObject, + ExternalClassName: RunStepDetailsToolCallsCodeObject, + FileNameWithoutExtension: G.Models.RunStepDetailsToolCallsCodeObject + }, + { + Id: code_interpreter, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: input, + Name: Input, + Type: string, + IsRequired: true, + Summary: The input to the Code Interpreter tool call. + }, + { + Id: outputs, + Name: Outputs, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. + } + ], + Summary: The Code Interpreter tool call definition., + AdditionalModels: null, + Enumerations: null, + Name: CodeInterpreter, + ClassName: CodeInterpreter, + ExternalClassName: CodeInterpreter, + FileNameWithoutExtension: G.Models.CodeInterpreter + }, + { + Id: outputs, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Outputs, + ClassName: Outputs, + ExternalClassName: Outputs, + FileNameWithoutExtension: G.Models.Outputs + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: code_interpreter, + Name: CodeInterpreter, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The type of tool call. This is always going to be `code_interpreter` for this type of tool call., + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: RunStepDetailsToolCallsCodeOutputLogsObject, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: type, + Name: Type, + Type: RunStepDetailsToolCallsCodeOutputLogsObjectType, + IsRequired: true, + Summary: Always `logs`. + }, + { + Id: logs, + Name: Logs, + Type: string, + IsRequired: true, + Summary: The text output from the Code Interpreter tool call. + } + ], + Summary: Text output from the Code Interpreter tool call as part of a run step., + AdditionalModels: null, + Enumerations: null, + Name: RunStepDetailsToolCallsCodeOutputLogsObject, + ClassName: RunStepDetailsToolCallsCodeOutputLogsObject, + ExternalClassName: RunStepDetailsToolCallsCodeOutputLogsObject, + FileNameWithoutExtension: G.Models.RunStepDetailsToolCallsCodeOutputLogsObject + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: logs, + Name: Logs, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: Always `logs`., + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: RunStepDetailsToolCallsCodeOutputImageObject, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: type, + Name: Type, + Type: RunStepDetailsToolCallsCodeOutputImageObjectType, + IsRequired: true, + Summary: Always `image`. + }, + { + Id: image, + Name: Image, + Type: RunStepDetailsToolCallsCodeOutputImageObjectImage, + IsRequired: true, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: RunStepDetailsToolCallsCodeOutputImageObject, + ClassName: RunStepDetailsToolCallsCodeOutputImageObject, + ExternalClassName: RunStepDetailsToolCallsCodeOutputImageObject, + FileNameWithoutExtension: G.Models.RunStepDetailsToolCallsCodeOutputImageObject + }, + { + Id: image, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: file_id, + Name: FileId, + Type: string, + IsRequired: true, + Summary: The [file](/docs/api-reference/files) ID of the image. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Image, + ClassName: Image, + ExternalClassName: Image, + FileNameWithoutExtension: G.Models.Image + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: image, + Name: Image, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: Always `image`., + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: RunStepDetailsToolCallsRetrievalObject, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: The ID of the tool call object. + }, + { + Id: type, + Name: Type, + Type: RunStepDetailsToolCallsRetrievalObjectType, + IsRequired: true, + Summary: The type of tool call. This is always going to be `retrieval` for this type of tool call. + }, + { + Id: retrieval, + Name: Retrieval, + Type: RunStepDetailsToolCallsRetrievalObjectRetrieval, + IsRequired: true, + Summary: For now, this is always going to be an empty object. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: RunStepDetailsToolCallsRetrievalObject, + ClassName: RunStepDetailsToolCallsRetrievalObject, + ExternalClassName: RunStepDetailsToolCallsRetrievalObject, + FileNameWithoutExtension: G.Models.RunStepDetailsToolCallsRetrievalObject + }, + { + Id: retrieval, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: null, + Summary: For now, this is always going to be an empty object., + AdditionalModels: null, + Enumerations: null, + Name: Retrieval, + ClassName: Retrieval, + ExternalClassName: Retrieval, + FileNameWithoutExtension: G.Models.Retrieval + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: retrieval, + Name: Retrieval, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The type of tool call. This is always going to be `retrieval` for this type of tool call., + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: RunStepDetailsToolCallsFunctionObject, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: The ID of the tool call object. + }, + { + Id: type, + Name: Type, + Type: RunStepDetailsToolCallsFunctionObjectType, + IsRequired: true, + Summary: The type of tool call. This is always going to be `function` for this type of tool call. + }, + { + Id: function, + Name: Function, + Type: RunStepDetailsToolCallsFunctionObjectFunction, + IsRequired: true, + Summary: The definition of the function that was called. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: RunStepDetailsToolCallsFunctionObject, + ClassName: RunStepDetailsToolCallsFunctionObject, + ExternalClassName: RunStepDetailsToolCallsFunctionObject, + FileNameWithoutExtension: G.Models.RunStepDetailsToolCallsFunctionObject + }, + { + Id: function, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: name, + Name: Name, + Type: string, + IsRequired: true, + Summary: The name of the function. + }, + { + Id: arguments, + Name: Arguments, + Type: string, + IsRequired: true, + Summary: The arguments passed to the function. + }, + { + Id: output, + Name: Output, + Type: string?, + IsRequired: true, + Summary: The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. + } + ], + Summary: The definition of the function that was called., + AdditionalModels: null, + Enumerations: null, + Name: Function, + ClassName: Function, + ExternalClassName: Function, + FileNameWithoutExtension: G.Models.Function + }, + { + Id: type, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: function, + Name: Function, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The type of tool call. This is always going to be `function` for this type of tool call., + AdditionalModels: null, + Enumerations: null, + Name: Type, + ClassName: Type, + ExternalClassName: Type, + FileNameWithoutExtension: G.Models.Type + }, + { + Id: AssistantFileObject, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: The identifier, which can be referenced in API endpoints. + }, + { + Id: object, + Name: Object, + Type: AssistantFileObjectObject, + IsRequired: true, + Summary: The object type, which is always `assistant.file`. + }, + { + Id: created_at, + Name: CreatedAt, + Type: int, + IsRequired: true, + Summary: The Unix timestamp (in seconds) for when the assistant file was created. + }, + { + Id: assistant_id, + Name: AssistantId, + Type: string, + IsRequired: true, + Summary: The assistant ID that the file is attached to. + } + ], + Summary: A list of [Files](/docs/api-reference/files) attached to an `assistant`., + AdditionalModels: null, + Enumerations: null, + Name: AssistantFileObject, + ClassName: AssistantFileObject, + ExternalClassName: AssistantFileObject, + FileNameWithoutExtension: G.Models.AssistantFileObject + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: assistant.file, + Name: Assistantfile, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The object type, which is always `assistant.file`., + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: CreateAssistantFileRequest, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: file_id, + Name: FileId, + Type: string, + IsRequired: true, + Summary: A [File](/docs/api-reference/files) ID (with `purpose="assistants"`) that the assistant should use. Useful for tools like `retrieval` and `code_interpreter` that can access files. + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: CreateAssistantFileRequest, + ClassName: CreateAssistantFileRequest, + ExternalClassName: CreateAssistantFileRequest, + FileNameWithoutExtension: G.Models.CreateAssistantFileRequest + }, + { + Id: DeleteAssistantFileResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: + }, + { + Id: deleted, + Name: Deleted, + Type: bool, + IsRequired: true, + Summary: + }, + { + Id: object, + Name: Object, + Type: DeleteAssistantFileResponseObject, + IsRequired: true, + Summary: + } + ], + Summary: Deletes the association between the assistant and the file, but does not delete the [File](/docs/api-reference/files) object itself., + AdditionalModels: null, + Enumerations: null, + Name: DeleteAssistantFileResponse, + ClassName: DeleteAssistantFileResponse, + ExternalClassName: DeleteAssistantFileResponse, + FileNameWithoutExtension: G.Models.DeleteAssistantFileResponse + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: assistant.file.deleted, + Name: Assistantfiledeleted, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: ListAssistantFilesResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: object, + Name: Object, + Type: string, + IsRequired: true, + Summary: +
Example: list + }, + { + Id: data, + Name: Data, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: + }, + { + Id: first_id, + Name: FirstId, + Type: string, + IsRequired: true, + Summary: +
Example: file-abc123 + }, + { + Id: last_id, + Name: LastId, + Type: string, + IsRequired: true, + Summary: +
Example: file-abc456 + }, + { + Id: has_more, + Name: HasMore, + Type: bool, + IsRequired: true, + Summary: +
Example: false + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ListAssistantFilesResponse, + ClassName: ListAssistantFilesResponse, + ExternalClassName: ListAssistantFilesResponse, + FileNameWithoutExtension: G.Models.ListAssistantFilesResponse + }, + { + Id: MessageFileObject, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: id, + Name: Id, + Type: string, + IsRequired: true, + Summary: The identifier, which can be referenced in API endpoints. + }, + { + Id: object, + Name: Object, + Type: MessageFileObjectObject, + IsRequired: true, + Summary: The object type, which is always `thread.message.file`. + }, + { + Id: created_at, + Name: CreatedAt, + Type: int, + IsRequired: true, + Summary: The Unix timestamp (in seconds) for when the message file was created. + }, + { + Id: message_id, + Name: MessageId, + Type: string, + IsRequired: true, + Summary: The ID of the [message](/docs/api-reference/messages) that the [File](/docs/api-reference/files) is attached to. + } + ], + Summary: A list of files attached to a `message`., + AdditionalModels: null, + Enumerations: null, + Name: MessageFileObject, + ClassName: MessageFileObject, + ExternalClassName: MessageFileObject, + FileNameWithoutExtension: G.Models.MessageFileObject + }, + { + Id: object, + AddTypeName: false, + Parents: null, + Namespace: G, + Style: Enumeration, + Properties: [ + { + Id: thread.message.file, + Name: Threadmessagefile, + Type: , + IsRequired: false, + Summary: + } + ], + Summary: The object type, which is always `thread.message.file`., + AdditionalModels: null, + Enumerations: null, + Name: Object, + ClassName: Object, + ExternalClassName: Object, + FileNameWithoutExtension: G.Models.Object + }, + { + Id: ListMessageFilesResponse, + AddTypeName: false, + Parents: null, + Namespace: G, + Properties: [ + { + Id: object, + Name: Object, + Type: string, + IsRequired: true, + Summary: +
Example: list + }, + { + Id: data, + Name: Data, + Type: global::System.Collections.Generic.IList, + IsRequired: true, + Summary: + }, + { + Id: first_id, + Name: FirstId, + Type: string, + IsRequired: true, + Summary: +
Example: file-abc123 + }, + { + Id: last_id, + Name: LastId, + Type: string, + IsRequired: true, + Summary: +
Example: file-abc456 + }, + { + Id: has_more, + Name: HasMore, + Type: bool, + IsRequired: true, + Summary: +
Example: false + } + ], + Summary: , + AdditionalModels: null, + Enumerations: null, + Name: ListMessageFilesResponse, + ClassName: ListMessageFilesResponse, + ExternalClassName: ListMessageFilesResponse, + FileNameWithoutExtension: G.Models.ListMessageFilesResponse + } +] \ No newline at end of file