Skip to content

@toolcog/runtime

Toolcog runtime

Classes

AgentContext

Extends

Constructors

new AgentContext()

new AgentContext(parent, options?): AgentContext

Parameters

parent: null | AgentContext = null

options?: AgentContextOptions

Returns

AgentContext

Overrides

Emitter.constructor

Defined in

runtime/src/agent.ts:23

Properties

error

readonly static error: typeof error

Inherited from

Emitter.error

Defined in

util/emit/src/emitter.ts:30

errorMonitor

readonly static errorMonitor: typeof errorMonitor

Inherited from

Emitter.errorMonitor

Defined in

util/emit/src/emitter.ts:31

Accessors

messages

get messages(): readonly Message[]

Returns

readonly Message[]

Defined in

runtime/src/agent.ts:39

parent

get parent(): null | AgentContext

Returns

null | AgentContext

Defined in

runtime/src/agent.ts:35

query

get query(): undefined | string

Returns

undefined | string

Defined in

runtime/src/agent.ts:47

tools

get tools(): readonly ToolSource[]

Returns

readonly ToolSource[]

Defined in

runtime/src/agent.ts:43

Methods

addListener()

addListener<Event>(event, listener, options?): this

Type Parameters

Event extends keyof AgentContextEvents

Parameters

event: Event

listener: EmitListener<AgentContextEvents[Event]>

options?: EmitListenerOptions

Returns

this

Inherited from

Emitter.addListener

Defined in

util/emit/src/emitter.ts:41

addMessage()

addMessage(message): void

Parameters

message: Message

Returns

void

Defined in

runtime/src/agent.ts:51

clear()

clear(): void

Returns

void

Defined in

runtime/src/agent.ts:74

emit()

emit<Event>(event, …args): boolean

Type Parameters

Event extends keyof AgentContextEvents

Parameters

event: Event

• …args: AgentContextEvents[Event]

Returns

boolean

Inherited from

Emitter.emit

Defined in

util/emit/src/emitter.ts:218

events()

events(): IterableIterator<keyof AgentContextEvents, any, any>

Returns

IterableIterator<keyof AgentContextEvents, any, any>

Inherited from

Emitter.events

Defined in

util/emit/src/emitter.ts:268

listeners()

listeners<Event>(event): IterableIterator<EmitListener<AgentContextEvents[Event]>, any, any>

Type Parameters

Event extends keyof AgentContextEvents

Parameters

event: Event

Returns

IterableIterator<EmitListener<AgentContextEvents[Event]>, any, any>

Inherited from

Emitter.listeners

Defined in

util/emit/src/emitter.ts:272

on()

on<Event>(event, options?): AsyncIterableIterator<AgentContextEvents[Event], any, any>

Type Parameters

Event extends keyof AgentContextEvents

Parameters

event: Event

options?: EmitAsyncOptions

Returns

AsyncIterableIterator<AgentContextEvents[Event], any, any>

Inherited from

Emitter.on

Defined in

util/emit/src/emitter.ts:72

once()

once<Event>(event, options?): Promise<AgentContextEvents[Event]>

Type Parameters

Event extends keyof AgentContextEvents

Parameters

event: Event

options?: EmitAsyncOptions

Returns

Promise<AgentContextEvents[Event]>

Inherited from

Emitter.once

Defined in

util/emit/src/emitter.ts:169

removeListener()

removeListener<Event>(event, listener, options?): this

Type Parameters

Event extends keyof AgentContextEvents

Parameters

event: Event

listener: EmitListener<AgentContextEvents[Event]>

options?: EmitListenerOptions

Returns

this

Inherited from

Emitter.removeListener

Defined in

util/emit/src/emitter.ts:51

setQuery()

setQuery(query): void

Parameters

query: undefined | string

Returns

void

Defined in

runtime/src/agent.ts:70

spawn()

spawn(options?): AgentContext

Parameters

options?: AgentContextOptions

Returns

AgentContext

Defined in

runtime/src/agent.ts:80

useTool()

useTool<T>(tool): T

Type Parameters

T extends ToolSource

Parameters

tool: T

Returns

T

Defined in

runtime/src/agent.ts:56

useTools()

useTools<T>(tools): T

Type Parameters

