@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
92 lines (80 loc) • 2.9 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 { CreateChatCompletionRequestMessage1 } from './CreateChatCompletionRequestMessage1';
import {
CreateChatCompletionRequestMessage1FromJSON,
CreateChatCompletionRequestMessage1FromJSONTyped,
CreateChatCompletionRequestMessage1ToJSON,
CreateChatCompletionRequestMessage1ToJSONTyped,
} from './CreateChatCompletionRequestMessage1';
/**
*
* @export
* @interface CreateChatCompletionResponseChoice1
*/
export interface CreateChatCompletionResponseChoice1 {
/**
*
* @type {number}
* @memberof CreateChatCompletionResponseChoice1
*/
index: number;
/**
*
* @type {CreateChatCompletionRequestMessage1}
* @memberof CreateChatCompletionResponseChoice1
*/
message: CreateChatCompletionRequestMessage1;
/**
*
* @type {string}
* @memberof CreateChatCompletionResponseChoice1
*/
finishReason?: string | null;
}
/**
* Check if a given object implements the CreateChatCompletionResponseChoice1 interface.
*/
export function instanceOfCreateChatCompletionResponseChoice1(value: object): value is CreateChatCompletionResponseChoice1 {
if (!('index' in value) || value['index'] === undefined) return false;
if (!('message' in value) || value['message'] === undefined) return false;
return true;
}
export function CreateChatCompletionResponseChoice1FromJSON(json: any): CreateChatCompletionResponseChoice1 {
return CreateChatCompletionResponseChoice1FromJSONTyped(json, false);
}
export function CreateChatCompletionResponseChoice1FromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateChatCompletionResponseChoice1 {
if (json == null) {
return json;
}
return {
'index': json['index'],
'message': CreateChatCompletionRequestMessage1FromJSON(json['message']),
'finishReason': json['finish_reason'] == null ? undefined : json['finish_reason'],
};
}
export function CreateChatCompletionResponseChoice1ToJSON(json: any): CreateChatCompletionResponseChoice1 {
return CreateChatCompletionResponseChoice1ToJSONTyped(json, false);
}
export function CreateChatCompletionResponseChoice1ToJSONTyped(value?: CreateChatCompletionResponseChoice1 | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'index': value['index'],
'message': CreateChatCompletionRequestMessage1ToJSON(value['message']),
'finish_reason': value['finishReason'],
};
}