Skip to content

Class: Llama3_1ChatWrapper

Extends

Constructors

new Llama3_1ChatWrapper()

ts
new Llama3_1ChatWrapper(options: {
  cuttingKnowledgeDate:   | null
     | string
     | number
     | Date
     | () => Date;
  todayDate:   | null
     | string
     | number
     | Date
     | () => Date;
  noToolInstructions: boolean;
 }): Llama3_1ChatWrapper

Parameters

ParameterTypeDescription
optionsobject
options.cuttingKnowledgeDate?| null | string | number | Date | () => DateSet to null to disable Defaults to December 2023
options.todayDate?| null | string | number | Date | () => DateSet to null to disable Defaults to current date
options.noToolInstructions?boolean-

Returns

Llama3_1ChatWrapper

Overrides

ChatWrapper.constructor

Defined in

chatWrappers/Llama3_1ChatWrapper.ts:39

Properties

defaultSettings

ts
static defaultSettings: ChatWrapperSettings;

Inherited from

ChatWrapper.defaultSettings

Defined in

ChatWrapper.ts:11


wrapperName

ts
readonly wrapperName: string = "Llama 3.1";

Overrides

ChatWrapper.wrapperName

Defined in

chatWrappers/Llama3_1ChatWrapper.ts:12


cuttingKnowledgeDate?

ts
readonly optional cuttingKnowledgeDate: null | Date | () => Date;

Defined in

chatWrappers/Llama3_1ChatWrapper.ts:14


todayDate

ts
readonly todayDate: null | Date | () => Date;

Defined in

chatWrappers/Llama3_1ChatWrapper.ts:15


noToolInstructions

ts
readonly noToolInstructions: boolean;

Defined in

chatWrappers/Llama3_1ChatWrapper.ts:16


settings

ts
readonly settings: ChatWrapperSettings;

Overrides

ChatWrapper.settings

Defined in

chatWrappers/Llama3_1ChatWrapper.ts:20

Methods

generateFunctionCallsAndResults()

ts
generateFunctionCallsAndResults(functionCalls: ChatModelFunctionCall[], useRawCall: boolean): LlamaText

Parameters

ParameterTypeDefault value
functionCallsChatModelFunctionCall[]undefined
useRawCallbooleantrue

Returns

LlamaText

Inherited from

ChatWrapper.generateFunctionCallsAndResults

Defined in

ChatWrapper.ts:55


generateFunctionCall()

ts
generateFunctionCall(name: string, params: any): LlamaText

Parameters

ParameterType
namestring
paramsany

Returns

LlamaText

Inherited from

ChatWrapper.generateFunctionCall

Defined in

ChatWrapper.ts:102


generateFunctionCallResult()

ts
generateFunctionCallResult(
   functionName: string, 
   functionParams: any, 
   result: any): LlamaText

Parameters

ParameterType
functionNamestring
functionParamsany
resultany

Returns

LlamaText

Inherited from

ChatWrapper.generateFunctionCallResult

Defined in

ChatWrapper.ts:116


generateModelResponseText()

ts
generateModelResponseText(modelResponse: (string | ChatModelFunctionCall)[], useRawCall: boolean): LlamaText

Parameters

ParameterTypeDefault value
modelResponse(string | ChatModelFunctionCall)[]undefined
useRawCallbooleantrue

Returns

LlamaText

Inherited from

ChatWrapper.generateModelResponseText

Defined in

ChatWrapper.ts:140


generateInitialChatHistory()

ts
generateInitialChatHistory(__namedParameters: ChatWrapperGenerateInitialHistoryOptions): ChatHistoryItem[]

Parameters

ParameterType
__namedParametersChatWrapperGenerateInitialHistoryOptions

Returns

ChatHistoryItem[]

Inherited from

ChatWrapper.generateInitialChatHistory

Defined in

ChatWrapper.ts:217


addAvailableFunctionsSystemMessageToHistory()

ts
addAvailableFunctionsSystemMessageToHistory(
   history: readonly ChatHistoryItem[], 
   availableFunctions?: ChatModelFunctions, 
   __namedParameters?: {
  documentParams: true;
 }): readonly ChatHistoryItem[]

Parameters

ParameterType
historyreadonly ChatHistoryItem[]
availableFunctions?ChatModelFunctions
__namedParameters?object
__namedParameters.documentParams?boolean

Returns

readonly ChatHistoryItem[]

Overrides

ChatWrapper.addAvailableFunctionsSystemMessageToHistory

Defined in

chatWrappers/Llama3_1ChatWrapper.ts:84


generateContextState()

ts
generateContextState(__namedParameters: ChatWrapperGenerateContextStateOptions): ChatWrapperGeneratedContextState

Parameters

ParameterType
__namedParametersChatWrapperGenerateContextStateOptions

Returns

ChatWrapperGeneratedContextState

Overrides

ChatWrapper.generateContextState

Defined in

chatWrappers/Llama3_1ChatWrapper.ts:115


generateAvailableFunctionsSystemText()

ts
generateAvailableFunctionsSystemText(availableFunctions: ChatModelFunctions, __namedParameters: {
  documentParams: true;
 }): LlamaText

Parameters

ParameterType
availableFunctionsChatModelFunctions
__namedParametersobject
__namedParameters.documentParams?boolean

Returns

LlamaText

Overrides

ChatWrapper.generateAvailableFunctionsSystemText

Defined in

chatWrappers/Llama3_1ChatWrapper.ts:238


prependPreambleToChatHistory()

ts
prependPreambleToChatHistory(chatHistory: readonly ChatHistoryItem[]): readonly ChatHistoryItem[]

Parameters

ParameterType
chatHistoryreadonly ChatHistoryItem[]

Returns

readonly ChatHistoryItem[]

Defined in

chatWrappers/Llama3_1ChatWrapper.ts:277