T extends readonly ToolSource[]

Parameters

tools: T

Returns

T

Defined in

runtime/src/agent.ts:62

create()

static create(options?): AgentContext

Parameters

options?: AgentContextOptions

Returns

AgentContext

Defined in

runtime/src/agent.ts:102

current()

static current(): AgentContext

Returns

AgentContext

Defined in

runtime/src/agent.ts:90

get()

static get(): null | AgentContext

Returns

null | AgentContext

Defined in

runtime/src/agent.ts:98

getOrCreate()

static getOrCreate(options?): AgentContext

Parameters

options?: AgentContextOptions

Returns

AgentContext

Defined in

runtime/src/agent.ts:106

run()

static run<F>(context, func, …args): ReturnType<F>

Type Parameters

F extends (…args) => unknown

Parameters

context: undefined | null | AgentContext

func: F

• …args: Parameters<F>

Returns

ReturnType<F>

Defined in

runtime/src/agent.ts:114

spawn()

static spawn<R>(options, func): R

Type Parameters

R

Parameters

options: undefined | AgentContextOptions

func

Returns

R

Defined in

runtime/src/agent.ts:122


Job

Extends

Constructors

new Job()

new Job(parent, info?): Job

Parameters

parent: null | Job = null

info?: JobInfo

Returns

Job

Overrides

Emitter.constructor

Defined in

runtime/src/job.ts:36

Properties

error

readonly static error: typeof error

Inherited from

Emitter.error

Defined in

util/emit/src/emitter.ts:30

errorMonitor

readonly static errorMonitor: typeof errorMonitor

Inherited from

Emitter.errorMonitor

Defined in

util/emit/src/emitter.ts:31

Accessors

childCount

get childCount(): number

Returns

number

Defined in

runtime/src/job.ts:77

depth

get depth(): number

Returns

number

Defined in

runtime/src/job.ts:73

descendantCount

get descendantCount(): number

Returns

number

Defined in

runtime/src/job.ts:81

ellipsize

get ellipsize(): undefined | number

Returns

undefined | number

Defined in

runtime/src/job.ts:163

finished

get finished(): boolean

Returns

boolean

Defined in

runtime/src/job.ts:167

firstChild

get firstChild(): null | Job

Returns

null | Job

Defined in

runtime/src/job.ts:93

lastChild

get lastChild(): null | Job

Returns

null | Job

Defined in

runtime/src/job.ts:97

nextSibling

get nextSibling(): null | Job

Returns

null | Job

Defined in

runtime/src/job.ts:85

output

get output(): undefined | string

Returns

undefined | string

Defined in

runtime/src/job.ts:155

outputType

get outputType(): JobOutputType

Returns

JobOutputType

Defined in

runtime/src/job.ts:159

parent

get parent(): null | Job

Returns

null | Job

Defined in

runtime/src/job.ts:56

prevSibling

get prevSibling(): null | Job

Returns

null | Job

Defined in

runtime/src/job.ts:89

root

get root(): Job

Returns

Job

Defined in

runtime/src/job.ts:60

title

get title(): undefined | string

Returns

undefined | string

Defined in

runtime/src/job.ts:151

Methods

addListener()

addListener<Event>(event, listener, options?): this

Type Parameters

Event extends keyof JobEvents

Parameters

event: Event

listener: EmitListener<JobEvents[Event]>

options?: EmitListenerOptions

Returns

this

Inherited from

Emitter.addListener

Defined in

util/emit/src/emitter.ts:41

children()

children(startIndex): Iterable<Job, any, any>

Parameters

startIndex: number = 0

Returns

Iterable<Job, any, any>

Defined in

runtime/src/job.ts:101

descendants()

descendants(startIndex): Iterable<Job, any, any>

Parameters

startIndex: number = 0

Returns

Iterable<Job, any, any>

Defined in

runtime/src/job.ts:123

emit()

emit<Event>(event, …args): boolean

Type Parameters

Event extends keyof JobEvents

Parameters

event: Event

• …args: JobEvents[Event]

Returns

boolean

Inherited from

Emitter.emit

Defined in

util/emit/src/emitter.ts:218

events()

events(): IterableIterator<keyof JobEvents, any, any>

Returns

