Skip to content

WeAreAigur/client

Repository files navigation

Aigur Client

A free and opensource (MIT) client to compose and invoke fully typed Generative AI pipelines.

Check out the documentation at https://client.aigur.dev

Simple Example

This simple pipeline accepts a subject and returns a joke about that subject.

import {
  createClient,
  replaceString,
  gpt3Prediction
} from '@aigur/client';

export const aigur = createClient({
  apiKeys: {
    openai: process.env.OPENAI_KEY!,
  },
});

export const jokeGptPipeline = aigur.pipeline
  .create<{ subject: string }, { joke: string }>({
    id: 'jokegpt',
     flow: (flow) =>
       flow
         .node(replaceString, ({ input }) => ({
           text: input.subject,
           modifier: 'tell me a joke about $(text)$',
         }))
         .node(gpt3Prediction, ({ prev }) => ({
           prompt: prev.text,
         }))
         .output(({ prev }) => ({
           joke: prev.text,
         })
  });

const { joke } = await jokeGptPipeline.invoke({
  subject: 'a car'
});

Create an Image with Your Voice

Check out this next example in the docs site.

aigur-client

About

A free and opensource (MIT) library to compose and invoke fully typed (🎉) Generative AI pipelines.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages