# @intervene/parser

Latest version **0.1.12** (published 2023-11-20) · 0 weekly downloads

## Install

```sh
npm install @intervene/parser
pnpm add @intervene/parser
yarn add @intervene/parser
bun add @intervene/parser
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.12 |
| Published | 2023-11-20 |
| First published | 2023-10-17 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 10 |
| Unpacked size | 284.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 29 |
| Author | Sudhanshu Gautam |
| Maintainers | sudhanshug |

## Links

- npm: https://www.npmjs.com/package/@intervene/parser
- Repository: https://github.com/intervenehq/parser
- Homepage: https://github.com/intervenehq/parser#readme
- Issues: https://github.com/intervenehq/parser/issues
- npm.io page: https://npm.io/package/@intervene/parser

## Dependencies (10)

- [ora](https://npm.io/package/ora.md) ^7.0.1
- [tsx](https://npm.io/package/tsx.md) ^3.13.0
- [zod](https://npm.io/package/zod.md) ^3.22.4
- [sift](https://npm.io/package/sift.md) ^17.0.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [handlebars](https://npm.io/package/handlebars.md) ^4.7.8
- [object-hash](https://npm.io/package/object-hash.md) ^3.0.0
- [gpt-tokenizer](https://npm.io/package/gpt-tokenizer.md) ^2.1.2
- [string-strip-html](https://npm.io/package/string-strip-html.md) ^13.4.3
- [@apidevtools/swagger-parser](https://npm.io/package/@apidevtools/swagger-parser.md) ^10.1.0

## Recent versions

- 0.1.12 (latest) — 2023-11-20
- 0.1.11 — 2023-11-17
- 0.1.10 — 2023-11-17
- 0.1.9 — 2023-11-11
- 0.1.8 — 2023-11-06
- 0.1.7 — 2023-11-06
- 0.1.6 — 2023-11-06
- 0.1.5 — 2023-11-01
- 0.1.4 — 2023-10-31
- 0.1.3 — 2023-10-20
- 0.1.2 — 2023-10-20
- 0.1.1 — 2023-10-19
- 0.1.0 — 2023-10-19
- 0.0.1 — 2023-10-17

## README

# Intervene Parser

<p align="center">
  <img src="https://raw.githubusercontent.com/tryintervene/parser/main/public/images/logo.jpg" alt="Intervene Parser Logo" width="200" height="200">
  <br />
  <br />
  <a href="https://discord.gg/tsgtfUEvWk">
   <img src="https://dcbadge.vercel.app/api/server/tsgtfUEvWk?compact=true&style=flat" alt="Discord"/>
  </a>

[Introduction](#introduction) |
[How to use](#usage) |
[FAQs](#faqs) |
[Contact](mailto:me@sudhanshug.com)

</p>

> Launching a drop-in replacement to Zapier NLA by Nov 7th! Please contact me [me@sudhanshug.com](mailto:me@sudhanshug.com) if you have any questions.

## Introduction

_Open source Natural Language Actions (NLA)_

Translate natural language into API calls.

<br/>

### Here is a web based demo to try it out:
https://tryintervene.github.io/parser-demo/

<br />

Here's a quick demo video:

https://github.com/tryintervene/parser/assets/9914480/b91eb0d2-64c5-4231-8989-1c27a105c3be

Here's a sample output:

```bash
{
    "provider": "<API provider name>",
    "method": "<Http Method>",
    "path": "<API endpoint to call>",
    "bodyParams": "<eval'able function to return body params>",
    "queryParams": "<eval'able function to return query params>",
    "pathParams": "<eval'able function to return path params>",
    "requestContentType": "application/x-www-form-urlencoded",
    "responseContentType": "application/json",
    "responseSchema": "<schema of the Response>"
  }
```

## Usage

You can install the parser by running:

```bash
npm install @intervene/parser
```

> Note: The project is under active development and has not reached v0 yet. Proceed with caution and report any issues you may notice.

## FAQs

### This looks cool, but what about prod?

You can use the library as is in production but proceed with caution as it is under active development.

If you're interested in a hosted solution, please [fill out this quick form](https://tally.so/r/wzMJ8a), and I will get back to you in no time!

### Can it run with GPT 3.5?

You can use GPT 3.5 (or equivalent) which will make this a lot faster, cheaper but less accurate. You can go this route for simpler API calls that need to extract data from the user prompt. You can use the `--trivial` flag to do this

However, the code can be optimized to use the less capable models for selective tasks. Open to PRs :)

### What about other LLMs?

This project works only with OpenAI models for now. I will be exploring other LLMs as well. Let me know [which one you want by opening an issue here](https://github.com/tryintervene/parser/issues/new?title=Request%20to%20integrate%20LLM:%20[LLM]&body=Hi,%20can%20you%20please%20add%20the%20following%20LLM%20to%20the%20parser:%20) or feel free to open a PR!

### Umm I don't like JavaScript. What about python?

Before porting it to Python or Golang (or both), I want to determine if there are any real-world use cases for this technology. Please try out the CLI, share your thoughts, and I will promptly port it to other languages based on the feedback.

I chose to start with a statically typed language due to the nature of the project. I could have used Golang, but I aimed for simplicity, hence the choice of TypeScript.

### I want to contribute

Awesome! PRs and issues are welcome!

## Credits

Credits to [LangChain](https://github.com/langchain-ai/langchain) and [LlamaIndex](https://github.com/run-llama/llama_index) for the inspiration for some of the techniques used in the project.

Special credits to [@rohanmayya](https://github.com/rohanmayya) for helping lay the foundation for this project.

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