# oute-services-prompt-sdk

> - Initialization

Latest version **0.0.20** (published 2024-06-27) · 0 weekly downloads

## Install

```sh
npm install oute-services-prompt-sdk
pnpm add oute-services-prompt-sdk
yarn add oute-services-prompt-sdk
bun add oute-services-prompt-sdk
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.20 |
| Published | 2024-06-27 |
| First published | 2023-12-13 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 10.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |

## Links

- npm: https://www.npmjs.com/package/oute-services-prompt-sdk
- npm.io page: https://npm.io/package/oute-services-prompt-sdk

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [oute-services-utility-sdk](https://npm.io/package/oute-services-utility-sdk.md) ^0.0.64

## Recent versions

- 0.0.20 (latest) — 2024-06-27
- 0.0.19 — 2024-06-24
- 0.0.18 — 2024-06-21
- 0.0.17 — 2024-06-19
- 0.0.16 — 2024-06-17
- 0.0.15 — 2024-06-17
- 0.0.14 — 2024-06-17
- 0.0.13 — 2024-06-03
- 0.0.12 — 2024-05-31
- 0.0.11 — 2024-05-28
- 0.0.10 — 2024-05-28
- 0.0.9 — 2024-05-27
- 0.0.8 — 2024-05-24
- 0.0.7 — 2024-04-12
- 0.0.6 — 2024-04-12
- … 5 more at https://npm.io/package/oute-services-prompt-sdk/versions

## README

# This module expose helper functions

- Initialization

```js
  params = {
    url: @server url
    token: @access token
  }
  Prompt = require("oute-services-prompt-sdk")
  prompt_instance = new Prompt(params)
```

## Cache functions

## Core functions

- Save

```js
    body = {
        "name": "test 1",
        "template": "give me info for \#{{title}}# and \#{{max_count}}#",
        "inputs": [{
            "key": "title",
            "type": "STRING",
            "default": null,
            "required": true
        },{
            "key": "max_count",
            "type": "NUMBER",
            "default": 9999,
            "required": false
        }]
    }
  await prompt_instance.save(body)
```

- Find One

```js
  query = {
    "_id": "UvuPE2PGn"
  }
  await prompt_instance.findOne(query)
```

- execute

```js
  body = {
    "query": "test", //Send either query or prompt_id with state
    // "prompt_id": "YxeFhvcnt",
    // "state": {
    //     "title": "Testing",
    //     "max_count": 30
    // },
    "authorization": "", //This will be dynamic for users
    "key": "", //This will be dynamic for users
    // "response_type": "stream", //Send if required as stream or don't set this key. Use only when generate_type is Text
    "generate_type": "Image", //Send either Text or Image 
    "image_size": "256x256", //Use only when generate_type is Text, Image size available '256x256', '512x512', '1024x1024', '1024x1792', '1792x1024'
    "number_of_images": 2 //Use only when generate_type is Text
  }

await prompt_instance.execute(body)
```

---
_Source: https://npm.io/package/oute-services-prompt-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
