Armin Friedl
a279965fed
All checks were successful
continuous-integration/drone/push Build is passing
321 lines
12 KiB
TypeScript
321 lines
12 KiB
TypeScript
/* tslint:disable */
|
|
/* eslint-disable */
|
|
/**
|
|
* FastAPI
|
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
*
|
|
* The version of the OpenAPI document: 0.1.0
|
|
*
|
|
*
|
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
* https://openapi-generator.tech
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
|
|
import * as runtime from '../runtime';
|
|
import {
|
|
DalleResponse,
|
|
DalleResponseFromJSON,
|
|
DalleResponseToJSON,
|
|
HTTPValidationError,
|
|
HTTPValidationErrorFromJSON,
|
|
HTTPValidationErrorToJSON,
|
|
RobertaEmotionResponse,
|
|
RobertaEmotionResponseFromJSON,
|
|
RobertaEmotionResponseToJSON,
|
|
RobertaHateResponse,
|
|
RobertaHateResponseFromJSON,
|
|
RobertaHateResponseToJSON,
|
|
RobertaIronyResponse,
|
|
RobertaIronyResponseFromJSON,
|
|
RobertaIronyResponseToJSON,
|
|
RobertaOffensiveResponse,
|
|
RobertaOffensiveResponseFromJSON,
|
|
RobertaOffensiveResponseToJSON,
|
|
RobertaSentimentResponse,
|
|
RobertaSentimentResponseFromJSON,
|
|
RobertaSentimentResponseToJSON,
|
|
} from '../models';
|
|
|
|
export interface GetContinuationDialogContinuationGetRequest {
|
|
text: string;
|
|
}
|
|
|
|
export interface GetEmotionsRobertaEmotionGetRequest {
|
|
text: string;
|
|
}
|
|
|
|
export interface GetHateRobertaHateGetRequest {
|
|
text: string;
|
|
}
|
|
|
|
export interface GetImageDalleGenerateGetRequest {
|
|
text: string;
|
|
count: number;
|
|
}
|
|
|
|
export interface GetIronyRobertaIronyGetRequest {
|
|
text: string;
|
|
}
|
|
|
|
export interface GetOffensiveRobertaOffensiveGetRequest {
|
|
text: string;
|
|
}
|
|
|
|
export interface GetSentimentRobertaSentimentGetRequest {
|
|
text: string;
|
|
}
|
|
|
|
/**
|
|
*
|
|
*/
|
|
export class DefaultApi extends runtime.BaseAPI {
|
|
|
|
/**
|
|
* Get Continuation
|
|
*/
|
|
async getContinuationDialogContinuationGetRaw(requestParameters: GetContinuationDialogContinuationGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<string>> {
|
|
if (requestParameters.text === null || requestParameters.text === undefined) {
|
|
throw new runtime.RequiredError('text','Required parameter requestParameters.text was null or undefined when calling getContinuationDialogContinuationGet.');
|
|
}
|
|
|
|
const queryParameters: any = {};
|
|
|
|
if (requestParameters.text !== undefined) {
|
|
queryParameters['text'] = requestParameters.text;
|
|
}
|
|
|
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
|
|
const response = await this.request({
|
|
path: `/dialog/continuation`,
|
|
method: 'GET',
|
|
headers: headerParameters,
|
|
query: queryParameters,
|
|
}, initOverrides);
|
|
|
|
return new runtime.TextApiResponse(response) as any;
|
|
}
|
|
|
|
/**
|
|
* Get Continuation
|
|
*/
|
|
async getContinuationDialogContinuationGet(requestParameters: GetContinuationDialogContinuationGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<string> {
|
|
const response = await this.getContinuationDialogContinuationGetRaw(requestParameters, initOverrides);
|
|
return await response.value();
|
|
}
|
|
|
|
/**
|
|
* Get Emotions
|
|
*/
|
|
async getEmotionsRobertaEmotionGetRaw(requestParameters: GetEmotionsRobertaEmotionGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<RobertaEmotionResponse>> {
|
|
if (requestParameters.text === null || requestParameters.text === undefined) {
|
|
throw new runtime.RequiredError('text','Required parameter requestParameters.text was null or undefined when calling getEmotionsRobertaEmotionGet.');
|
|
}
|
|
|
|
const queryParameters: any = {};
|
|
|
|
if (requestParameters.text !== undefined) {
|
|
queryParameters['text'] = requestParameters.text;
|
|
}
|
|
|
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
|
|
const response = await this.request({
|
|
path: `/roberta/emotion`,
|
|
method: 'GET',
|
|
headers: headerParameters,
|
|
query: queryParameters,
|
|
}, initOverrides);
|
|
|
|
return new runtime.JSONApiResponse(response, (jsonValue) => RobertaEmotionResponseFromJSON(jsonValue));
|
|
}
|
|
|
|
/**
|
|
* Get Emotions
|
|
*/
|
|
async getEmotionsRobertaEmotionGet(requestParameters: GetEmotionsRobertaEmotionGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<RobertaEmotionResponse> {
|
|
const response = await this.getEmotionsRobertaEmotionGetRaw(requestParameters, initOverrides);
|
|
return await response.value();
|
|
}
|
|
|
|
/**
|
|
* Get Hate
|
|
*/
|
|
async getHateRobertaHateGetRaw(requestParameters: GetHateRobertaHateGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<RobertaHateResponse>> {
|
|
if (requestParameters.text === null || requestParameters.text === undefined) {
|
|
throw new runtime.RequiredError('text','Required parameter requestParameters.text was null or undefined when calling getHateRobertaHateGet.');
|
|
}
|
|
|
|
const queryParameters: any = {};
|
|
|
|
if (requestParameters.text !== undefined) {
|
|
queryParameters['text'] = requestParameters.text;
|
|
}
|
|
|
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
|
|
const response = await this.request({
|
|
path: `/roberta/hate`,
|
|
method: 'GET',
|
|
headers: headerParameters,
|
|
query: queryParameters,
|
|
}, initOverrides);
|
|
|
|
return new runtime.JSONApiResponse(response, (jsonValue) => RobertaHateResponseFromJSON(jsonValue));
|
|
}
|
|
|
|
/**
|
|
* Get Hate
|
|
*/
|
|
async getHateRobertaHateGet(requestParameters: GetHateRobertaHateGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<RobertaHateResponse> {
|
|
const response = await this.getHateRobertaHateGetRaw(requestParameters, initOverrides);
|
|
return await response.value();
|
|
}
|
|
|
|
/**
|
|
* Get Image
|
|
*/
|
|
async getImageDalleGenerateGetRaw(requestParameters: GetImageDalleGenerateGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<DalleResponse>> {
|
|
if (requestParameters.text === null || requestParameters.text === undefined) {
|
|
throw new runtime.RequiredError('text','Required parameter requestParameters.text was null or undefined when calling getImageDalleGenerateGet.');
|
|
}
|
|
|
|
if (requestParameters.count === null || requestParameters.count === undefined) {
|
|
throw new runtime.RequiredError('count','Required parameter requestParameters.count was null or undefined when calling getImageDalleGenerateGet.');
|
|
}
|
|
|
|
const queryParameters: any = {};
|
|
|
|
if (requestParameters.text !== undefined) {
|
|
queryParameters['text'] = requestParameters.text;
|
|
}
|
|
|
|
if (requestParameters.count !== undefined) {
|
|
queryParameters['count'] = requestParameters.count;
|
|
}
|
|
|
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
|
|
const response = await this.request({
|
|
path: `/dalle/generate`,
|
|
method: 'GET',
|
|
headers: headerParameters,
|
|
query: queryParameters,
|
|
}, initOverrides);
|
|
|
|
return new runtime.JSONApiResponse(response, (jsonValue) => DalleResponseFromJSON(jsonValue));
|
|
}
|
|
|
|
/**
|
|
* Get Image
|
|
*/
|
|
async getImageDalleGenerateGet(requestParameters: GetImageDalleGenerateGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<DalleResponse> {
|
|
const response = await this.getImageDalleGenerateGetRaw(requestParameters, initOverrides);
|
|
return await response.value();
|
|
}
|
|
|
|
/**
|
|
* Get Irony
|
|
*/
|
|
async getIronyRobertaIronyGetRaw(requestParameters: GetIronyRobertaIronyGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<RobertaIronyResponse>> {
|
|
if (requestParameters.text === null || requestParameters.text === undefined) {
|
|
throw new runtime.RequiredError('text','Required parameter requestParameters.text was null or undefined when calling getIronyRobertaIronyGet.');
|
|
}
|
|
|
|
const queryParameters: any = {};
|
|
|
|
if (requestParameters.text !== undefined) {
|
|
queryParameters['text'] = requestParameters.text;
|
|
}
|
|
|
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
|
|
const response = await this.request({
|
|
path: `/roberta/irony`,
|
|
method: 'GET',
|
|
headers: headerParameters,
|
|
query: queryParameters,
|
|
}, initOverrides);
|
|
|
|
return new runtime.JSONApiResponse(response, (jsonValue) => RobertaIronyResponseFromJSON(jsonValue));
|
|
}
|
|
|
|
/**
|
|
* Get Irony
|
|
*/
|
|
async getIronyRobertaIronyGet(requestParameters: GetIronyRobertaIronyGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<RobertaIronyResponse> {
|
|
const response = await this.getIronyRobertaIronyGetRaw(requestParameters, initOverrides);
|
|
return await response.value();
|
|
}
|
|
|
|
/**
|
|
* Get Offensive
|
|
*/
|
|
async getOffensiveRobertaOffensiveGetRaw(requestParameters: GetOffensiveRobertaOffensiveGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<RobertaOffensiveResponse>> {
|
|
if (requestParameters.text === null || requestParameters.text === undefined) {
|
|
throw new runtime.RequiredError('text','Required parameter requestParameters.text was null or undefined when calling getOffensiveRobertaOffensiveGet.');
|
|
}
|
|
|
|
const queryParameters: any = {};
|
|
|
|
if (requestParameters.text !== undefined) {
|
|
queryParameters['text'] = requestParameters.text;
|
|
}
|
|
|
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
|
|
const response = await this.request({
|
|
path: `/roberta/offensive`,
|
|
method: 'GET',
|
|
headers: headerParameters,
|
|
query: queryParameters,
|
|
}, initOverrides);
|
|
|
|
return new runtime.JSONApiResponse(response, (jsonValue) => RobertaOffensiveResponseFromJSON(jsonValue));
|
|
}
|
|
|
|
/**
|
|
* Get Offensive
|
|
*/
|
|
async getOffensiveRobertaOffensiveGet(requestParameters: GetOffensiveRobertaOffensiveGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<RobertaOffensiveResponse> {
|
|
const response = await this.getOffensiveRobertaOffensiveGetRaw(requestParameters, initOverrides);
|
|
return await response.value();
|
|
}
|
|
|
|
/**
|
|
* Get Sentiment
|
|
*/
|
|
async getSentimentRobertaSentimentGetRaw(requestParameters: GetSentimentRobertaSentimentGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<RobertaSentimentResponse>> {
|
|
if (requestParameters.text === null || requestParameters.text === undefined) {
|
|
throw new runtime.RequiredError('text','Required parameter requestParameters.text was null or undefined when calling getSentimentRobertaSentimentGet.');
|
|
}
|
|
|
|
const queryParameters: any = {};
|
|
|
|
if (requestParameters.text !== undefined) {
|
|
queryParameters['text'] = requestParameters.text;
|
|
}
|
|
|
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
|
|
const response = await this.request({
|
|
path: `/roberta/sentiment`,
|
|
method: 'GET',
|
|
headers: headerParameters,
|
|
query: queryParameters,
|
|
}, initOverrides);
|
|
|
|
return new runtime.JSONApiResponse(response, (jsonValue) => RobertaSentimentResponseFromJSON(jsonValue));
|
|
}
|
|
|
|
/**
|
|
* Get Sentiment
|
|
*/
|
|
async getSentimentRobertaSentimentGet(requestParameters: GetSentimentRobertaSentimentGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<RobertaSentimentResponse> {
|
|
const response = await this.getSentimentRobertaSentimentGetRaw(requestParameters, initOverrides);
|
|
return await response.value();
|
|
}
|
|
|
|
}
|