generateChatPrompt abstract method

Stream<List<int>> generateChatPrompt(
  1. int contextHandle,
  2. String prompt,
  3. GenerationParams params, {
  4. required String mediaMarker,
  5. List<LlamaContentPart>? parts,
})

Generates like LlamaBackend.generate from the chat-rendered prompt.

mediaMarker stands in prompt once for each image or audio part of parts, in order, where that part was in its message. It is a random string, drawn once for the isolate, that message text does not hold. Everything else in prompt is template or message text: the backend must not rewrite a placeholder in it or read it as media.

Implementation

Stream<List<int>> generateChatPrompt(
  int contextHandle,
  String prompt,
  GenerationParams params, {
  required String mediaMarker,
  List<LlamaContentPart>? parts,
});