ConversationProvider constructor
ConversationProvider({
- required BuildContext context,
- required void onDelete(
- String id
- required void onCreate(
- Conversation
- Conversation? conversation,
- void onTextResponse(
- ConversationProvider self
- void onJsonComplete()?,
- Assistant? assistant,
- bool lazyConversationCreation = false,
lazyConversationCreation
:
Has no effect if conversation
is not null.
If true, creates a thread when the user sends the first message. Otherwise, it is created when the class is created.
Implementation
ConversationProvider({
required this.context,
required this.onDelete,
required this.onCreate,
this.conversation,
this.onTextResponse,
this.onJsonComplete,
Assistant? assistant,
bool lazyConversationCreation = false,
}) : _assistant = assistant {
if (!lazyConversationCreation) {
_createConversationIfNecessary();
}
}