Skip to content

Latest commit

 

History

History
856 lines (459 loc) · 20.2 KB

History.Call.md

File metadata and controls

856 lines (459 loc) · 20.2 KB

@guardrails-ai/core / Exports / History / Call

Class: Call<T>

History.Call

Type parameters

Name
T

Implements

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Call<T>(call): Call<T>

Type parameters

Name
T

Parameters

Name Type
call ICall<T>

Returns

Call<T>

Defined in

src/history/call.ts:164

Properties

_compiledInstructions

Private Optional _compiledInstructions: string

The initial compiled instructions that were passed to the LLM on the first call.

Defined in

src/history/call.ts:77


_compiledPrompt

Private Optional _compiledPrompt: string

The initial compiled prompt that was passed to the LLM on the first call.

Defined in

src/history/call.ts:61


_completionTokensConsumed

Private Optional _completionTokensConsumed: number

Returns the total number of completion tokens consumed during all iterations with this call.

Defined in

src/history/call.ts:104


_error

Private Optional _error: string

The error message from any exception that raised and interrupted the run.

Defined in

src/history/call.ts:147


_exception

Private Optional _exception: Error

The exception that interrupted the run.

Defined in

src/history/call.ts:152


_failedValidations

Private _failedValidations: Stack<ValidatorLogs>

The validator logs for any validations that failed during the entirety of the run.

Defined in

src/history/call.ts:157


_fixedOutput

Private Optional _fixedOutput: T

The cumulative validation output across all current iterations with any automatic fixes applied.

Defined in

src/history/call.ts:125


_inputs

Private _inputs: CallInputs

The inputs as passed in to Guard.call or Guard.parse

Defined in

src/history/call.ts:46


_instructions

Private Optional _instructions: string

The instructions as provided by the user when intializing or calling the Guard.

Defined in

src/history/call.ts:72


_iterations

Private _iterations: Stack<Iteration<T>>

A stack of iterations for each step/reask that occurred during this call.

Defined in

src/history/call.ts:41


_logs

Private _logs: Stack<string>

Returns all logs from all iterations as a stack.

Defined in

src/history/call.ts:89


_parsedOutputs

Private _parsedOutputs: Stack<T>

The outputs from the LLM after undergoing parsing but before validation.

Defined in

src/history/call.ts:114


_prompt

Private Optional _prompt: string

The prompt as provided by the user when intializing or calling the Guard.

Defined in

src/history/call.ts:51


_promptParams

Private Optional _promptParams: Dictionary

The prompt parameters as provided by the user when intializing or calling the Guard.

Defined in

src/history/call.ts:56


_promptTokensConsumed

Private Optional _promptTokensConsumed: number

Returns the total number of prompt tokens consumed during all iterations with this call.

Defined in

src/history/call.ts:99


_rawOutputs

Private _rawOutputs: Stack<string>

The exact outputs from all LLM calls.

Defined in

src/history/call.ts:109


_reaskInstructions

Private _reaskInstructions: Stack<string>

The compiled instructions used during reasks. Does not include the initial instructions.

Defined in

src/history/call.ts:83


_reaskPrompts

Private _reaskPrompts: Stack<string>

The compiled prompts used during reasks. Does not include the initial prompt.

Defined in

src/history/call.ts:67


_reasks

Private _reasks: Stack<ReAsk>

Reasks generated during validation that could not be automatically fixed. These would be incorporated into the prompt for the next LLM call if additional reasks were granted.

Defined in

src/history/call.ts:137


_status

Private Optional _status: string

Returns the cumulative status of the run based on the validity of the final merged output.

Defined in

src/history/call.ts:162


_tokensConsumed

Private Optional _tokensConsumed: number

Returns the total number of tokens consumed during all iterations with this call.

Defined in

src/history/call.ts:94


_validatedOutput

Private Optional _validatedOutput: T

The output from the LLM after undergoing validation. This will only have a value if the Guard is in a passing state.

Defined in

src/history/call.ts:131


_validationOutput

Private Optional _validationOutput: ReAsk | T

The cumulative validation output across all current iterations. Could contain ReAsks.

Defined in

src/history/call.ts:120


_validatorLogs

Private _validatorLogs: Stack<ValidatorLogs>

The results of each individual validation performed on the LLM responses during all iterations.

