@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
123 lines (122 loc) • 4.53 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 { ChoiceFromJSON, ChoiceToJSON, } from './Choice';
import { KeyPersonFromJSON, KeyPersonToJSON, } from './KeyPerson';
import { SearchResponseDictItemFromJSON, SearchResponseDictItemToJSON, } from './SearchResponseDictItem';
import { WebSearchResultFromJSON, WebSearchResultToJSON, } from './WebSearchResult';
/**
* Check if a given object implements the ForecastResponse interface.
*/
export function instanceOfForecastResponse(value) {
if (!('forecast' in value))
return false;
if (!('resolutionCriteria' in value))
return false;
if (!('date' in value))
return false;
if (!('reasoning' in value))
return false;
if (!('sources' in value))
return false;
if (!('timeline' in value))
return false;
if (!('oppositeRequest' in value))
return false;
if (!('confidence' in value))
return false;
if (!('choice' in value))
return false;
if (!('llmConfidence' in value))
return false;
if (!('modelUsed' in value))
return false;
if (!('likelihood' in value))
return false;
if (!('probability' in value))
return false;
if (!('webSearchResults' in value))
return false;
if (!('summary' in value))
return false;
if (!('keyPeople' in value))
return false;
if (!('keyFacets' in value))
return false;
if (!('reconciledInformation' in value))
return false;
if (!('candidateModels' in value))
return false;
if (!('uniqueInformation' in value))
return false;
return true;
}
export function ForecastResponseFromJSON(json) {
return ForecastResponseFromJSONTyped(json, false);
}
export function ForecastResponseFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'forecast': json['forecast'],
'resolutionCriteria': json['resolution_criteria'],
'date': (new Date(json['date'])),
'reasoning': json['reasoning'],
'sources': (json['sources'].map(SearchResponseDictItemFromJSON)),
'timeline': json['timeline'],
'oppositeRequest': json['opposite_request'],
'confidence': json['confidence'],
'choice': ChoiceFromJSON(json['choice']),
'llmConfidence': json['llm_confidence'],
'modelUsed': json['model_used'],
'likelihood': json['likelihood'],
'probability': json['probability'],
'webSearchResults': (json['web_search_results'].map(WebSearchResultFromJSON)),
'summary': json['summary'],
'keyPeople': (json['key_people'].map(KeyPersonFromJSON)),
'keyFacets': json['key_facets'],
'reconciledInformation': json['reconciled_information'],
'candidateModels': json['candidate_models'],
'uniqueInformation': json['unique_information'],
'expertInformation': json['expert_information'] == null ? undefined : json['expert_information'],
};
}
export function ForecastResponseToJSON(value) {
if (value == null) {
return value;
}
return {
'forecast': value['forecast'],
'resolution_criteria': value['resolutionCriteria'],
'date': ((value['date']).toISOString()),
'reasoning': value['reasoning'],
'sources': (value['sources'].map(SearchResponseDictItemToJSON)),
'timeline': value['timeline'],
'opposite_request': value['oppositeRequest'],
'confidence': value['confidence'],
'choice': ChoiceToJSON(value['choice']),
'llm_confidence': value['llmConfidence'],
'model_used': value['modelUsed'],
'likelihood': value['likelihood'],
'probability': value['probability'],
'web_search_results': (value['webSearchResults'].map(WebSearchResultToJSON)),
'summary': value['summary'],
'key_people': (value['keyPeople'].map(KeyPersonToJSON)),
'key_facets': value['keyFacets'],
'reconciled_information': value['reconciledInformation'],
'candidate_models': value['candidateModels'],
'unique_information': value['uniqueInformation'],
'expert_information': value['expertInformation'],
};
}