IterableIterator<keyof JobEvents, any, any>

Inherited from

Emitter.events

Defined in

util/emit/src/emitter.ts:268

finish()

finish(info?): void

Parameters

info?: string | JobInfo

Returns

void

Defined in

runtime/src/job.ts:201

fork()

fork(info?): Job

Parameters

info?: JobInfo

Returns

Job

Defined in

runtime/src/job.ts:226

listeners()

listeners<Event>(event): IterableIterator<EmitListener<JobEvents[Event]>, any, any>

Type Parameters

Event extends keyof JobEvents

Parameters

event: Event

Returns

IterableIterator<EmitListener<JobEvents[Event]>, any, any>

Inherited from

Emitter.listeners

Defined in

util/emit/src/emitter.ts:272

on()

on<Event>(event, options?): AsyncIterableIterator<JobEvents[Event], any, any>

Type Parameters

Event extends keyof JobEvents

Parameters

event: Event

options?: EmitAsyncOptions

Returns

AsyncIterableIterator<JobEvents[Event], any, any>

Inherited from

Emitter.on

Defined in

util/emit/src/emitter.ts:72

once()

once<Event>(event, options?): Promise<JobEvents[Event]>

Type Parameters

Event extends keyof JobEvents

Parameters

event: Event

options?: EmitAsyncOptions

Returns

Promise<JobEvents[Event]>

Inherited from

Emitter.once

Defined in

util/emit/src/emitter.ts:169

removeListener()

removeListener<Event>(event, listener, options?): this

Type Parameters

Event extends keyof JobEvents

Parameters

event: Event

listener: EmitListener<JobEvents[Event]>

options?: EmitListenerOptions

Returns

this

Inherited from

Emitter.removeListener

Defined in

util/emit/src/emitter.ts:51

update()

update(info): void

Parameters

info: string | JobInfo

Returns

void

Defined in

runtime/src/job.ts:171

get()

static get(): null | Job

Returns

null | Job

Defined in

runtime/src/job.ts:255

run()

static run<F>(job, func, …args): ReturnType<F>

Type Parameters

F extends (…args) => unknown

Parameters

job: undefined | null | Job

func: F

• …args: Parameters<F>

Returns

ReturnType<F>

Defined in

runtime/src/job.ts:259

spawn()

static spawn<R>(info, func): Promise<Awaited<R>>

Type Parameters

R

Parameters

info: undefined | string | JobInfo

func

Returns

Promise<Awaited<R>>

Defined in

runtime/src/job.ts:267


Runtime

Constructors

new Runtime()

new Runtime(config?): Runtime

Parameters

config?: RuntimeConfig

Returns

Runtime

Defined in

runtime/src/runtime.ts:56

Accessors

embedderConfig

get embedderConfig(): EmbedderConfig

Returns

EmbedderConfig

Defined in

runtime/src/runtime.ts:68

generatorConfig

get generatorConfig(): GeneratorConfig

Returns

GeneratorConfig

Defined in

runtime/src/runtime.ts:76

indexerConfig

get indexerConfig(): IndexerConfig

Returns

IndexerConfig

Defined in

runtime/src/runtime.ts:72

inventory

get inventory(): Inventory<Float32Array>

Returns

Inventory<Float32Array>

Defined in

runtime/src/runtime.ts:80

plugins

get plugins(): Plugin[]

Returns

Plugin[]

Defined in

runtime/src/runtime.ts:64

Methods

embed()

embed<T>(texts, options?): Promise<Embedded<T>>

Type Parameters

T extends string | readonly string[]

Parameters

texts: T

options?: EmbedderOptions

Returns

Promise<Embedded<T>>

Defined in

runtime/src/runtime.ts:147

embedder()

embedder(options?): Promise<Embedder>

Parameters

options?: EmbedderOptions

Returns

Promise<Embedder>

Defined in

runtime/src/runtime.ts:114

embedderOptions()

embedderOptions(options): EmbedderOptions

Parameters

options: undefined | EmbedderOptions

Returns

EmbedderOptions

Defined in

runtime/src/runtime.ts:84

generate()

generate(args, options?): Promise<unknown>

Parameters

args: unknown

options?: GeneratorOptions

Returns

Promise<unknown>

