# Class RWSConvo<LLMChat>

#### Type Parameters

- #### LLMChat extends Runnable<BaseLanguageModelInput, BaseMessage, RunnableConfig>

- Defined in src/models/convo/ConvoLoader.ts:64

#####
Index

### Constructors

constructor

### Properties

_baseSplitterParams
_initiated
chatConstructor
convo_id
docSplitter
docs
embeddings
llmChain
llmChat
loader
store
thePrompt

### Methods

avgDocLength
call
callStream
callStreamGenerator
chain
createChain
debugCall
debugConvoFile
debugSave
debugSplitFile
getChat
getDocs
getId
getStore
initDebugFile
isInitiated
parseXML
setPrompt
similaritySearch
splitDocs
waitForInit
debugConvoDir
debugSplitDir
uuid

## Constructors

### constructor

- new RWSConvo<LLMChat>(chatConstructor, embeddings, convoId?, baseSplitterParams?): RWSConvo<LLMChat>

- #### Type Parameters

  - #### LLMChat extends Runnable<BaseLanguageModelInput, BaseMessage, RunnableConfig>

  #### Parameters

  - ##### chatConstructor: (new (config) => LLMChat)

    - - new (config): LLMChat

      - #### Parameters

        - ##### config: any

        #### Returns LLMChat

  - ##### embeddings: IEmbeddingsHandler<any>

  - ##### convoId: string = null

  - ##### baseSplitterParams: ISplitterParams = ...

  #### Returns RWSConvo<LLMChat>

  - Defined in src/models/convo/ConvoLoader.ts:81

## Properties

### _baseSplitterParams

_baseSplitterParams: ISplitterParams

- Defined in src/models/convo/ConvoLoader.ts:79

### `Private` _initiated

_initiated: boolean = false

- Defined in src/models/convo/ConvoLoader.ts:71

### `Private` chatConstructor

chatConstructor: (new (config) => LLMChat)

#### Type declaration

- - new (config): LLMChat

  - #### Parameters

    - ##### config: any

    #### Returns LLMChat

- Defined in src/models/convo/ConvoLoader.ts:76

### `Private` convo_id

convo_id: string

- Defined in src/models/convo/ConvoLoader.ts:73

### `Private` docSplitter

docSplitter: RecursiveCharacterTextSplitter

- Defined in src/models/convo/ConvoLoader.ts:66

### `Private` docs

docs: Document<Record<string, any>>[] = []

- Defined in src/models/convo/ConvoLoader.ts:70

### `Private` embeddings

embeddings: IEmbeddingsHandler<any>

- Defined in src/models/convo/ConvoLoader.ts:68

### `Private` llmChain

llmChain: BaseChain<ChainValues, ChainValues>

- Defined in src/models/convo/ConvoLoader.ts:74

### `Private` llmChat

llmChat: LLMChat

- Defined in src/models/convo/ConvoLoader.ts:75

### `Private` loader

loader: TextLoader

- Defined in src/models/convo/ConvoLoader.ts:65

### `Private` store

store: RWSVectorStore

- Defined in src/models/convo/ConvoLoader.ts:72

### `Private` thePrompt

thePrompt: RWSPrompt

- Defined in src/models/convo/ConvoLoader.ts:77

## Methods

### `Private` avgDocLength

- avgDocLength(documents): number

- #### Parameters

  - ##### documents: Document<Record<string, any>>[]

  #### Returns number

  - Defined in src/models/convo/ConvoLoader.ts:193

### call

- call(values, cfg, debugCallback?): Promise<RWSPrompt>

- #### Parameters

  - ##### values: ChainValues

  - ##### cfg: Partial<RunnableConfig>

  - ##### debugCallback: ((debugData) => Promise<IConvoDebugXMLData>) = null

    - - (debugData): Promise<IConvoDebugXMLData>

      - #### Parameters

        - ##### debugData: IConvoDebugXMLData

        #### Returns Promise<IConvoDebugXMLData>

  #### Returns Promise<RWSPrompt>

  - Defined in src/models/convo/ConvoLoader.ts:197

### callStream

- callStream(values, callback, end?, cfg?, debugCallback?): Promise<RWSPrompt>

- #### Parameters

  - ##### values: ChainValues

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

    - - (streamChunk): void

      - #### Parameters

        - ##### streamChunk: ILLMChunk

        #### Returns void

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

    - - (): void

      - #### Returns void

  - ##### cfg: Partial<RunnableConfig> = {}

  - ##### `Optional` debugCallback: ((debugData) => Promise<IConvoDebugXMLData>)

    - - (debugData): Promise<IConvoDebugXMLData>

      - #### Parameters

        - ##### debugData: IConvoDebugXMLData

        #### Returns Promise<IConvoDebugXMLData>

  #### Returns Promise<RWSPrompt>

  - Defined in src/models/convo/ConvoLoader.ts:234

### callStreamGenerator

- callStreamGenerator(this, values, cfg, debugCallback?): AsyncGenerator<string, any, unknown>

