This repository was archived by the owner on Jun 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
AI Methods
Kedar Vijay Kulkarni edited this page Oct 18, 2021
·
2 revisions
Get all of the supported ai_methods for a provider
Require AI Provider name (case sensitive)* Document link
const mantiumAi = require('mantiumclient-js');
(async () => {
await mantiumAi.Auth().accessTokenLogin({
username: 'useremail@somedomain.com',
password: 'p@ssWord!'
})
.then((response) => {
// get bearer_id and set to default
mantiumAi.api_key = response.data.attributes.bearer_id;
});
/*
* API Key is set on above
* mantiumAi.api_key=`key`
* so we can call these method directly now
*/
await mantiumAi.AiMethods('openai').list({ 'page': 1, 'size': 20 }).then((response) => {
console.log(response);
});
})();
{
data: [
{
id: 'type',
type: 'object',
attributes: {
name: 'answers',
api_name: 'answers',
description: 'Returns answers',
shareable: false,
ai_provider: {
name: 'OpenAI',
description: 'OpenAI -- https://openai.org'
},
ai_engines: [
{
name: 'davinci',
use_cases: 'some use cases',
description: 'Some long description',
cost_ranking: 100
}
]
},
relationships: {}
}
],
included: [],
meta: {},
links: { total_items: 4, current_page: 1 }
}