Skip to content

Should the prefix defined in prefix be part of the response? #184

@tomayac

Description

@tomayac

This came up in a forum discussion, and the spec doesn't really say what the correct behavior is.

const prefix = 'Hello';
const m = await LanguageModel.create();
const response = await m.prompt([
  { role: "user", content: "Hello" },
  { role: "assistant", content: prefix, prefix: true },
]);

Should the response actually start with the prefix, that is, "Hello", or should it not start with the prefix, so you need to manually append the prefix to the response. Is it safe to assume the response will start with a ' ' (space)?

const finalResponse = prefix + response;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions