Skip to content

outpostHQ/outpostkit

Repository files navigation

Outpost Kit

The Outpost API Node.js SDK with TypeScript support.

NPM Version Discord

Installation

# with npm
npm install outpostkit

# with yarn
yarn add outpostkit

# with pnpm
pnpm add outpostkit

Usage

To start using the Comet API, create a Comet object with your API key and the ID of the comet service.

import { Comet } from 'outpostkit' 
const comet= new Comet('api-key','cometId');

Now you can start prompting the comet service

const response = comet.prompt({input:"what is useCallback?",stream:false}); //returns sessionId along with the response

This will create a new Session which can then be used in subsequent prompts to maintain messaging history, which can be particularly useful when using chat models. To continue the prompting in the same session:

const response = comet.prompt({input:"what is useCallback?",stream:false,sessionId:'prevSession'});

Prompt Sessions

List Prompt Sessions

const sessions = comet.listSessions({});

Get details of a particular Session

const session = comet.getSession({sessionId:'someSessionId'});

A Session consists of one or more Conversations which in turn are usally just a single prompt and its response (for example: pair of one human and one agent Message). The Conversation model is created to better handle human feedback.

A conversation can also contain messages from functions, system too.

Conversations

List Conversations of a Session

const conversations = comet.listConversations({sessionId:'sessionId',stats:false,messages:true}); //defaults: stats:false messages:false

This lists all the conversations of a session along with its messages but omits the conversation stats

Get messages and details of a particular Conversation

const conversation = comet.getConversation({conversationId:'convoId'});

Messages

Get Message

const message = comet.getMessage({messageId:'mId'});

Available Routes

Route Route Description
GET /api/v1/project Endpoint to receive Project lists.
GET /api/v1/comet Endpoint to receive Comet lists.
GET /api/v1/conflux Endpoint to receive Conflux lists.

License

Outpost Kit is a project by Outpost.

Released under the MIT License.