Skip to content

Commit

Permalink
OpenAPI spec 1.2 (Added chatgpt and asr APIs)
Browse files Browse the repository at this point in the history
  • Loading branch information
schnerd committed Mar 1, 2023
1 parent fa13b7a commit 75f6853
Show file tree
Hide file tree
Showing 12 changed files with 1,287 additions and 159 deletions.
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.2.1
6.4.0
625 changes: 567 additions & 58 deletions api.ts

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* OpenAI API
* APIs for sampling from and fine-tuning language models
*
* The version of the OpenAPI document: 1.1.0
* The version of the OpenAPI document: 1.2.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand All @@ -13,10 +13,11 @@
*/


import { Configuration } from "./configuration";
import type { Configuration } from './configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
import globalAxios from 'axios';

export const BASE_PATH = "https://api.openai.com/v1".replace(/\/+$/, "");

Expand Down Expand Up @@ -64,8 +65,8 @@ export class BaseAPI {
* @extends {Error}
*/
export class RequiredError extends Error {
name: "RequiredError" = "RequiredError";
constructor(public field: string, msg?: string) {
super(msg);
this.name = "RequiredError"
}
}
10 changes: 6 additions & 4 deletions common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* OpenAI API
* APIs for sampling from and fine-tuning language models
*
* The version of the OpenAPI document: 1.1.0
* The version of the OpenAPI document: 1.2.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand All @@ -13,9 +13,10 @@
*/


import { Configuration } from "./configuration";
import { RequiredError, RequestArgs } from "./base";
import { AxiosInstance, AxiosResponse } from 'axios';
import type { Configuration } from "./configuration";
import type { RequestArgs } from "./base";
import type { AxiosInstance, AxiosResponse } from 'axios';
import { RequiredError } from "./base";

/**
*
Expand Down Expand Up @@ -84,6 +85,7 @@ export const setOAuthToObject = async function (object: any, name: string, scope
}

function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
if (parameter == null) return;
if (typeof parameter === "object") {
if (Array.isArray(parameter)) {
(parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
Expand Down
2 changes: 1 addition & 1 deletion configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* OpenAI API
* APIs for sampling from and fine-tuning language models
*
* The version of the OpenAPI document: 1.1.0
* The version of the OpenAPI document: 1.2.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Loading

0 comments on commit 75f6853

Please sign in to comment.