
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@relevanceai/chain
Advanced tools
The managed, developer-first SDK for building LLM chains.
Get started with the SDK and CLI by installing it with the following line:
npm i -g @relevanceai/chain
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
See our full documentation here.
Run scripts/update-codegen.sh and publish the draft release that gets created.
FAQs
The managed, developer-first SDK for building LLM chains.
We found that @relevanceai/chain demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.