Defined in

runtime/src/runtime.ts:165

generator()

generator(options?): Promise<Generator>

Parameters

options?: GeneratorOptions

Returns

Promise<Generator>

Defined in

runtime/src/runtime.ts:136

generatorOptions()

generatorOptions(options): GeneratorOptions

Parameters

options: undefined | GeneratorOptions

Returns

GeneratorOptions

Defined in

runtime/src/runtime.ts:99

index()

index<T>(idioms, options?): Promise<Index<T>>

Type Parameters

T extends readonly unknown[]

Parameters

idioms: Idioms<T>

options?: IndexerOptions

Returns

Promise<Index<T>>

Defined in

runtime/src/runtime.ts:156

indexer()

indexer(options): Promise<Indexer>

Parameters

options: IndexerOptions

Returns

Promise<Indexer>

Defined in

runtime/src/runtime.ts:125

indexerOptions()

indexerOptions(options): IndexerOptions

Parameters

options: undefined | IndexerOptions

Returns

IndexerOptions

Defined in

runtime/src/runtime.ts:91

resolveIdiom()

resolveIdiom(id, value): undefined | Embeddings<Float32Array>

Parameters

id: string

value: unknown

Returns

undefined | Embeddings<Float32Array>

Defined in

runtime/src/runtime.ts:182

create()

static create(config?): Promise<Runtime>

Parameters

config?: RuntimeConfigSource

Returns

Promise<Runtime>

Defined in

runtime/src/runtime.ts:202

current()

static current(): Runtime

Returns

Runtime

Defined in

runtime/src/runtime.ts:210

get()

static get(): null | Runtime

Returns

null | Runtime

Defined in

runtime/src/runtime.ts:218

resolveConfig()

static resolveConfig(config?): Promise<RuntimeConfig>

Parameters

config?: RuntimeConfigSource

Returns

Promise<RuntimeConfig>

Defined in

runtime/src/runtime.ts:190

run()

static run<F>(runtime, func, …args): ReturnType<F>

Type Parameters

F extends (…args) => unknown

Parameters

runtime: undefined | null | Runtime

func: F

• …args: Parameters<F>

Returns

ReturnType<F>

Defined in

runtime/src/runtime.ts:222

systemPrompt()

static systemPrompt(): string

Returns

string

Defined in

runtime/src/runtime.ts:186

Interfaces

AgentContextOptions

Properties

messages?

optional messages: Message[]

Defined in

runtime/src/agent.ts:7

tools?

optional tools: ToolSource[]

Defined in

runtime/src/agent.ts:8


AssistantMessage

A chat message from an assistant to a user.

Properties

content

readonly content: string | readonly AssistantBlock[]

The content of the message, either a string or an array of content blocks.

Defined in

runtime/src/message.ts:128

role

readonly role: "assistant"

Identifies this as a message coming from the assistant.

Defined in

runtime/src/message.ts:123


IdiomDef

Properties

embeds

embeds: string[]

Defined in

runtime/src/manifest.ts:7


IdiomInventory<V>

Type Parameters

V = EmbeddingVector

Properties

embeddings

embeddings: Embeddings<V>

Defined in

runtime/src/inventory.ts:11


ImageBlock

A content block containing an image.

Properties

source

readonly source: string

The URL of the image.

Defined in

runtime/src/message.ts:28

type

readonly type: "image"

Identifies this as an image content block.

Defined in

runtime/src/message.ts:23


IndexDef

Properties

idioms

idioms: string[]

Defined in

runtime/src/manifest.ts:11


Inventory<V>

Type Parameters

V = EmbeddingVector

Properties

embeddingModels

embeddingModels: string & object[]

Defined in

runtime/src/inventory.ts:15

idioms

idioms: object

Index Signature

[idiomId: string]: IdiomInventory<V>

Defined in

runtime/src/inventory.ts:17


JobInfo

Properties

ellipsize?

optional ellipsize: number

Defined in

runtime/src/job.ts:10

output?

optional output: string

Defined in

runtime/src/job.ts:8

outputType?

optional outputType: JobOutputType

Defined in

runtime/src/job.ts:9

title?

optional title: string

Defined in

runtime/src/job.ts:7


Manifest

Properties

