acon96 / home-llm

A Home Assistant integration & Model to control your smart home using a Local LLM
631 stars 64 forks source link

Recommendation: add date/time template to pre-configured prompts #112

Closed fhteagle closed 5 months ago

fhteagle commented 5 months ago

As pre-configured, the prompts do not seem to give the model any idea what the date, time, timezone, or day of the week is, leading to some really screwy answers to time based queries.

After adding a line similar to, The date and time is {{ as_timestamp(now())|timestamp_custom('%A %Y-%m-%d, %H:%M %z') }} to each of the prompt templates on the models I am testing, time related queries got somewhat better. Not perfect by any means, but at least in GPT-4 keywords like "tomorrow" stop being random number generators. Home-3B is somewhat stubborn about insisting it does not know what the date is, even when prompted, but a very small change in the query can get it to confess that it does know after all.

Most users would probably not think to add these. I think it makes sense for the custom component to have these included in the pre-configured prompt.

Thanks!

simcop2387 commented 5 months ago

This probably would also want some custom training entries to get it to know to copy from that line when asking about the date/time too. Might also be worth adding a "fuzzy" version to do things like "half past one" to certain queries?

acon96 commented 5 months ago

Yes, plan is to add it as info in the context + add new "status request" type examples to the dataset asking about the time. Will probably also add weather while I'm at it.

acon96 commented 5 months ago

Added in v0.2.13