Defined in

src/history/call.ts:142

Accessors

compiledInstructions

get compiledInstructions(): undefined | string

Returns

undefined | string

Implementation of

ICall.compiledInstructions

Defined in

src/history/call.ts:359


compiledPrompt

get compiledPrompt(): undefined | string

Returns

undefined | string

Implementation of

ICall.compiledPrompt

Defined in

src/history/call.ts:350


completionTokensConsumed

get completionTokensConsumed(): undefined | number

Returns

undefined | number

Implementation of

ICall.completionTokensConsumed

Defined in

src/history/call.ts:374


error

get error(): undefined | string

Returns

undefined | string

Implementation of

ICall.error

Defined in

src/history/call.ts:398


exception

get exception(): undefined | Error

Returns

undefined | Error

Implementation of

ICall.exception

Defined in

src/history/call.ts:401


failedValidations

get failedValidations(): Stack<ValidatorLogs>

Returns

Stack<ValidatorLogs>

Implementation of

ICall.failedValidations

Defined in

src/history/call.ts:404


fixedOutput

get fixedOutput(): undefined | T

Returns

undefined | T

Implementation of

ICall.fixedOutput

Defined in

src/history/call.ts:386


inputs

get inputs(): CallInputs

Returns

CallInputs

Implementation of

ICall.inputs

Defined in

src/history/call.ts:341


instructions

get instructions(): undefined | string

Returns

undefined | string

Implementation of

ICall.instructions

Defined in

src/history/call.ts:356


iterations

get iterations(): Stack<Iteration<T>>

Returns

Stack<Iteration<T>>

Implementation of

ICall.iterations

Defined in

src/history/call.ts:338


logs

get logs(): Stack<string>

Returns

Stack<string>

Implementation of

ICall.logs

Defined in

src/history/call.ts:365


parsedOutputs

get parsedOutputs(): Stack<T>

Returns

Stack<T>

Implementation of

ICall.parsedOutputs

Defined in

src/history/call.ts:380


prompt

get prompt(): undefined | string

Returns

undefined | string

Implementation of

ICall.prompt

Defined in

src/history/call.ts:344


promptParams

get promptParams(): undefined | Dictionary

Returns

undefined | Dictionary

Implementation of

ICall.promptParams

Defined in

src/history/call.ts:347


promptTokensConsumed

get promptTokensConsumed(): undefined | number

Returns

undefined | number

Implementation of

ICall.promptTokensConsumed

Defined in

src/history/call.ts:371


rawOutputs

get rawOutputs(): Stack<string>

Returns

Stack<string>

Implementation of

ICall.rawOutputs

Defined in

src/history/call.ts:377


reaskInstructions

get reaskInstructions(): Stack<string>

Returns

Stack<string>

Implementation of

ICall.reaskInstructions

Defined in

src/history/call.ts:362


reaskPrompts

get reaskPrompts(): Stack<string>

Returns

Stack<string>

Implementation of

ICall.reaskPrompts

Defined in

src/history/call.ts:353


reasks

get reasks(): Stack<ReAsk>

Returns

Stack<ReAsk>

Implementation of

ICall.reasks

Defined in

src/history/call.ts:392


status

get status(): undefined | string

Returns

undefined | string

Implementation of

ICall.status

Defined in

src/history/call.ts:407


tokensConsumed

get tokensConsumed(): undefined | number

Returns

undefined | number

Implementation of

ICall.tokensConsumed

Defined in

src/history/call.ts:368


validatedOutput

get validatedOutput(): undefined | T

Returns

undefined | T

Implementation of

ICall.validatedOutput

Defined in

src/history/call.ts:389


validationOutput

get validationOutput(): undefined | ReAsk | T

Returns

undefined | ReAsk | T

Implementation of

ICall.validationOutput

Defined in

src/history/call.ts:383


validatorLogs

get validatorLogs(): Stack<ValidatorLogs>

Returns

Stack<ValidatorLogs>

Implementation of

ICall.validatorLogs

Defined in

src/history/call.ts:395

Methods

fromPyCall

fromPyCall<U>(pyCall): Promise<Call<U>>

Type parameters

Name
U

Parameters

Name Type
pyCall any

Returns

Promise<Call<U>>

Defined in

src/history/call.ts:220