modules

modules: object

Index Signature

[moduleId: string]: ModuleDef

Defined in

runtime/src/manifest.ts:37


ModuleDef

Properties

idioms

idioms: object

Index Signature

[idiomId: string]: IdiomDef

Defined in

runtime/src/manifest.ts:30

indexes

indexes: object

Index Signature

[indexId: string]: IndexDef

Defined in

runtime/src/manifest.ts:31

prompts

prompts: object

Index Signature

[promptId: string]: PromptDef

Defined in

runtime/src/manifest.ts:33

tools

tools: object

Index Signature

[toolId: string]: ToolDef

Defined in

runtime/src/manifest.ts:32


Plugin

Properties

embedder()?

readonly optional embedder: (options?) => Promise<undefined | Embedder>

Parameters

options?: EmbedderOptions

Returns

Promise<undefined | Embedder>

Defined in

runtime/src/plugin.ts:15

generator()?

readonly optional generator: (options?) => Promise<undefined | Generator>

Parameters

options?: GeneratorOptions

Returns

Promise<undefined | Generator>

Defined in

runtime/src/plugin.ts:21

indexer()?

readonly optional indexer: (options) => Promise<undefined | Indexer>

Parameters

options: IndexerOptions

Returns

Promise<undefined | Indexer>

Defined in

runtime/src/plugin.ts:19

name

readonly name: string

Defined in

runtime/src/plugin.ts:11

version?

readonly optional version: string

Defined in

runtime/src/plugin.ts:13


Precache<V>

Type Parameters

V = EmbeddingVector

Properties

embeddings

embeddings: Embeddings<V>

Defined in

runtime/src/precache.ts:6


PrefetchInventoryOptions

Properties

embedder?

optional embedder: Embedder

Defined in

runtime/src/prefetch.ts:11

embeddingModels?

optional embeddingModels: string & object[]

Defined in

runtime/src/prefetch.ts:9

precache?

optional precache: Precache<Float32Array>

Defined in

runtime/src/prefetch.ts:13


PromptDef

Properties

description?

optional description: string

Defined in

runtime/src/manifest.ts:23

instructions

instructions: undefined | string

Defined in

runtime/src/manifest.ts:26

name?

optional name: string

Defined in

runtime/src/manifest.ts:22

parameters?

optional parameters: Schema

Defined in

runtime/src/manifest.ts:24

returns?

optional returns: Schema

Defined in

runtime/src/manifest.ts:25


RefusalBlock

A content block containing a refusal message.

Properties

refusal

readonly refusal: string

The stated reason for the refusal.

Defined in

runtime/src/message.ts:43

type

readonly type: "refusal"

Identifies this as a refusal content block.

Defined in

runtime/src/message.ts:38


RequestBlock

A content block containing a tool request.

Properties

arguments

readonly arguments: unknown

The arguments to the tool function.

Defined in

runtime/src/message.ts:68

id

readonly id: string

A unique identifier for this tool request.

Defined in

runtime/src/message.ts:58

name

readonly name: string

The name of the tool to invoke.

Defined in

runtime/src/message.ts:63

type

readonly type: "request"

Identifies this as a tool request content block.

Defined in

runtime/src/message.ts:53


ResponseBlock

A content block containing a tool response.

Properties

id

readonly id: string

The unique identifier of the tool request.

Defined in

runtime/src/message.ts:83

result

readonly result: string

The return value of the tool function.

Defined in

runtime/src/message.ts:88

type

readonly type: "response"

Identifies this as a tool response content block.

Defined in

runtime/src/message.ts:78


RuntimeConfig

Properties

embedder?

optional embedder: EmbedderConfig

Defined in

runtime/src/runtime.ts:40

generator?

optional generator: GeneratorConfig

Defined in

runtime/src/runtime.ts:44

indexer?

optional indexer: IndexerConfig

Defined in

runtime/src/runtime.ts:42

inventory?

optional inventory: Inventory<Float32Array>

Defined in

runtime/src/runtime.ts:46

plugins?

optional plugins: null | Plugin[]

Defined in

runtime/src/runtime.ts:38


RuntimeConfigSource

Properties

embedder?

optional embedder: EmbedderConfig

Defined in

runtime/src/runtime.ts:28

