Updates from Belen Toggle Comment Threads | Keyboard Shortcuts

  • Belen 11:04 am on March 20, 2023 Permalink  

    Make your own ChatGPT or GPT-3/GPT-4 mini web app in minutes with GuidedTrack 

    Did you know that in just a few minutes, you can make your own micro app that makes use of ChatGPT or GPT-4 / GPT-3 using GuidedTrack? And you can do this quickly and easily even if you’ve never used Guidedtrack before and even if you’ve never programmed in your life. In this simple-to-follow tutorial, we’ll show you how to do it, and we’ll also give you some examples of mini-apps we made using ChatGPT (for instance, an app that automatically shortens writing so that it can fit into a tweet, as well as a chatbot app that asks useful questions for self-reflection).

    Step 1. Generate an OpenAI API key

    1. You will need to either log in to an existing OpenAI account or sign up for a new account if you don’t yet have one. Creating an account is free and takes less than one minute! Once you have an OpenAI account and are signed in, go to the OpenAI API.
    2. Click on “+ create new secret key”. The system will generate an API key that will be displayed only once. Copy the key and keep it somewhere safe, as you will need it to configure your GuidedTrack program to use ChatGPT or GPT-4 / GPT-3.

    Step 2. Create and configure your GuidedTrack program

    If you already have a GuidedTrack.com account, go here to login. If you don’t have a GuidedTrack account yet, go here to create one for free! Now, go to your programs page in GuidedTrack, and create a new GuidedTrack program and name it whatever you like.

    Select Settings on the navigation bar, go to the Services tab and click on “+ New Service”:

    Use these values to fill in these fields:

    NameChatGPT API
    URLhttps://api.openai.com/v1
    Usernameanystring
    Password… put the API key you generated in step 1 here…

    Here’s how it should look once you’ve configured it properly:

    When you are done, click Save.

    Step 3. Writing your GuidedTrack program

    Here is a fully working GuidedTrack program that will use ChatGPT to turn a longer block of text into tweet length automatically. This program will simply ask you for what text you want to turn into a tweet, then it will turn it into a tweet using ChatGPT, then it will ask if you want to generate another tweet from the same text or start over with new text.

    Once you’ve completed steps 1 and 2 (described above), just copy and paste this code in your new GuidedTrack program (then hit preview), and you’ll have a working ChatGPT / GPT-3 / GPT-4 based micro web app working immediately! You can also just go here to see the code and copy it.

    *label: Start
    
    *question: Type some text below. ChatGPT will then shorten it while accurately preserving the meaning so that it can be used as a tweet that fits into the 280-character limit on Twitter. 🐦
    	*type: paragraph
    	*save: user_input_chatgpt
    
    >> prompt_for_chatgpt = "Shorten this text while accurately preserving the meaning so that it can be used as a tweet that fits into the 280 character limit on Twitter: “{user_input_chatgpt}”"
    
    *label: API Call
    
    Thinking...
    
    >> model_for_chatgpt = "gpt-3.5-turbo"
    
    *program: ChatGPT API - public
    
    *clear
    
    *if: success_chatgpt = 1
    
    	*{"RESPONSE FROM CHATGPT:"}*
    
    	{response_from_chatgpt}
    
    *if: success_chatgpt = 0
    
    	*{"ERROR FROM THE CHATGPT API:"}*
    
    	{error_from_chatgpt}
    
    
    *question: {""}
    	🔁 Generate another response for the same prompt
    		*goto: API Call
    	🏁 Start over
    		*goto: Start
    

    Now, so that you can understand what this code is doing to make it easier for you to modify it for your purposes, we’ll break down what it does step-by-step.

    First, the GuidedTrack code prompts the user to enter the text to be shortened:

    *label: Start
    
    *question: Type some text below. ChatGPT will then shorten it while accurately preserving the meaning so that it can be used as a tweet that fits into the 280-character limit on Twitter. 🐦
    	*type: paragraph
    	*save: user_input_chatgpt
    

    This is what the user will see:

    Their answer will be stored in a variable that we have called user_input_chatgpt. Below is how we incorporate it into the prompt for ChatGPT.

    >> prompt_for_chatgpt = "Shorten this text while accurately preserving the meaning so that it can be used as a tweet that fits into the 280 character limit on Twitter: “{user_input_chatgpt}”"
    

    Then we invoke the special GuidedTrack subprogram ChatGPT API – public that we have created (if you’re curious what that subprogram does, just click here to see). Since calling the ChatGPT API may take a few seconds, we’re displaying some text (“Thinking…”) to give some feedback to the user of the program as they wait.

    *label: API Call
    
    Thinking...
    
    *program: ChatGPT API - public
    

    If everything goes well, ChatGPT API – public returns two variables:

    • success_chatgpt: which will have been set to the value 1 to indicate success
    • response_from_chatgpt: which will be ChatGPT’s response to your prompt

    and if there is an error, it will return:

    • success_chatgpt: which will have been set to the value 0 to indicate an error
    • error_code_chatgpt: the error code returned by the API
    • error_type_chatgpt: description of the error in text form
    • error_from_chatgpt: a combination of error code and type

    Here is where we read and display the response on the screen:

    *clear
    
    *if: success_chatgpt = 1
    
    	*{"RESPONSE FROM CHATGPT:"}*
    
    	{response_from_chatgpt}
    
    *if: success_chatgpt = 0
    
    	*{"ERROR FROM THE CHATGPT API:"}*
    
    	{error_from_chatgpt}
    

    This code clears the screen, checks the value of the variable success_chatgpt, and displays on the screen either ChatGPT’s response or the error that occurred.

    At the end of the program, we have added some code so that the user can generate another response for the same prompt or start over:

    *question: {""}
    	🔁 Generate another response for the same prompt
    		*goto: API Call
    	🏁 Start over
    		*goto: Start
    

    Notice that we have indented two *goto statements under either option. The first one, *goto: API Call, returns the user to the label with that same identifier (“API Call”), so right before displaying “Thinking” on the screen and sending the prompt to ChatGPT (that is, it gets ChatGPT to generate another response based on the same prompt). The second *goto will take the user to the beginning of the program so that they can enter a new text.

    We ran the program in order to tweetify an overview of the novel Don Quixote, and this is one of the outputs it produces (taking a long summary of the novel and summarizing it so it fits into the length of a tweet!):

    Don Quixote, a noble from La Mancha, reads so many chivalric romances that he becomes a knight-errant named Don Quixote de la Mancha, recruiting a farmer, Sancho Panza, as his squire. Don Quixote’s imagination leads him to believe he is living a knightly story, while Sancho often brings him back to reality with earthy wit. #DonQuixote

    ChatGPT



    You can easily share the new GuidedTrack program you made with other people! They can use it anonymously, without having to create an account on GuidedTrack (or you can require login in the settings). Click Publish in the navigation bar, and copy the URL under “Send the program link directly”. Learn more about publishing your program here. Every time your program is run, GuidedTrack saves all the data generated. Go to Data to look at it or download a csv file to see what your users did in your program.

    Below is a link to the code of the program we just reviewed and two other sample programs. If you want to Preview them, you need to create your own copy and configure the ChatGPT API service as explained above.

    Code of example apps made with ChatGPT:

    • Tweetify Text (program code)
    • Reflective Questions (program code): Given a life problem, ChatGPT will respond with an open-ended question that an empathetic and kind person might ask. This question should help the person with the problem reflect on their feelings, beliefs, and behaviors.
    • What would Confucious say (program code): Given a question, ChatGPT will return answers that Confucius, Buddha, and Marcus Aurelius might have given.
    • ChatGPT API – public: This is the program with the code to communicate with ChatGPT. You can make a copy of this program and tweak it meet your needs.

    Please note that any app use built using OpenAI APIs must satisfy the OpenAI usage policies and must go through any review process that OpenAI requires (if they require one at the time of releasing such an app). Note also that the OpenAI API has a fee associated with it, so keep in mind when someone uses your app it will generate fees in your OpenAI account. Here is the OpenAI ChatGPT / GPT-3 / GPT-4 pricing structure. Note that the price depends on the A.I. model that you choose.

    Using the program ChatGPT API – public in your own program

    In the example above, we have shown how to use the “ChatGPT API – public” program from your own account. This program accepts two inputs, both of which are optional:

    • prompt_for_chatgpt: This is the message to send to ChatGPT. If you don’t set this variable prior to invoking the ChatGPT API – public program, a question will be displayed on the screen prompting the user to enter the prompt for ChatGPT:
    • model_for_chatgpt: Model to use. By default it’s set to “gpt-3.5-turbo” but you can find more information regarding the available models here, and set the value to the desired model before invoking the program. For example:
    >> model_for_chatgpt = "gpt-4"
    
    *program: ChatGPT API - public
    

     
  • Belen 9:52 am on March 7, 2023 Permalink  

    Feature update – *searchable answers, store data in a custom column of the CSV file 

    Here’s what’s new:

    Searchable answers


    Often we want to ask users a question with a large set of predefined answers (e.g. the country where they are in). A multiple-choice question will do the job but will be awkward to use because finding the desired answer may require a lot of scrolling.

    In such cases, *searchable questions are a more user-friendly solution. Here, you still have a list of valid answers, but the user initially sees a box where they can start typing their answer. As they do, a drop-down list appears with matches for what the user is entering.



    This is the syntax you would use:

    *question: Please, select the country where you were born:
    	*searchable
    	Andorra
    	Angola
    	Antigua and Barbuda
    	Argentina
    	Armenia
    	...
    
    You will find some programs in the program library that use this functionality:
    • country of birth (code, preview)
    • US state of birth (code, preview): This program asks in what state or territory of the US the user was born. If they were not born in the US, then the program asks for their country of birth, but you can deactivate this follow-up question if you wish.
    • country question (code, preview): By default, this program asks what country the user is in, but you can set the variable `in_countryQuestion` to whatever question you need to ask that requires a country for an answer. For example, “What country has the best cuisine in the world?”
    • US state question (code, preview): Use this program to ask in what state or territory the user is. There is a follow-up question if the user says they are not in the US to ask the country they are in, which can optionally be deactivated. Like in the country question, here you can also change the text of the question.

    Storing data in a custom column of the CSV file that stores all user responses

    Any variable in your program will show as a column in the CSV file when you download the generated data. The name of the column will be the variable name. But sometimes it’s useful to store data in a column whose name is determined while the program is running. The new `data::store` feature lets you do exactly this by calling:
    `>> data::store(columnName, value)`

    Here is how you would use it:

    >> columnToPutData = "my new column"
    >> myValue = 24
    
    >> data::store(columnToPutData, myValue)


    As an example, below is the code of a program where you ask users to enter the last three movies they watched and save it into a variable called movies:

    *question: Please, type in the last three movies you watched:
    	*save: movies
    	*multiple
    
    
    Then you ask the users to rate each movie that they entered:
    *for: movie in movies
    	*question: How many stars would you give the movie {movie}?
    		*answers: [5,4,3,2,1]
    		*save: answer
    
    
    When you download the CSV file, you will have a column with the name “How many stars would you give the movie {movie}?” and for each run, you will have all the ratings that the user provided separated by a pipe(|). The variable `answer` will also be in the CSV file, and it will only have the last rating the user provided (since its value gets overwritten in every iteration).

    Ideally, you should have a separate column for each movie, with its corresponding rating if a particular user selected that movie. You can accomplish this using >>data::store(columnName, value):
    *for: movie in movies
    	*question: How many stars would you give the movie {movie}?
    		*answers: [5,4,3,2,1]
    		*save: answer
    	>>data::store(movie, answer)
    
    
    This way, if the value of movies is [“Titanic”, “Easy Rider”, “Dune”], there will be three columns on the CSV file with the names “Titanic”, “Easy Rider” and “Dune”, with the ratings provided by the users who watched either of those movies.
     
     
  • Belen 3:34 am on August 26, 2022 Permalink  

    Feature update – Questions with *other answers, give a hint with *placeholder, SSO 

    Here’s what’s new:

    Allowing other answers to multiple-choice and checkbox questions


    The attribute *other allows users to type in an answer to a multiple-choice or checkbox question. For example: 
    *question: What is your favorite ice cream flavor?
        *other
        Strawberry
        Rocky road
        Cookies and cream
        *save: favoriteIceCream
    
     



    Here, the variable favoriteIceCream will take the value StrawberryRocky road, Cookies and Cream, or the flavor they type in the box.

    Likewise, *other can be used in checkbox questions:

    *question: What toppings do you want on your pizza?
        Mushrooms
        Pineapple
        Ham
        Onion
        Italian sausage
        *type: checkbox
        *other
        *save: pizzaToppings



    When you allow for *other answers to a multiple-choice question, multiple additional answers are allowed. As soon as the user starts typing in the “other” box, another one will appear right below. Also, you will notice that the answers the user types in are selected by default.
     

    Using *placeholder to give a hint


    The *placeholder attribute is used to display a word or short phrase inside an input box describing the expected value of the field (e.g., a sample value or a short description of the expected format). You can use it in all question types that involve typing (e.g., text and paragraph). 

    *question: Give your intro:
        *type: paragraph
        *placeholder: Write here something about yourself...
    
    
    As soon as the user starts typing in the text box, the *placeholder text will disappear, so make sure that any complex instructions that are hard to memorize are displayed elsewhere (for example, using *tip).
     

    Single Sign-On (SSO)


    SSO allows program users to log in using their ID on another system, instead of having to create a bespoke GuidedTrack account and remember another set of credentials.

    Go to Settings > Login and follow the instructions on the screen to configure external identity providers. Keep in mind that you will need to access your provider’s admin console to do so.


     
     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel