Skip to content

Class: Llama3_1ChatWrapper

Defined in: chatWrappers/Llama3_1ChatWrapper.ts:12

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

Defined in: chatWrappers/Llama3_1ChatWrapper.ts:40

Parameters

ParameterTypeDescription
options{ cuttingKnowledgeDate: | null | string | number | Date | () => Date; todayDate: | null | string | number | Date | () => Date; noToolInstructions: boolean; }
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

Properties

defaultSettings

ts
static defaultSettings: ChatWrapperSettings;

Defined in: ChatWrapper.ts:11

Inherited from

ChatWrapper.defaultSettings


wrapperName

ts
readonly wrapperName: string = "Llama 3.1";

Defined in: chatWrappers/Llama3_1ChatWrapper.ts:13

Overrides

ChatWrapper.wrapperName


cuttingKnowledgeDate?

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

Defined in: chatWrappers/Llama3_1ChatWrapper.ts:15


todayDate

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

Defined in: chatWrappers/Llama3_1ChatWrapper.ts:16


noToolInstructions

ts
readonly noToolInstructions: boolean;

Defined in: chatWrappers/Llama3_1ChatWrapper.ts:17


settings

ts
readonly settings: ChatWrapperSettings;

Defined in: chatWrappers/Llama3_1ChatWrapper.ts:21

Overrides

ChatWrapper.settings

Methods

generateFunctionCallsAndResults()

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

Defined in: ChatWrapper.ts:55

Parameters

ParameterTypeDefault value
functionCallsChatModelFunctionCall[]undefined
useRawCallbooleantrue

Returns

LlamaText

Inherited from

ChatWrapper.generateFunctionCallsAndResults


generateFunctionCall()

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

Defined in: ChatWrapper.ts:102

Parameters

ParameterType
namestring
paramsany

Returns

LlamaText

Inherited from

ChatWrapper.generateFunctionCall


generateFunctionCallResult()

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

Defined in: ChatWrapper.ts:116

Parameters

ParameterType
functionNamestring
functionParamsany
resultany

Returns

LlamaText

Inherited from

ChatWrapper.generateFunctionCallResult


generateModelResponseText()

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

Defined in: ChatWrapper.ts:140

Parameters

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

Returns

LlamaText

Inherited from

ChatWrapper.generateModelResponseText


generateInitialChatHistory()

ts
generateInitialChatHistory(__namedParameters: ChatWrapperGenerateInitialHistoryOptions): ChatHistoryItem[]

Defined in: ChatWrapper.ts:217

Parameters

ParameterType
__namedParametersChatWrapperGenerateInitialHistoryOptions

Returns

ChatHistoryItem[]

Inherited from

ChatWrapper.generateInitialChatHistory


addAvailableFunctionsSystemMessageToHistory()

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

Defined in: chatWrappers/Llama3_1ChatWrapper.ts:85

Parameters

ParameterType
historyreadonly ChatHistoryItem[]
availableFunctions?ChatModelFunctions
__namedParameters?{ documentParams: boolean; }
__namedParameters.documentParams?boolean

Returns

readonly ChatHistoryItem[]

Overrides

ChatWrapper.addAvailableFunctionsSystemMessageToHistory


generateContextState()

ts
generateContextState(__namedParameters: ChatWrapperGenerateContextStateOptions): ChatWrapperGeneratedContextState

Defined in: chatWrappers/Llama3_1ChatWrapper.ts:116

Parameters

ParameterType
__namedParametersChatWrapperGenerateContextStateOptions

Returns

ChatWrapperGeneratedContextState

Overrides

ChatWrapper.generateContextState


generateAvailableFunctionsSystemText()

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

Defined in: chatWrappers/Llama3_1ChatWrapper.ts:239

Parameters

ParameterType
availableFunctionsChatModelFunctions
__namedParameters{ documentParams: boolean; }
__namedParameters.documentParams?boolean

Returns

LlamaText

Overrides

ChatWrapper.generateAvailableFunctionsSystemText


prependPreambleToChatHistory()

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

Defined in: chatWrappers/Llama3_1ChatWrapper.ts:278

Parameters

ParameterType
chatHistoryreadonly ChatHistoryItem[]

Returns

readonly ChatHistoryItem[]