# horni-client

> Class for instantiating connections to Horni API servers.

Latest version **1.0.8** (published 2021-06-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install horni-client
pnpm add horni-client
yarn add horni-client
bun add horni-client
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2021-06-19 |
| First published | 2021-06-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 1.4 MB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | pathos14489 |

## Links

- npm: https://www.npmjs.com/package/horni-client
- Repository: https://github.com/Pathos14489/horni-client
- Homepage: https://github.com/Pathos14489/horni-client#readme
- Issues: https://github.com/Pathos14489/horni-client/issues
- npm.io page: https://npm.io/package/horni-client

## Dependencies (5)

- [cron](https://npm.io/package/cron.md) ^1.8.2
- [axios](https://npm.io/package/axios.md) ^0.21.1
- [express](https://npm.io/package/express.md) ^4.17.1
- [querystring](https://npm.io/package/querystring.md) ^0.2.1
- [gpt-3-encoder](https://npm.io/package/gpt-3-encoder.md) ^1.1.3

## Recent versions

- 1.0.8 (latest) — 2021-06-19
- 1.0.6 — 2021-06-06
- 1.0.5 — 2021-06-05
- 1.0.4 — 2021-06-05
- 1.0.3 — 2021-06-05
- 1.0.2 — 2021-06-04
- 1.0.1 — 2021-06-04

## README

# Horni-Client

Instantiate client connections to Noli's [Horni API](https://gitlab.com/nolialsea/horni-api) to generate the AI results.

You have to connect to a running instance of the server for it to work.

## Install
	npm install horni-client

## Example

	import HorniClient from "horni-client" // const HorniClient = require("horni-client")
	const client = new HorniClient()
	async function main() {
		var input       = `This is a`
		var generation  = await client.sendPrompt(input)
		var tokens      = generation.prompt.tokens.length+generation.results[0].tokens.length
		var output      = `${generation.total_elapsed_time}ms | ${tokens} Tokens w/prompt | ${input}${generation.results[0].content}`
		console.log(output);
	}
	main().then()
## Metrics
If you want to have access to the metrics, you need it to have sent at least 25 prompts. This is to give the averages a good dataset to work from. I recommend running the initializeMetrics() method if you want to make sure you have them.

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