User Input - is there a variable to use within the Query

so, i have a pretty large query, i want to have two User Inputs [Location:] and [Current Date:] and those inputs are vital to the query and the use of them are show multiple times within the query. In the very beginning of the query, middle and end. How do i pass those values throughout the query and have the LLM understand that it’s working the way it should? I am working on screenshare and will get that to you later today. Hopefully, i have explain enough.

This is a great question. I’m assuming you are building a smart-form, but similar logic applies to chatbots.

So let’s say in the beginning of the prompt you have something like:

You will help the user build a travel plan using the following details.
CURRENT LOCATION: (user input)
CURRENT DATE: (user input)

Then, later in the prompt you can continue to refer the variables.

Come up with a travel plan that starts in their CURRENT LOCATION and ends in Baltimore. etc. etc.

The key thing to remember is that our system will gather their user inputs, then assemble the full request (with user input blanks replaced with the actual values inputted by the user) and then will send it off to the underlying LLM like GPT-4. So as long as you label the the areas with the user inputs in the prompt, you can refer to them elsewhere without trouble.

I thought I posted a similar question, but I can’t find it. I like this, but I’d like to be able to hard code it in the system prompt - especially the date and time. I use a different platform that allows me to use something like this in the system prompt:

Today is {local_date}, local time is {local_time}.

That way the LLM always knows the date and time without requiring any input from the user.

We don’t have a system that pulls the real date and time, but you could ask the user to provide those values and then you’d re-use them.

This should be quite trivial for the dev team so hopefully a few of us vote for this.

Hi @landed

You can use a custom action and add a library for the date and time?

Something like

import os
import datetime
import pytz

def current_time_and_date(: str):
    """
    Return the current time and date

    Args:
         (string): 
    Envs:
         (string): 
    """

    # Insert your PYTHON code below. You can access environment variables using os.environ[].
    # Currently, only the requests library is supported, but more libraries will be available soon.
    # Use print statements or return values to display results to the user.
    # If you save a png, pdf, csv, jpg, webp, gif, or html file in the root directory, it will be automatically displayed to the user.
    # You do not have to call this function as the bot will automatically call and fill in the parameters.

    # Get current time in UTC
    utc_time = datetime.datetime.now(pytz.utc)
    print(utc_time)

    # Convert to a specific timezone (e.g., Australia/Melbourne)
    melbourne_time = utc_time.astimezone(pytz.timezone('Australia/Melbourne'))
    print(melbourne_time)
1 Like

Thank you to alerting me to use code myself in pickaxes. I will see if I can work that bit out now.

from datetime import date

current_date = date.today()
print(current_date)

Looks like I would need to upgrade my membership as I only get 1 slot for emailing the summary action.
Also upgrading only then gives you 2 actions so that is not worth it for me. I would need 4 actions to make a useful application.
That’s a shame. Perhaps this limit could be lifted a little.