# delphi-ai

> API wrapper for the Delphi AI

Latest version **2.0.2** (published 2024-09-30) · Apache-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install delphi-ai
pnpm add delphi-ai
yarn add delphi-ai
bun add delphi-ai
```

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2024-09-30 |
| First published | 2023-09-21 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18 |
| Dependencies | 0 |
| Unpacked size | 17.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Author | Justin McBride |
| Maintainers | jstnmcbrd |
| Keywords | api, delphi, ai, ethics, morals |

## Links

- npm: https://www.npmjs.com/package/delphi-ai
- Repository: https://github.com/JstnMcBrd/delphi-ai
- Issues: https://github.com/JstnMcBrd/delphi-ai/issues
- npm.io page: https://npm.io/package/delphi-ai

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 2.0.2 (latest) — 2024-09-30
- 2.0.1 — 2024-02-13
- 2.0.0 — 2023-10-10
- 1.0.2 — 2023-09-22
- 1.0.1 — 2023-09-22
- 1.0.0 — 2023-09-21

## README

# delphi-ai

[![API status](https://img.shields.io/github/actions/workflow/status/JstnMcBrd/delphi-ai/api.yml?logo=github&label=API%20status)](https://github.com/JstnMcBrd/delphi-ai/actions/workflows/api.yml)
[![Validate](https://img.shields.io/github/actions/workflow/status/JstnMcBrd/delphi-ai/validate.yml?logo=github&label=Validate)](https://github.com/JstnMcBrd/delphi-ai/actions/workflows/validate.yml)
<br />
[![NPM Version](https://img.shields.io/npm/v/delphi-ai)](https://www.npmjs.com/package/delphi-ai)
[![NPM License](https://img.shields.io/npm/l/delphi-ai)](./LICENSE)
![NPM Type Definitions](https://img.shields.io/npm/types/delphi-ai)
![NPM Downloads](https://img.shields.io/npm/dt/delphi-ai)
<br />
![Node version](https://img.shields.io/node/v/delphi-ai)

> <img alt="Warning" src="https://raw.githubusercontent.com/Mqxx/GitHub-Markdown/main/blockquotes/badge/dark-theme/error.svg"> 
>
> This package is permanently broken and should not be used. Please read [#55](https://github.com/JstnMcBrd/delphi-ai/issues/55).

## About

**delphi-ai** is a simple [Node](https://nodejs.org/) package to interact with the API for the Delphi AI. It is developed in [TypeScript](https://www.typescriptlang.org/) and transpiles to JavaScript (ESM).

Delphi is an AI released in 2021 by the **Allen Institute for Artifical Intelligence**, who described it as *"a computational model for descriptive ethics, i.e., people's moral judgments on a variety of everyday situations."* Essentially, provide a prompt and the AI will judge whether it is ethical.

The [demo website](https://delphi.allenai.org/) uses an API to retrieve outputs from the computational model. This package acts as a wrapper for that API to allow you to integrate Delphi with your projects.

> <img alt="Warning" src="https://raw.githubusercontent.com/Mqxx/GitHub-Markdown/main/blockquotes/badge/dark-theme/warning.svg">
>
> The copyright for Delphi belongs to the **Allen Institute for Artifical Intelligence**. This package is unofficial and not supported by them. The API could be turned off at any time. Please check the API status above before reporting issues.

## Prerequesites

This package has no production dependencies!

However, it does require Node 18 or higher. Use `node --version` to check your node version.

## Installation

`npm install delphi-ai`

## Usage

If the API returns a non-200 response, an error will be thrown.
None of the examples below include error handling, but don't forget it!

### ES Modules

```js
import delphi from 'delphi-ai';

const response = await delphi('Building a rocket');
console.log(response); // "It's impressive"
```

### CommonJS

```js
const delphi = require('delphi-ai');

(async () => {
	const response = await delphi('Fighting a mummy');
	console.log(response); // "It's wrong"
})();

// or

delphi('Climbing up the Eiffel Tower').then((response) => {
	console.log(response); // "It's normal"
});
```

## Development

When a merge request is created, the changes must pass linting, building, and unit tests. These checks are run automatically by GitHub. You can run them manually using `npm run lint`, `npm run build`, and `npm test`.

GitHub will also periodically run a test to confirm the API is still working. You can run this test manually with `npm run test-api`.

When a new [Release](https://github.com/JstnMcBrd/delphi-ai/releases) is created, GitHub will automatically deploy the new version to the [npm registry](https://npmjs.com/package/delphi-ai).

This project abides by [Semantic Versioning](https://semver.org/) and [Keep A Changelog](https://keepachangelog.com/). To see a list of changes for each update, check the description of [releases on GitHub](https://github.com/JstnMcBrd/delphi-ai/releases).

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