generator?

optional generator: GeneratorConfig

Defined in

runtime/src/runtime.ts:32

indexer?

optional indexer: IndexerConfig

Defined in

runtime/src/runtime.ts:30

inventory?

optional inventory: InventorySource

Defined in

runtime/src/runtime.ts:34

plugins?

optional plugins: null | PluginSource[]

Defined in

runtime/src/runtime.ts:26


TextBlock

A content block containing text.

Properties

text

readonly text: string

The text content for this block.

Defined in

runtime/src/message.ts:13

type

readonly type: "text"

Identifies this as a text content block.

Defined in

runtime/src/message.ts:8


ToolDef

Properties

description?

optional description: string

Defined in

runtime/src/manifest.ts:16

name?

optional name: string

Defined in

runtime/src/manifest.ts:15

parameters?

optional parameters: Schema

Defined in

runtime/src/manifest.ts:17

returns?

optional returns: Schema

Defined in

runtime/src/manifest.ts:18


UserMessage

A chat message from a user to an assistant.

Properties

content

readonly content: string | readonly UserBlock[]

The content of the message, either a string or an array of content blocks.

Defined in

runtime/src/message.ts:108

role

readonly role: "user"

Identifies this as a message coming from the user.

Defined in

runtime/src/message.ts:103

Type Aliases

AgentContextEvents

AgentContextEvents: object

Type declaration

message

message: [Message, AgentContext]

spawn

spawn: [AgentContext, AgentContext]

useTool

useTool: [ToolSource, AgentContext]

Defined in

runtime/src/agent.ts:11


AssistantBlock

AssistantBlock: TextBlock | RefusalBlock | RequestBlock

A content block in a message from an assistant to a user.

Defined in

runtime/src/message.ts:114


InventorySource

InventorySource: () => Promise<Inventory | undefined> | Inventory | undefined | Promise<Inventory | undefined> | Inventory | string | boolean | undefined

Defined in

runtime/src/inventory.ts:83


JobEvents

JobEvents: object

Type declaration

finish

finish: [Job]

fork

fork: [Job, Job]

update

update: [Job]

Defined in

runtime/src/job.ts:13


JobOutputType

JobOutputType: "text" | "markdown" | "json"

Defined in

runtime/src/job.ts:4


Message

Message: UserMessage | AssistantMessage

A chat message between a user and an assistant.

Defined in

runtime/src/message.ts:139


MessageBlock

MessageBlock: UserBlock | AssistantBlock

A content block in a message between a user and an assistant.

Defined in

runtime/src/message.ts:134


PluginSource

PluginSource: () => Promise<Plugin | undefined> | Plugin | undefined | Promise<Plugin | undefined> | Plugin | undefined

Defined in

runtime/src/plugin.ts:26


UserBlock

UserBlock: TextBlock | ImageBlock | ResponseBlock

A content block in a message from a user to an assistant.

Defined in

runtime/src/message.ts:94

Variables

inventoryFileName

const inventoryFileName: "toolcog-inventory.yaml" = "toolcog-inventory.yaml"

Defined in

runtime/src/inventory.ts:20


manifestFileName

const manifestFileName: "toolcog-manifest.yaml" = "toolcog-manifest.yaml"

Defined in

runtime/src/manifest.ts:40


precacheFileName

const precacheFileName: ".toolcog/precache.yaml" = ".toolcog/precache.yaml"

Defined in

runtime/src/precache.ts:9

Functions

cosineDistance()

cosineDistance(a, b): number

Parameters

a: Float32Array

b: Float32Array

Returns

number

Defined in

runtime/src/indexer.ts:16


createInventory()

createInventory(): Inventory<Float32Array>

Returns

Inventory<Float32Array>

Defined in

runtime/src/inventory.ts:76


createManifest()

createManifest(): Manifest

Returns

Manifest

Defined in

runtime/src/manifest.ts:75


createModuleDef()

createModuleDef(): ModuleDef

Returns

ModuleDef

Defined in

runtime/src/manifest.ts:102


createPrecache()

createPrecache(): Precache<Float32Array>

Returns

Precache<Float32Array>

Defined in

runtime/src/precache.ts:37


currentQuery()

currentQuery(): undefined | string

