UNPKG

@emergentmethods/asknews-typescript-sdk

Version:
53 lines (52 loc) 4.03 kB
/* 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 { UserFromJSON, UserToJSON, } from './User'; import { FilterParamsFromJSON, FilterParamsToJSON, } from './FilterParams'; import { StopFromJSON, StopToJSON, } from './Stop'; import { ThreadIdFromJSON, ThreadIdToJSON, } from './ThreadId'; import { CreateChatCompletionRequestMessageFromJSON, CreateChatCompletionRequestMessageToJSON, } from './CreateChatCompletionRequestMessage'; /** * @export */ export const CreateChatCompletionRequestInlineCitationsEnum = { Numbered: 'numbered', MarkdownLink: 'markdown_link', None: 'none' }; /** * Check if a given object implements the CreateChatCompletionRequest interface. */ export function instanceOfCreateChatCompletionRequest(value) { if (!('messages' in value) || value['messages'] === undefined) return false; return true; } export function CreateChatCompletionRequestFromJSON(json) { return CreateChatCompletionRequestFromJSONTyped(json, false); } export function CreateChatCompletionRequestFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return Object.assign(Object.assign({}, json), { 'model': json['model'] == null ? undefined : json['model'], 'messages': (json['messages'].map(CreateChatCompletionRequestMessageFromJSON)), '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 : 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'], 'threadId': json['thread_id'] == null ? undefined : ThreadIdFromJSON(json['thread_id']), 'user': json['user'] == null ? undefined : UserFromJSON(json['user']), '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 : FilterParamsFromJSON(json['filter_params']) }); } export function CreateChatCompletionRequestToJSON(json) { return CreateChatCompletionRequestToJSONTyped(json, false); } export function CreateChatCompletionRequestToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return Object.assign(Object.assign({}, value), { 'model': value['model'], 'messages': (value['messages'].map(CreateChatCompletionRequestMessageToJSON)), 'temperature': value['temperature'], 'top_p': value['topP'], 'n': value['n'], 'stream': value['stream'], 'stop': StopToJSON(value['stop']), 'max_tokens': value['maxTokens'], 'presence_penalty': value['presencePenalty'], 'frequency_penalty': value['frequencyPenalty'], 'thread_id': ThreadIdToJSON(value['threadId']), 'user': UserToJSON(value['user']), 'inline_citations': value['inlineCitations'], 'append_references': value['appendReferences'], 'journalist_mode': value['journalistMode'], 'asknews_watermark': value['asknewsWatermark'], 'conversational_awareness': value['conversationalAwareness'], 'filter_params': FilterParamsToJSON(value['filterParams']) }); }