Skip to content

Add a config option to disable generating titles or prevent them from using an LLM #369

@thoasty-dev

Description

@thoasty-dev

It would be great if we could disable the LLM title-generation feature via a config var. Was wondering why I had random requests to haiku.

protected function generateTitle(string $prompt): string
{
try {
$response = $this->provider->textGateway()->generateText(
$this->provider,
$this->provider->cheapestTextModel(),
'Generate a concise 3-5 word title for a conversation that starts with the following message. Respond with only the title, no quotes or punctuation.',
[new UserMessage(Str::limit($prompt, 500))],
);
return Str::limit($response->text, 100);
} catch (Throwable) {
return Str::limit($prompt, 100, preserveWords: true);
}
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions