Skip to main content
Home

latest

A tiny (1.18kB), tree-shakeable OpenAI client. Optionally supports response streaming in all JavaScript runtimes.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
82%
Published
5 months ago (0.0.8)
type alias Trajectory

Type Parameters

S extends Settings
T extends AnyTool = S["tools"][number]

Methods

Allows using syntax.

using trajectory = agent.prompt('...');

for await let (step of trajectory) {
  switch (step.name) {
    // ...
  }
}

Iterate and process each Step the Agent wants to execute.

Important

You must invoke Step['run'] and pass its (or any) Result to Step['reply'] manually. This allows you to employ any custom conditional/confirmation logic before executing the model-driven combinations of Tools and parameters.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@agent/openai

Import symbol

import { type Trajectory } from "@agent/openai/agent";
or

Import directly with a jsr specifier

import { type Trajectory } from "jsr:@agent/openai/agent";

Add Package

pnpm i jsr:@agent/openai
or (using pnpm 10.8 or older)
pnpm dlx jsr add @agent/openai

Import symbol

import { type Trajectory } from "@agent/openai/agent";

Add Package

yarn add jsr:@agent/openai
or (using Yarn 4.8 or older)
yarn dlx jsr add @agent/openai

Import symbol

import { type Trajectory } from "@agent/openai/agent";

Add Package

vlt install jsr:@agent/openai

Import symbol

import { type Trajectory } from "@agent/openai/agent";

Add Package

npx jsr add @agent/openai

Import symbol

import { type Trajectory } from "@agent/openai/agent";

Add Package

bunx jsr add @agent/openai

Import symbol

import { type Trajectory } from "@agent/openai/agent";