0.1.10 • Published 6 months ago

@relevanceai/chain v0.1.10

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

Relevance AI Chain SDK

Relevance AI stack

npm GitHub commit activity Discord Twitter Follow

The managed, developer-first SDK for building LLM chains.

🔨 Installation

Get started with the SDK and CLI by installing it with the following line:

npm i -g @relevanceai/chain

🏃‍♀️ Quickstart

Authenticate into your Relevance AI account

relevance login

Create a /chains folder with a file for each chain

/chains
- pdf-qa.ts
- generate-sql.ts
- generate-configs.ts

Represent the chain in code exporting defineChain and configure the chain. The first argument is a config of the chain and the input schema. The second argument is the setup function which is used to define the chain with each step.

import { defineChain } from '@relevanceai/chain';

export default defineChain(
    {
        title: 'PDF Q&A',
        params: {
            question: { type: 'string' },
            file_url: { type: 'string' }
        }
    },
    setup(({ params, step }) => {
        const { question, file_url } = params;

        const { text } = step('pdf_to_text', { file_url });
        const { answer } = step('prompt_completion', { 
            prompt: `${text}\n Based on the above context, answer the question ${question}` 
        });

        return {
            answer
        };
    })
});

Deploy the chains

relevance deploy

Documentation

See our full documentation here.

Re-generating & publishing transformation types

Run scripts/update-codegen.sh and publish the draft release that gets created.

0.1.10

6 months ago

0.1.8

10 months ago

0.1.7

10 months ago

0.1.9

8 months ago

0.1.6

10 months ago

0.1.5

10 months ago

0.1.4

11 months ago

0.1.3

11 months ago

0.1.2

11 months ago

0.1.1

12 months ago

0.0.19

12 months ago

0.0.18

12 months ago

0.0.16

12 months ago

0.0.14

12 months ago

0.0.13

12 months ago

0.0.11

12 months ago

0.0.10

12 months ago

0.0.9

12 months ago

0.0.8

12 months ago

0.0.7

12 months ago

0.0.5

12 months ago

0.0.4

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago