As of now, Voqal cannot tell you the current time. However, this ability is easy to implement and provides a great
example of how to customize Voqal for real-time information and private data.
The embedded computer context extension has the ability to provide the current time.To print the current time in a prompt template, use the following code:
fun main() { embeddedServer(Netty, port = 8080) { routing { get("/time-aware-voqal") { //download idle mode prompt val idleModeText = URL("https://voqal.dev/prompts/embedded/voqal-idle-mode.md").readText() //create prompt containing current time val timePrompt = buildString { appendLine("## System Information") appendLine() appendLine("Current time is: ${Instant.now()}") appendLine("Current timezone is: ${System.getProperty("user.timezone")}") appendLine() } //insert system information before `## System Mode` section val systemModeIndex = idleModeText.indexOf("## System Mode") val timeAwarePrompt = idleModeText.substring(0, systemModeIndex) + timePrompt + idleModeText.substring(systemModeIndex) //return updated prompt call.respondText(timeAwarePrompt) } } }.start(wait = true)}