Optional
onTap into an assistant message instance during a chat completion before it is added to the history.
The assistant message instance
Keep in mind that the message passed to this method is not necessarily a standard chat completion. It could be a function call too. Additionnaly, the message could be streamed or not, so message content may not yet be available when this method is called.
Optional
onTap into a function message instance.
The function message instance
Optional
onCalled when an error is thrown during a function prompt. This can be useful to clean up your plugin's state.
The error that was thrown during a function prompt
Errors thrown during this method will have no effect. This is to ensure all plugins implementing this method are called.
Optional
onTap into a message that was moderated.
The message that was moderated, with the message.flags
property populated.
Optional
onCalled after all plugins have been initialized.
This could potentially be used to interop with other plugins.
Optional
onTap into a user message instance created during prompt.
The user message instance
Optional
onCalled when an error is thrown during a user prompt. This can be useful to clean up your plugin's state.
The error that was thrown during a user prompt
Errors thrown during this method will have no effect. This is to ensure all plugins implementing this method are called.
Optional
transformTransform the ConversationCallableFunctionsModel
returned by the ConversationCallableFunctions.toJSON
method.
Note that this is the model of the ConversationCallableFunctions
class, not the CallableFunction
class.
Must return a valid ConversationCallableFunctionsModel
.
Model is validated using the conversationCallableFunctionsSchema
at the end of all transformations.
The current ConversationCallableFunctionsModel
that was generated by the library (or previous plugins)
Optional
functions?: ({ name: string; id?: string | undefined; description?: string | undefined; parameters?: { type: "object"; title?: string | undefined; description?: string | undefined; default?: any; examples?: any[] | undefined; ... 10 more ...; additionalProperties?: boolean | ... 1 more ... | undefined; } | undefined; })[]The new state of the ConversationCallableFunctionsModel
to be returned by the ConversationCallableFunctions.toJSON
method.
Optional
functions?: ({ name: string; id?: string | undefined; description?: string | undefined; parameters?: { type: "object"; title?: string | undefined; description?: string | undefined; default?: any; examples?: any[] | undefined; ... 10 more ...; additionalProperties?: boolean | ... 1 more ... | undefined; } | undefined; })[]Optional
transformTransform the ConversationConfigModel
returned by the ConversationConfig.toJSON
method.
Must return a valid ConversationConfigModel
.
Model is validated using the conversationConfigSchema
at the end of all transformations.
The current ConversationConfigModel
that was generated by the library (or previous plugins)
Optional
apiOptional
context?: stringOptional
disableOptional
dry?: booleanOptional
frequency_Optional
function_Optional
logit_Optional
max_Optional
model?: stringOptional
presence_Optional
stop?: null | string | string[]Optional
stream?: booleanOptional
temperature?: numberOptional
top_Optional
user?: stringThe new state of the ConversationConfigModel
to be returned by the ConversationConfig.toJSON
method.
Optional
apiOptional
context?: stringOptional
disableOptional
dry?: booleanOptional
frequency_Optional
function_Optional
logit_Optional
max_Optional
model?: stringOptional
presence_Optional
stop?: null | string | string[]Optional
stream?: booleanOptional
temperature?: numberOptional
top_Optional
user?: stringOptional
transformTransform the ConversationHistoryModel
returned by the ConversationHistory.toJSON
method.
Must return a valid ConversationHistoryModel
.
Model is validated using the conversationHistorySchema
at the end of all transformations.
The current ConversationHistoryModel
that was generated by the library (or previous plugins)
Optional
messages?: ({ role: "function" | "user" | "assistant" | "system"; content: string | null; id?: string | undefined; name?: string | undefined; function_call?: { name: string; arguments: Record<string, any>; } | undefined; model?: string | undefined; flags?: string[] | ... 1 more ... | undefined; })[]The new state of the ConversationHistoryModel
to be returned by the ConversationHistory.toJSON
method.
Optional
messages?: ({ role: "function" | "user" | "assistant" | "system"; content: string | null; id?: string | undefined; name?: string | undefined; function_call?: { name: string; arguments: Record<string, any>; } | undefined; model?: string | undefined; flags?: string[] | ... 1 more ... | undefined; })[]Optional
transformTransform the ConversationModel
returned by the Conversation.toJSON
method.
Must return a valid ConversationModel
.
Model is validated using the conversationSchema
at the end of all transformations.
The current ConversationModel
that was generated by the library (or previous plugins)
Optional
callableOptional
config?: { context?: string | undefined; dry?: boolean | undefined; disableModeration?: boolean | "soft" | undefined; apiKey?: string | undefined; model?: string | undefined; temperature?: number | undefined; ... 8 more ...; function_call?: "none" | ... 2 more ... | undefined; }Optional
history?: { messages?: { role: "function" | "user" | "assistant" | "system"; content: string | null; id?: string | undefined; name?: string | undefined; function_call?: { name: string; arguments: Record<...>; } | undefined; model?: string | undefined; flags?: string[] | ... 1 more ... | undefined; }[] | undefined; }Optional
id?: stringOptional
pluginsOptional
requestThe new state of the ConversationModel
to be returned by the Conversation.toJSON
method.
Optional
callableOptional
config?: { context?: string | undefined; dry?: boolean | undefined; disableModeration?: boolean | "soft" | undefined; apiKey?: string | undefined; model?: string | undefined; temperature?: number | undefined; ... 8 more ...; function_call?: "none" | ... 2 more ... | undefined; }Optional
history?: { messages?: { role: "function" | "user" | "assistant" | "system"; content: string | null; id?: string | undefined; name?: string | undefined; function_call?: { name: string; arguments: Record<...>; } | undefined; model?: string | undefined; flags?: string[] | ... 1 more ... | undefined; }[] | undefined; }Optional
id?: stringOptional
pluginsOptional
requestYou should not modify the pluginsData
property of the ConversationModel
in this method.
Use the getPluginData
method instead to prevent conflicts with other plugins.
Optional
transformTransform the ConversationRequestOptionsModel
returned by the ConversationRequestOptions.toJSON
method.
Must return a valid ConversationRequestOptionsModel
.
Model is validated using the conversationRequestOptionsSchema
at the end of all transformations.
The current ConversationRequestOptionsModel
that was generated by the library (or previous plugins)
Optional
headers?: Record<string, string>Optional
proxy?: { host: string; port?: number | undefined; protocol?: "http" | "https" | undefined; auth?: { username: string; password: string; } | undefined; }The new state of the ConversationRequestOptionsModel
to be returned by the ConversationRequestOptions.toJSON
method.
Optional
headers?: Record<string, string>Optional
proxy?: { host: string; port?: number | undefined; protocol?: "http" | "https" | undefined; auth?: { username: string; password: string; } | undefined; }Optional
transformTransform the function prompt result before it is stringified.
The result of the function generated by the client code
The new result. Keep in mind this result is later stringified (using JSON.stringify
). Your result must be serializable.
Generated using TypeDoc
The base definition of a conversation plugin without output.