UNPKG

@emergentmethods/asknews-typescript-sdk

Version:
62 lines (61 loc) 5.66 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.CreateDeepNewsRequestToJSONTyped = exports.CreateDeepNewsRequestToJSON = exports.CreateDeepNewsRequestFromJSONTyped = exports.CreateDeepNewsRequestFromJSON = exports.instanceOfCreateDeepNewsRequest = exports.CreateDeepNewsRequestInlineCitationsEnum = void 0; const User_1 = require("./User"); const CreateDeepNewsRequestMessage_1 = require("./CreateDeepNewsRequestMessage"); const Stop_1 = require("./Stop"); const FilterParams1_1 = require("./FilterParams1"); const Sources1_1 = require("./Sources1"); const ThreadId1_1 = require("./ThreadId1"); /** * @export */ exports.CreateDeepNewsRequestInlineCitationsEnum = { Numbered: 'numbered', MarkdownLink: 'markdown_link', None: 'none' }; /** * Check if a given object implements the CreateDeepNewsRequest interface. */ function instanceOfCreateDeepNewsRequest(value) { if (!('messages' in value) || value['messages'] === undefined) return false; return true; } exports.instanceOfCreateDeepNewsRequest = instanceOfCreateDeepNewsRequest; function CreateDeepNewsRequestFromJSON(json) { return CreateDeepNewsRequestFromJSONTyped(json, false); } exports.CreateDeepNewsRequestFromJSON = CreateDeepNewsRequestFromJSON; function CreateDeepNewsRequestFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return Object.assign(Object.assign({}, json), { 'model': json['model'] == null ? undefined : json['model'], 'messages': (json['messages'].map(CreateDeepNewsRequestMessage_1.CreateDeepNewsRequestMessageFromJSON)), 'temperature': json['temperature'] == null ? undefined : json['temperature'], 'topP': json['top_p'] == null ? undefined : json['top_p'], 'n': json['n'] == null ? undefined : json['n'], 'stream': json['stream'] == null ? undefined : json['stream'], 'stop': json['stop'] == null ? undefined : (0, Stop_1.StopFromJSON)(json['stop']), 'maxTokens': json['max_tokens'] == null ? undefined : json['max_tokens'], 'presencePenalty': json['presence_penalty'] == null ? undefined : json['presence_penalty'], 'frequencyPenalty': json['frequency_penalty'] == null ? undefined : json['frequency_penalty'], 'user': json['user'] == null ? undefined : (0, User_1.UserFromJSON)(json['user']), 'threadId': json['thread_id'] == null ? undefined : (0, ThreadId1_1.ThreadId1FromJSON)(json['thread_id']), 'inlineCitations': json['inline_citations'] == null ? undefined : json['inline_citations'], 'appendReferences': json['append_references'] == null ? undefined : json['append_references'], 'journalistMode': json['journalist_mode'] == null ? undefined : json['journalist_mode'], 'asknewsWatermark': json['asknews_watermark'] == null ? undefined : json['asknews_watermark'], 'conversationalAwareness': json['conversational_awareness'] == null ? undefined : json['conversational_awareness'], 'filterParams': json['filter_params'] == null ? undefined : (0, FilterParams1_1.FilterParams1FromJSON)(json['filter_params']), 'searchDepth': json['search_depth'] == null ? undefined : json['search_depth'], 'maxDepth': json['max_depth'] == null ? undefined : json['max_depth'], 'sources': json['sources'] == null ? undefined : (0, Sources1_1.Sources1FromJSON)(json['sources']), 'returnSources': json['return_sources'] == null ? undefined : json['return_sources'], 'includeCoordinates': json['include_coordinates'] == null ? undefined : json['include_coordinates'], 'includeEntities': json['include_entities'] == null ? undefined : json['include_entities'], 'includeGraphs': json['include_graphs'] == null ? undefined : json['include_graphs'] }); } exports.CreateDeepNewsRequestFromJSONTyped = CreateDeepNewsRequestFromJSONTyped; function CreateDeepNewsRequestToJSON(json) { return CreateDeepNewsRequestToJSONTyped(json, false); } exports.CreateDeepNewsRequestToJSON = CreateDeepNewsRequestToJSON; function CreateDeepNewsRequestToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return Object.assign(Object.assign({}, value), { 'model': value['model'], 'messages': (value['messages'].map(CreateDeepNewsRequestMessage_1.CreateDeepNewsRequestMessageToJSON)), 'temperature': value['temperature'], 'top_p': value['topP'], 'n': value['n'], 'stream': value['stream'], 'stop': (0, Stop_1.StopToJSON)(value['stop']), 'max_tokens': value['maxTokens'], 'presence_penalty': value['presencePenalty'], 'frequency_penalty': value['frequencyPenalty'], 'user': (0, User_1.UserToJSON)(value['user']), 'thread_id': (0, ThreadId1_1.ThreadId1ToJSON)(value['threadId']), 'inline_citations': value['inlineCitations'], 'append_references': value['appendReferences'], 'journalist_mode': value['journalistMode'], 'asknews_watermark': value['asknewsWatermark'], 'conversational_awareness': value['conversationalAwareness'], 'filter_params': (0, FilterParams1_1.FilterParams1ToJSON)(value['filterParams']), 'search_depth': value['searchDepth'], 'max_depth': value['maxDepth'], 'sources': (0, Sources1_1.Sources1ToJSON)(value['sources']), 'return_sources': value['returnSources'], 'include_coordinates': value['includeCoordinates'], 'include_entities': value['includeEntities'], 'include_graphs': value['includeGraphs'] }); } exports.CreateDeepNewsRequestToJSONTyped = CreateDeepNewsRequestToJSONTyped;