@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
64 lines (63 loc) • 6.34 kB
JavaScript
/* tslint:disable */
/* eslint-disable */
/**
* AskNews API
* AskNews API [](https://status.asknews.app/status/prod)
*
* The version of the OpenAPI document: 0.24.66
* 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 { CreateDeepNewsRequestMessageFromJSON, CreateDeepNewsRequestMessageToJSON, } from './CreateDeepNewsRequestMessage';
import { User1FromJSON, User1ToJSON, } from './User1';
import { FilterParams1FromJSON, FilterParams1ToJSON, } from './FilterParams1';
import { CreateDeepNewsRequestModelFromJSON, CreateDeepNewsRequestModelToJSON, } from './CreateDeepNewsRequestModel';
import { Stop1FromJSON, Stop1ToJSON, } from './Stop1';
import { Sources1FromJSON, Sources1ToJSON, } from './Sources1';
import { CutoffDatetimeFromJSON, CutoffDatetimeToJSON, } from './CutoffDatetime';
import { ThreadId1FromJSON, ThreadId1ToJSON, } from './ThreadId1';
/**
* @export
*/
export const CreateDeepNewsRequestInlineCitationsEnum = {
MarkdownLink: 'markdown_link',
Numbered: 'numbered',
None: 'none'
};
/**
* @export
*/
export const CreateDeepNewsRequestEngineEnum = {
V1: 'v1',
V15: 'v1.5',
V20: 'v2.0'
};
/**
* Check if a given object implements the CreateDeepNewsRequest interface.
*/
export function instanceOfCreateDeepNewsRequest(value) {
if (!('messages' in value) || value['messages'] === undefined)
return false;
return true;
}
export function CreateDeepNewsRequestFromJSON(json) {
return CreateDeepNewsRequestFromJSONTyped(json, false);
}
export function CreateDeepNewsRequestFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return Object.assign(Object.assign({}, json), { 'messages': (json['messages'].map(CreateDeepNewsRequestMessageFromJSON)), 'model': json['model'] == null ? undefined : CreateDeepNewsRequestModelFromJSON(json['model']), 'filterParams': json['filter_params'] == null ? undefined : 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 : Sources1FromJSON(json['sources']), 'inlineCitations': json['inline_citations'] == null ? undefined : json['inline_citations'], 'startCitationNumber': json['start_citation_number'] == null ? undefined : json['start_citation_number'], 'returnSources': json['return_sources'] == null ? undefined : json['return_sources'], 'onlyCitedSources': json['only_cited_sources'] == null ? undefined : json['only_cited_sources'], 'appendReferences': json['append_references'] == null ? undefined : json['append_references'], 'journalistMode': json['journalist_mode'] == null ? undefined : json['journalist_mode'], 'conversationalAwareness': json['conversational_awareness'] == null ? undefined : json['conversational_awareness'], 'includeEntities': json['include_entities'] == null ? undefined : json['include_entities'], 'includeGraphs': json['include_graphs'] == null ? undefined : json['include_graphs'], 'includeCoordinates': json['include_coordinates'] == null ? undefined : json['include_coordinates'], 'asknewsWatermark': json['asknews_watermark'] == null ? undefined : json['asknews_watermark'], 'stream': json['stream'] == null ? undefined : json['stream'], 'stop': json['stop'] == null ? undefined : Stop1FromJSON(json['stop']), 'temperature': json['temperature'] == null ? undefined : json['temperature'], 'topP': json['top_p'] == null ? undefined : json['top_p'], 'n': json['n'] == null ? undefined : json['n'], '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 : User1FromJSON(json['user']), 'threadId': json['thread_id'] == null ? undefined : ThreadId1FromJSON(json['thread_id']), 'maxParallelToolCalls': json['max_parallel_tool_calls'] == null ? undefined : json['max_parallel_tool_calls'], 'engine': json['engine'] == null ? undefined : json['engine'], 'enableSourcePruning': json['enable_source_pruning'] == null ? undefined : json['enable_source_pruning'], 'cutoffDatetime': json['cutoff_datetime'] == null ? undefined : CutoffDatetimeFromJSON(json['cutoff_datetime']) });
}
export function CreateDeepNewsRequestToJSON(json) {
return CreateDeepNewsRequestToJSONTyped(json, false);
}
export function CreateDeepNewsRequestToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return Object.assign(Object.assign({}, value), { 'messages': (value['messages'].map(CreateDeepNewsRequestMessageToJSON)), 'model': CreateDeepNewsRequestModelToJSON(value['model']), 'filter_params': FilterParams1ToJSON(value['filterParams']), 'search_depth': value['searchDepth'], 'max_depth': value['maxDepth'], 'sources': Sources1ToJSON(value['sources']), 'inline_citations': value['inlineCitations'], 'start_citation_number': value['startCitationNumber'], 'return_sources': value['returnSources'], 'only_cited_sources': value['onlyCitedSources'], 'append_references': value['appendReferences'], 'journalist_mode': value['journalistMode'], 'conversational_awareness': value['conversationalAwareness'], 'include_entities': value['includeEntities'], 'include_graphs': value['includeGraphs'], 'include_coordinates': value['includeCoordinates'], 'asknews_watermark': value['asknewsWatermark'], 'stream': value['stream'], 'stop': Stop1ToJSON(value['stop']), 'temperature': value['temperature'], 'top_p': value['topP'], 'n': value['n'], 'max_tokens': value['maxTokens'], 'presence_penalty': value['presencePenalty'], 'frequency_penalty': value['frequencyPenalty'], 'user': User1ToJSON(value['user']), 'thread_id': ThreadId1ToJSON(value['threadId']), 'max_parallel_tool_calls': value['maxParallelToolCalls'], 'engine': value['engine'], 'enable_source_pruning': value['enableSourcePruning'], 'cutoff_datetime': CutoffDatetimeToJSON(value['cutoffDatetime']) });
}