# Class RWSPrompt

- Defined in src/models/prompts/_prompt.ts:74

#####
Index

### Constructors

constructor

### Properties

_stream
convo
created_at
enhancedInput
hyperParameters
input
modelId
modelType
multiTemplate
originalInput
output
sentInput
varStorage

### Methods

_oldreadStream
addEnchantment
addHistory
getConvo
getEnchantedInput
getHyperParameter
getHyperParameters
getModelId
getModelMetadata
getMultiTemplate
getVar
injestOutput
isChainStreamType
listen
onStream
readBaseInput
readInput
readOutput
readSentInput
readStreamAsText
replacePromptVar
requestWith
setBaseInput
setConvo
setHyperParameter
setHyperParameters
setInput
setMultiTemplate
setStreamCallback
setVar
singleRequestWith
streamWith
toJSON

## Constructors

### constructor

- new RWSPrompt(params): RWSPrompt

- #### Parameters

  - ##### params: IPromptParams

  #### Returns RWSPrompt

  - Defined in src/models/prompts/_prompt.ts:94

## Properties

### _stream

_stream: ChainStreamType

- Defined in src/models/prompts/_prompt.ts:75

### `Private` convo

convo: RWSConvo<any>

- Defined in src/models/prompts/_prompt.ts:84

### `Private` created_at

created_at: Date

- Defined in src/models/prompts/_prompt.ts:86

### `Private` enhancedInput

enhancedInput: IPromptEnchantment[]

- Defined in src/models/prompts/_prompt.ts:77

### `Private` hyperParameters

hyperParameters: IPromptHyperParameters

- Defined in src/models/prompts/_prompt.ts:85

### `Private` input

input: string = ''

- Defined in src/models/prompts/_prompt.ts:76

### `Private` modelId

modelId: string

- Defined in src/models/prompts/_prompt.ts:81

### `Private` modelType

modelType: string

- Defined in src/models/prompts/_prompt.ts:82

### `Private` multiTemplate

multiTemplate: PromptTemplate<any, any>

- Defined in src/models/prompts/_prompt.ts:83

### `Private` originalInput

originalInput: string = ''

- Defined in src/models/prompts/_prompt.ts:79

### `Private` output

output: string = ''

- Defined in src/models/prompts/_prompt.ts:80

### `Private` sentInput

sentInput: string = ''

- Defined in src/models/prompts/_prompt.ts:78

### `Private` varStorage

varStorage: any = {}

- Defined in src/models/prompts/_prompt.ts:88

## Methods

### _oldreadStream

- _oldreadStream(stream, react): Promise<void>

- #### Parameters

  - ##### stream: Readable

  - ##### react: ((chunk) => void)

    - - (chunk): void

      - #### Parameters

        - ##### chunk: string

        #### Returns void

  #### Returns Promise<void>

  - Defined in src/models/prompts/_prompt.ts:275

### addEnchantment

- addEnchantment(enchantment): void

- #### Parameters

  - ##### enchantment: IPromptEnchantment

  #### Returns void

  - Defined in src/models/prompts/_prompt.ts:123

### addHistory

- addHistory(messages, historyPrompt, callback?): void

- #### Parameters

  - ##### messages: IRWSHistoryMessage[]

  - ##### historyPrompt: string

  - ##### `Optional` callback: ((messages, prompt) => void)

    - - (messages, prompt): void

      - #### Parameters

        - ##### messages: IRWSHistoryMessage[]

        - ##### prompt: string

        #### Returns void

  - Defined in src/models/prompts/_prompt.ts:338

### getConvo

- getConvo<T>(): RWSConvo<T>

- #### Type Parameters

  - #### T extends SimpleChatModel<BaseLanguageModelCallOptions>

  #### Returns RWSConvo<T>

  - Defined in src/models/prompts/_prompt.ts:224

### getEnchantedInput

- getEnchantedInput(): string

- #### Returns string

  - Defined in src/models/prompts/_prompt.ts:129

### getHyperParameter

- getHyperParameter<T>(key): T

- #### Type Parameters

  - #### T

  #### Parameters

  - ##### key: keyof IPromptHyperParameters

  #### Returns T

  - Defined in src/models/prompts/_prompt.ts:183

### getHyperParameters

- getHyperParameters<T>(base?): T

- #### Type Parameters

  - #### T extends IPromptHyperParameters

  #### Parameters

  - ##### base: any = null

  #### Returns T

  - Defined in src/models/prompts/_prompt.ts:174

### getModelId

- getModelId(): string

- #### Returns string

  - Defined in src/models/prompts/_prompt.ts:134

### getModelMetadata

- getModelMetadata(): [string, string]

- #### Returns [string, string]

  - Defined in src/models/prompts/_prompt.ts:234

### getMultiTemplate

- getMultiTemplate(): PromptTemplate<any, any>

- #### Returns PromptTemplate<any, any>

  - Defined in src/models/prompts/_prompt.ts:212

### getVar

- getVar<T>(key): T

- #### Type Parameters

  - #### T

  #### Parameters

  - ##### key: string

  #### Returns T

  - Defined in src/models/prompts/_prompt.ts:264

### injestOutput

- injestOutput(content): RWSPrompt

- #### Parameters

  - ##### content: string

  #### Returns RWSPrompt

  - Defined in src/models/prompts/_prompt.ts:162

### `Private` isChainStreamType

- isChainStreamType(source): Promise<boolean>

- #### Parameters

  - ##### source: any

  #### Returns Promise<boolean>

  - Defined in src/models/prompts/_prompt.ts:304

### listen

- listen(source, stream?): RWSPrompt

- #### Parameters

  - ##### source: string

  - ##### stream: boolean = true

  #### Returns RWSPrompt

  - Defined in src/models/prompts/_prompt.ts:104

### `Private` onStream

- onStream(chunk): void

- #### Parameters

  - ##### chunk: string

  #### Returns void

  - Defined in src/models/prompts/_prompt.ts:90

### readBaseInput

- readBaseInput(): string

- #### Returns string

  - Defined in src/models/prompts/_prompt.ts:150

### readInput

- readInput(): string

- #### Returns string

  - Defined in src/models/prompts/_prompt.ts:144

### readOutput

- readOutput(): string

- #### Returns string

  - Defined in src/models/prompts/_prompt.ts:169

### readSentInput

- readSentInput(): string

- #### Returns string

  - Defined in src/models/prompts/_prompt.ts:139

### readStreamAsText

- readStreamAsText(readableStream, callback): Promise<void>

- #### Parameters

  - ##### readableStream: ReadableStream<any>

  - ##### callback: ((txt) => void)

    - - (txt): void

      - #### Parameters

        - ##### txt: string

        #### Returns void

  #### Returns Promise<void>

  - Defined in src/models/prompts/_prompt.ts:322

### replacePromptVar

- replacePromptVar(key, val): void

- #### Parameters

  - ##### key: string

  - ##### val: string

  #### Returns void

  - Defined in src/models/prompts/_prompt.ts:229

### requestWith

- requestWith(executor, intruderPrompt?, debugVars?): Promise<void>

- #### Parameters

  - ##### executor: IRWSPromptRequestExecutor

  - ##### intruderPrompt: string = null

  - ##### debugVars: any = {}

  #### Returns Promise<void>

  - Defined in src/models/prompts/_prompt.ts:239

### setBaseInput

- setBaseInput(input): RWSPrompt

- #### Parameters

  - ##### input: string

  #### Returns RWSPrompt

  - Defined in src/models/prompts/_prompt.ts:155

### setConvo

- setConvo(convo): RWSPrompt

- #### Parameters

  - ##### convo: RWSConvo<SimpleChatModel<BaseLanguageModelCallOptions>>

  #### Returns RWSPrompt

  - Defined in src/models/prompts/_prompt.ts:217

### setHyperParameter

- setHyperParameter(key, value): RWSPrompt

- #### Parameters

  - ##### key: string

  - ##### value: any

  #### Returns RWSPrompt

  - Defined in src/models/prompts/_prompt.ts:192

### setHyperParameters

- setHyperParameters(value): RWSPrompt

- #### Parameters

  - ##### value: any

  #### Returns RWSPrompt

  - Defined in src/models/prompts/_prompt.ts:199

### setInput

- setInput(content): RWSPrompt

- #### Parameters

  - ##### content: string

  #### Returns RWSPrompt

  - Defined in src/models/prompts/_prompt.ts:258

### setMultiTemplate

- setMultiTemplate(template): RWSPrompt

- #### Parameters

  - ##### template: PromptTemplate<any, any>

  #### Returns RWSPrompt

  - Defined in src/models/prompts/_prompt.ts:206

### setStreamCallback

- setStreamCallback(callback): void

- #### Parameters

  - ##### callback: ((chunk) => void)

    - - (chunk): void

      - #### Parameters

        - ##### chunk: string

        #### Returns void

  - Defined in src/models/prompts/_prompt.ts:118

### setVar

- setVar<T>(key, val): RWSPrompt

- #### Type Parameters

  - #### T

  #### Parameters

  - ##### key: string

  - ##### val: T

  #### Returns RWSPrompt

  - Defined in src/models/prompts/_prompt.ts:269

### singleRequestWith

- singleRequestWith(executor, intruderPrompt?, ensureJson?): Promise<void>

- #### Parameters

  - ##### executor: IRWSSinglePromptRequestExecutor

  - ##### intruderPrompt: string = null

  - ##### ensureJson: boolean = false

  #### Returns Promise<void>

  - Defined in src/models/prompts/_prompt.ts:246

### streamWith

- streamWith(executor, read, end?, debugVars?): Promise<RWSPrompt>

- #### Parameters

  - ##### executor: IRWSPromptStreamExecutor

  - ##### read: ((chunk) => void)

    - - (chunk): void

      - #### Parameters

        - ##### chunk: ILLMChunk

        #### Returns void

  - ##### end: (() => void) = ...

    - - (): void

      - #### Returns void

  - ##### debugVars: any = {}

  #### Returns Promise<RWSPrompt>

  - Defined in src/models/prompts/_prompt.ts:252

### toJSON

- toJSON(): IRWSPromptJSON

- #### Returns IRWSPromptJSON

  - Defined in src/models/prompts/_prompt.ts:353

Generated using TypeDoc