npm package: @plasma-platform/service-ai
Description: Ai Service API
Author: Template Monsters
Latest version: 0.0.5

![version](https://badgen.net/npm/v/@plasma-platform/service-apv)
![nextVersion](https://badgen.net/npm/v/@plasma-platform/service-apv/next)
![downloads](https://badgen.net/npm/dt/@plasma-platform/service-apv)
![license](https://badgen.net/npm/license/@plasma-platform/service-apv)
![dependency](https://badgen.net/npm/dependents/@plasma-platform/service-apv)  

* * *

[Full documentation](https://templatemonster.gitlab.io/PlasmaPlatform/Frontend/plasma-platform/?path=/story/plasma-platform-sdk--service-apv)  
install:  
`npm i @plasma-platform/service-apv -S`  

# Short documentation

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

-   [AiService](#aiservice)
    -   [messages](#messages)
    -   [createAI](#createai)
        -   [Examples](#examples)
    -   [updateAI](#updateai)
        -   [Examples](#examples-1)
    -   [deleteAI](#deleteai)
        -   [Examples](#examples-2)
    -   [getAI](#getai)
        -   [Examples](#examples-3)
    -   [getModels](#getmodels)
        -   [Examples](#examples-4)
    -   [postChatCompletions](#postchatcompletions)
        -   [Examples](#examples-5)

## AiService

-   **See: <http://service-ai.templatemonsterdev.com/doc/>**

### messages

object with class service messages

Type: [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)

### createAI

AiService - Create open AI

#### Examples

```javascript
(async () => {
  const service = new AiService(url);
  const request = await service.createAI({ api_key: 'sk-123' });
})();
```

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;any>** 

### updateAI

AiService - Update open AI

#### Examples

```javascript
(async () => {
  const service = new AiService(url);
  const request = await service.updateAI({ api_key: 'sk-123' });
})();
```

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;any>** 

### deleteAI

AiService - Delete open AI

#### Examples

```javascript
(async () => {
  const service = new AiService(url);
  const request = await service.deleteAI();
})();
```

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;any>** 

### getAI

AiService - Get open AI

#### Examples

```javascript
(async () => {
  const service = new AiService(url);
  const request = await service.getAI();
})();
```

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;any>** 

### getModels

AiService - List and describe the various models available in the API

#### Examples

```javascript
(async () => {
  const service = new AiService(url);
  const request = await service.getModels();
})();
```

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;any>** 

### postChatCompletions

AiService - Create chat message completion

#### Examples

```javascript
(async () => {
  const service = new AiService(url);
  const request = await service.postChatCompletions({ api_key: 'sk-123' });
})();
```

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;any>**