Returns

undefined | string

Defined in

runtime/src/agent.ts:133


currentTools()

currentTools(): readonly ToolSource[]

Returns

readonly ToolSource[]

Defined in

runtime/src/agent.ts:137


embed()

embed<T>(embed, options?): Promise<Embedded<T>>

Type Parameters

T extends string | readonly string[]

Parameters

embed: T

options?: EmbedderOptions

Returns

Promise<Embedded<T>>

Defined in

runtime/src/runtime.ts:231


formatInventory()

formatInventory(cache): string

Parameters

cache: Inventory<Float32Array>

Returns

string

Defined in

runtime/src/inventory.ts:30


formatManifest()

formatManifest(manifest): string

Parameters

manifest: Manifest

Returns

string

Defined in

runtime/src/manifest.ts:60


formatPrecache()

formatPrecache(cache): string

Parameters

cache: Precache<Float32Array>

Returns

string

Defined in

runtime/src/precache.ts:19


generate()

generate(args, options?): Promise<unknown>

Parameters

args: unknown

options?: GeneratorOptions

Returns

Promise<unknown>

Defined in

runtime/src/runtime.ts:247


index()

index<T>(idioms, options?): Promise<Index<T>>

Type Parameters

T extends readonly unknown[]

Parameters

idioms: Idioms<T>

options?: IndexerOptions

Returns

Promise<Index<T>>

Defined in

runtime/src/runtime.ts:239


indexer()

indexer<T>(idioms, indexerOptions?): Promise<Index<T>>

Type Parameters

T extends readonly unknown[]

Parameters

idioms: Idioms<T>

indexerOptions?: IndexerOptions

Returns

Promise<Index<T>>

Defined in

runtime/src/indexer.ts:32


parseInventory()

parseInventory(yaml): Inventory<Float32Array>

Parameters

yaml: string

Returns

Inventory<Float32Array>

Defined in

runtime/src/inventory.ts:22


parseManifest()

parseManifest(yaml): Manifest

Parameters

yaml: string

Returns

Manifest

Defined in

runtime/src/manifest.ts:56


parsePrecache()

parsePrecache(yaml): Precache<Float32Array>

Parameters

yaml: string

Returns

Precache<Float32Array>

Defined in

runtime/src/precache.ts:11


prefetchInventory()

prefetchInventory(manifest, options?): Promise<Inventory<Float32Array>>

Parameters

manifest: Manifest

options?: PrefetchInventoryOptions

Returns

Promise<Inventory<Float32Array>>

Defined in

runtime/src/prefetch.ts:16


resolveIdiom()

resolveIdiom(id, value): undefined | Embeddings<Float32Array>

Parameters

id: string

value: unknown

Returns

undefined | Embeddings<Float32Array>

Defined in

runtime/src/runtime.ts:255


resolveInventory()

resolveInventory(inventory): Promise<undefined | Inventory<Float32Array>>

Parameters

inventory: InventorySource

Returns

Promise<undefined | Inventory<Float32Array>>

Defined in

runtime/src/inventory.ts:91


resolveManifestFile()

resolveManifestFile(ts, compilerOptions, getCommonSourceDirectory, fileName): undefined | string

Parameters

ts: __module

compilerOptions: CompilerOptions

getCommonSourceDirectory

fileName: string = manifestFileName

Returns

undefined | string

Defined in

runtime/src/manifest.ts:42


resolvePlugin()

resolvePlugin(plugin): Promise<undefined | Plugin>

Parameters

plugin: PluginSource

Returns

Promise<undefined | Plugin>

Defined in

runtime/src/plugin.ts:32


resolvePlugins()

resolvePlugins(plugins): Promise<null | Plugin[]>

Parameters

plugins: undefined | null | readonly PluginSource[]

Returns

Promise<null | Plugin[]>

Defined in

runtime/src/plugin.ts:41


useTool()

useTool<T>(tool): T

Type Parameters

T extends ToolSource

Parameters

tool: T

Returns

T

Defined in

runtime/src/agent.ts:141


useTools()

useTools<T>(tools): T

Type Parameters

T extends readonly ToolSource[]

Parameters

tools: T

Returns

T

Defined in

runtime/src/agent.ts:146