ConversationProvider constructor

ConversationProvider({
  1. required BuildContext context,
  2. required void onDelete(
    1. String id
    ),
  3. required void onCreate(
    1. Conversation
    ),
  4. Conversation? conversation,
  5. void onTextResponse(
    1. ConversationProvider self
    )?,
  6. void onJsonComplete(
    1. Map<String, dynamic>
    )?,
  7. Assistant? assistant,
  8. 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();
  }
}