UNPKG

@emergentmethods/asknews-typescript-sdk

Version:
60 lines (59 loc) 2.5 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * AskNews API * AskNews API * * The version of the OpenAPI document: 0.21.1 * 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. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.CreateChatCompletionRequestMessageToJSONTyped = exports.CreateChatCompletionRequestMessageToJSON = exports.CreateChatCompletionRequestMessageFromJSONTyped = exports.CreateChatCompletionRequestMessageFromJSON = exports.instanceOfCreateChatCompletionRequestMessage = void 0; /** * Check if a given object implements the CreateChatCompletionRequestMessage interface. */ function instanceOfCreateChatCompletionRequestMessage(value) { if (!('role' in value) || value['role'] === undefined) return false; if (!('content' in value) || value['content'] === undefined) return false; return true; } exports.instanceOfCreateChatCompletionRequestMessage = instanceOfCreateChatCompletionRequestMessage; function CreateChatCompletionRequestMessageFromJSON(json) { return CreateChatCompletionRequestMessageFromJSONTyped(json, false); } exports.CreateChatCompletionRequestMessageFromJSON = CreateChatCompletionRequestMessageFromJSON; function CreateChatCompletionRequestMessageFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'role': json['role'], 'content': json['content'], 'name': json['name'] == null ? undefined : json['name'], 'functionCall': json['function_call'] == null ? undefined : json['function_call'], }; } exports.CreateChatCompletionRequestMessageFromJSONTyped = CreateChatCompletionRequestMessageFromJSONTyped; function CreateChatCompletionRequestMessageToJSON(json) { return CreateChatCompletionRequestMessageToJSONTyped(json, false); } exports.CreateChatCompletionRequestMessageToJSON = CreateChatCompletionRequestMessageToJSON; function CreateChatCompletionRequestMessageToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'role': value['role'], 'content': value['content'], 'name': value['name'], 'function_call': value['functionCall'], }; } exports.CreateChatCompletionRequestMessageToJSONTyped = CreateChatCompletionRequestMessageToJSONTyped;