Replaced fallback database seeding with an informational message for empty channels.
Audit / Dependencies (push) Successful in 6s
CD / Publish (push) Successful in 5s
CI / Formatting (push) Successful in 4s
CI / Linting (push) Successful in 5s
CI / Tests (push) Successful in 16s
CI / Type Checking (push) Successful in 11s
CI / Spelling (push) Successful in 5s
Audit / Dependencies (push) Successful in 6s
CD / Publish (push) Successful in 5s
CI / Formatting (push) Successful in 4s
CI / Linting (push) Successful in 5s
CI / Tests (push) Successful in 16s
CI / Type Checking (push) Successful in 11s
CI / Spelling (push) Successful in 5s
This commit is contained in:
+4
-3
@@ -111,10 +111,11 @@ async def generate(
|
||||
with metrics.GENERATION_DURATION.time():
|
||||
word = await db.get_random_start_word(channel_id)
|
||||
|
||||
# Seed the chain with a fallback sentence if the channel has no data yet.
|
||||
if word is None:
|
||||
await _ingest_sentence(db, channel_id, 0, "Hello world!")
|
||||
word = "Hello" # Known start word from the fallback sentence above.
|
||||
return (
|
||||
"There's not enough data to generate a message yet."
|
||||
" Chat a bit more so I can learn how this channel talks!"
|
||||
)
|
||||
|
||||
parts: list[str] = []
|
||||
parts.append(word)
|
||||
|
||||
Reference in New Issue
Block a user