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); |
|
} |
|
} |
|
} |
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.
ai/src/Middleware/RememberConversation.php
Lines 69 to 84 in e6a470f