- #### Parameters

  - ##### this: RWSConvo<LLMChat>

  - ##### values: ChainValues

  - ##### cfg: Partial<RunnableConfig>

  - ##### debugCallback: ((debugData) => Promise<IConvoDebugXMLData>) = null

    - - (debugData): Promise<IConvoDebugXMLData>

      - #### Parameters

        - ##### debugData: IConvoDebugXMLData

        #### Returns Promise<IConvoDebugXMLData>

  #### Returns AsyncGenerator<string, any, unknown>

  - Defined in src/models/convo/ConvoLoader.ts:207

### chain

- chain(): BaseChain<ChainValues, ChainValues>

- #### Returns BaseChain<ChainValues, ChainValues>

  - Defined in src/models/convo/ConvoLoader.ts:285

### `Private` createChain

- createChain(input): Promise<BaseChain<ChainValues, ChainValues>>

- #### Parameters

  - ##### input: {
    prompt: PromptTemplate<any, any>;
    values?: ChainValues;
    }

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

    - ##### `Optional` values?: ChainValues

  #### Returns Promise<BaseChain<ChainValues, ChainValues>>

  - Defined in src/models/convo/ConvoLoader.ts:304

### `Private` debugCall

- debugCall(debugCallback?): Promise<void>

- #### Parameters

  - ##### debugCallback: ((debugData) => Promise<IConvoDebugXMLData>) = null

    - - (debugData): Promise<IConvoDebugXMLData>

      - #### Parameters

        - ##### debugData: IConvoDebugXMLData

        #### Returns Promise<IConvoDebugXMLData>

  #### Returns Promise<void>

  - Defined in src/models/convo/ConvoLoader.ts:265

### debugConvoFile

- debugConvoFile(): string

- #### Returns string

  - Defined in src/models/convo/ConvoLoader.ts:352

### `Private` debugSave

- debugSave(xml): void

- #### Parameters

  - ##### xml: IConvoDebugXMLData

  #### Returns void

  - Defined in src/models/convo/ConvoLoader.ts:392

### debugSplitFile

- debugSplitFile(i): string

- #### Parameters

  - ##### i: number

  #### Returns string

  - Defined in src/models/convo/ConvoLoader.ts:356

### getChat

- getChat(): LLMChat

- #### Returns LLMChat

  - Defined in src/models/convo/ConvoLoader.ts:188

### getDocs

- getDocs(): VectorDocType

- #### Returns VectorDocType

  - Defined in src/models/convo/ConvoLoader.ts:151

### getId

- getId(): string

- #### Returns string

  - Defined in src/models/convo/ConvoLoader.ts:147

### getStore

- getStore(): RWSVectorStore

- #### Returns RWSVectorStore

  - Defined in src/models/convo/ConvoLoader.ts:155

### `Private` initDebugFile

- initDebugFile(): IConvoDebugXMLOutput

- #### Returns IConvoDebugXMLOutput

  - Defined in src/models/convo/ConvoLoader.ts:360

### isInitiated

- isInitiated(): boolean

- #### Returns boolean

  - Defined in src/models/convo/ConvoLoader.ts:160

### `Private` parseXML

- parseXML(xml, callback): Parser

- #### Parameters

  - ##### xml: string

  - ##### callback: ((err, result) => void)

    - - (err, result): void

      - #### Parameters

        - ##### err: Error

        - ##### result: any

        #### Returns void

  #### Returns Parser

  - Defined in src/models/convo/ConvoLoader.ts:336

### setPrompt

- setPrompt(prompt): RWSConvo<LLMChat>

- #### Parameters

  - ##### prompt: RWSPrompt

  #### Returns RWSConvo<LLMChat>

  - Defined in src/models/convo/ConvoLoader.ts:165

### similaritySearch

- similaritySearch(query, splitCount): Promise<string>

- #### Parameters

  - ##### query: string

  - ##### splitCount: number

  #### Returns Promise<string>

  - Defined in src/models/convo/ConvoLoader.ts:257

### splitDocs

- splitDocs(filePath, params): Promise<void>

- #### Parameters

  - ##### filePath: string

  - ##### params: ISplitterParams

  #### Returns Promise<void>

  - Defined in src/models/convo/ConvoLoader.ts:102

### waitForInit

- waitForInit(): Promise<RWSConvo<LLMChat>>

- #### Returns Promise<RWSConvo<LLMChat>>

  - Defined in src/models/convo/ConvoLoader.ts:314

### `Static` debugConvoDir

- debugConvoDir(id): string

- #### Parameters

  - ##### id: string

  #### Returns string

  - Defined in src/models/convo/ConvoLoader.ts:344

### `Static` debugSplitDir

- debugSplitDir(id): string

- #### Parameters

  - ##### id: string

  #### Returns string

  - Defined in src/models/convo/ConvoLoader.ts:348

### `Static` uuid

- uuid(): string

- #### Returns string

  - Defined in src/models/convo/ConvoLoader.ts:96

Generated using TypeDoc