@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
48 lines (47 loc) • 4.02 kB
JavaScript
/* tslint:disable */
/* eslint-disable */
/**
* AskNews API
* AskNews API
*
* The version of the OpenAPI document: 0.18.6
* 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 { Sources1FromJSON, Sources1ToJSON, } from './Sources1';
import { Stop1FromJSON, Stop1ToJSON, } from './Stop1';
/**
* @export
*/
export const CreateDeepNewsRequestInlineCitationsEnum = {
Numbered: 'numbered',
MarkdownLink: 'markdown_link',
None: 'none'
};
/**
* Check if a given object implements the CreateDeepNewsRequest interface.
*/
export function instanceOfCreateDeepNewsRequest(value) {
if (!('messages' in value))
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), { 'model': json['model'] == null ? undefined : json['model'], 'messages': (json['messages'].map(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 : Stop1FromJSON(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 : json['user'], 'threadId': json['thread_id'] == null ? undefined : 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 : 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']), 'returnSources': json['return_sources'] == null ? undefined : json['return_sources'] });
}
export function CreateDeepNewsRequestToJSON(value) {
if (value == null) {
return value;
}
return Object.assign(Object.assign({}, value), { 'model': value['model'], 'messages': (value['messages'].map(CreateDeepNewsRequestMessageToJSON)), 'temperature': value['temperature'], 'top_p': value['topP'], 'n': value['n'], 'stream': value['stream'], 'stop': Stop1ToJSON(value['stop']), 'max_tokens': value['maxTokens'], 'presence_penalty': value['presencePenalty'], 'frequency_penalty': value['frequencyPenalty'], 'user': value['user'], 'thread_id': value['threadId'], 'inline_citations': value['inlineCitations'], 'append_references': value['appendReferences'], 'journalist_mode': value['journalistMode'], 'asknews_watermark': value['asknewsWatermark'], 'conversational_awareness': value['conversationalAwareness'], 'filter_params': value['filterParams'], 'search_depth': value['searchDepth'], 'max_depth': value['maxDepth'], 'sources': Sources1ToJSON(value['sources']), 'return_sources': value['returnSources'] });
}