@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
92 lines (80 loc) • 2.87 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* AskNews API
* AskNews API
*
* The version of the OpenAPI document: 0.19.10
* Contact: contact@emergentmethods.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from '../runtime';
import type { CreateChatCompletionRequestMessage } from './CreateChatCompletionRequestMessage';
import {
CreateChatCompletionRequestMessageFromJSON,
CreateChatCompletionRequestMessageFromJSONTyped,
CreateChatCompletionRequestMessageToJSON,
CreateChatCompletionRequestMessageToJSONTyped,
} from './CreateChatCompletionRequestMessage';
/**
*
* @export
* @interface CreateChatCompletionResponseChoice
*/
export interface CreateChatCompletionResponseChoice {
/**
*
* @type {number}
* @memberof CreateChatCompletionResponseChoice
*/
index: number;
/**
*
* @type {CreateChatCompletionRequestMessage}
* @memberof CreateChatCompletionResponseChoice
*/
message: CreateChatCompletionRequestMessage;
/**
*
* @type {string}
* @memberof CreateChatCompletionResponseChoice
*/
finishReason?: string | null;
}
/**
* Check if a given object implements the CreateChatCompletionResponseChoice interface.
*/
export function instanceOfCreateChatCompletionResponseChoice(value: object): value is CreateChatCompletionResponseChoice {
if (!('index' in value) || value['index'] === undefined) return false;
if (!('message' in value) || value['message'] === undefined) return false;
return true;
}
export function CreateChatCompletionResponseChoiceFromJSON(json: any): CreateChatCompletionResponseChoice {
return CreateChatCompletionResponseChoiceFromJSONTyped(json, false);
}
export function CreateChatCompletionResponseChoiceFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateChatCompletionResponseChoice {
if (json == null) {
return json;
}
return {
'index': json['index'],
'message': CreateChatCompletionRequestMessageFromJSON(json['message']),
'finishReason': json['finish_reason'] == null ? undefined : json['finish_reason'],
};
}
export function CreateChatCompletionResponseChoiceToJSON(json: any): CreateChatCompletionResponseChoice {
return CreateChatCompletionResponseChoiceToJSONTyped(json, false);
}
export function CreateChatCompletionResponseChoiceToJSONTyped(value?: CreateChatCompletionResponseChoice | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'index': value['index'],
'message': CreateChatCompletionRequestMessageToJSON(value['message']),
'finish_reason': value['finishReason'],
};
}