Skip to content

AxRAG

Class: AxRAG

Extends

Constructors

new AxRAG()

new AxRAG(ai, queryFn, options): AxRAG

Parameters

ai: AxAIService

queryFn

options: Readonly<AxGenerateOptions & object>

Returns

AxRAG

Overrides

AxChainOfThought.constructor

Defined in

src/ax/prompts/rag.ts:23

Properties

demos?

protected optional demos: Record<string, AxFieldValue>[]

Inherited from

AxChainOfThought.demos

Defined in

src/ax/dsp/program.ts:81


examples?

protected optional examples: Record<string, AxFieldValue>[]

Inherited from

AxChainOfThought.examples

Defined in

src/ax/dsp/program.ts:80


sigHash

protected sigHash: string

Inherited from

AxChainOfThought.sigHash

Defined in

src/ax/dsp/program.ts:78


signature

protected signature: AxSignature

Inherited from

AxChainOfThought.signature

Defined in

src/ax/dsp/program.ts:77


trace?

protected optional trace: Record<string, AxFieldValue>

Inherited from

AxChainOfThought.trace

Defined in

src/ax/dsp/program.ts:82


usage

protected usage: AxTokenUsage & object[] = []

Inherited from

AxChainOfThought.usage

Defined in

src/ax/dsp/program.ts:83

Methods

addAssert()

addAssert(fn, message?, optional?): void

Parameters

fn

message?: string

optional?: boolean

Returns

void

Inherited from

AxChainOfThought.addAssert

Defined in

src/ax/dsp/generate.ts:135


addStreamingAssert()

addStreamingAssert(fieldName, fn, message?, optional?): void

Parameters

fieldName: string

fn

message?: string

optional?: boolean

Returns

void

Inherited from

AxChainOfThought.addStreamingAssert

Defined in

src/ax/dsp/generate.ts:143


forward()

forward(__namedParameters, options?): Promise<object>

Parameters

__namedParameters: Readonly<object>

options?: Readonly<AxProgramForwardOptions>

Returns

Promise<object>

answer

answer: string

reason

reason: string

Overrides

AxChainOfThought.forward

Defined in

src/ax/prompts/rag.ts:45


getSignature()

getSignature(): AxSignature

Returns

AxSignature

Inherited from

AxChainOfThought.getSignature

Defined in

src/ax/dsp/program.ts:95


getTraces()

getTraces(): AxProgramTrace[]

Returns

AxProgramTrace[]

Inherited from

AxChainOfThought.getTraces

Defined in

src/ax/dsp/program.ts:169


getUsage()

getUsage(): AxTokenUsage & object[]

Returns

AxTokenUsage & object[]

Inherited from

AxChainOfThought.getUsage

Defined in

src/ax/dsp/program.ts:183


processFunctions()

processFunctions(functionCalls, mem, sessionId?, traceId?): Promise<void>

Parameters

functionCalls: readonly AxChatResponseFunctionCall[]

mem: Readonly<AxMemory>

sessionId?: string

traceId?: string

Returns

Promise<void>

Inherited from

AxChainOfThought.processFunctions

Defined in

src/ax/dsp/generate.ts:471


register()

register(prog): void

Parameters

prog: Readonly<AxTunable & AxUsable>

Returns

void

Inherited from

AxChainOfThought.register

Defined in

src/ax/dsp/program.ts:99


resetUsage()

resetUsage(): void

Returns

void

Inherited from

AxChainOfThought.resetUsage

Defined in

src/ax/dsp/program.ts:193


setDemos()

setDemos(demos): void

Parameters

demos: readonly AxProgramDemos[]

Returns

void

Inherited from

AxChainOfThought.setDemos

Defined in

src/ax/dsp/program.ts:200


setExamples()

setExamples(examples): void

Parameters

examples: Readonly<AxProgramExamples>

Returns

void

Inherited from

AxChainOfThought.setExamples

Defined in

src/ax/dsp/program.ts:128


setId()

setId(id): void

Parameters

id: string

Returns

void

Inherited from

AxChainOfThought.setId

Defined in

src/ax/dsp/program.ts:115


setParentId()

setParentId(parentId): void

Parameters

parentId: string

Returns

void

Inherited from

AxChainOfThought.setParentId

Defined in

src/ax/dsp/program.ts:122