...
System Message : This is an optional field and is used to provide additional context about you or your business when completing chats.
Message : This is your main input for which you want the AI to give you an answer or output of. This can be a question, an instruction etc. For better results add “user:” as a prefix to your prompt in order to provide more context to the AI for eg:
“user : will it rain today?”
Remember History: If selected “Yes”, the chat history between user and assistant will be saved in a system field to be used for later if needed.
...
You can set up a detailed background information like this if you are building restaurant chatbot:
System: You are a UChat steak restaurant helpful assistant. You will handle customer support, and guide the user and book reservations. The restaurant opening hours is 9am to 8pm Monday to Saturday, No pet is allowed. Always offer the coupon code if you see it’s good timing to do so.
This will allow you to easily set up background information about the chatbot, and it can serve your client based on the information you instructed.
Message : This is your main input for which you want the AI to give you an answer or output of. Usually this is the user’s response. This can be a question, an instruction etc. You can add “user:” as a prefix to your prompt in order to provide more context to the AI for eg:
“user : will it rain today?”
It will also work if you don’t add “user” in front of the response. You can use our system field like {{last_text_input}}
...
Remember History: If selected “Yes”, the chat history between user and assistant will be saved in a system field to be used for later if needed.
The openAI action response will be automatically saved into assistant role. You don’t need to do anything.
...
Also, we have introduced a new system JSON field: {{openAI}} which will have all the chat history with the user:
...
You can find the openAI system field from your user profile. This JSON will save the system set up, and all the chat history.
Note |
---|
Please note, our JSON field size limits is 20,000, if the chat history have more than 20,000 characters, we will delete from the oldest chat history in order to maintain the chat history within the limits. |
Model : The model you want to use inside ChatGPT for the task. By default gpt-3.5-turbo has been selected.
...
Best of Completions : This returns the best possible response(s) for your prompt. It is default to 1. This works with Number of Completion field to choose the best possible answer from a group of responses.
Response:
...
Sample Response Data
Code Block |
---|
{ "id": "chatcmpl-6zef5zEUdDzTx8VKu2r4gkIJfVcBE", "object": "chat.completion", "created": 1680152331, "model": "gpt-3.5-turbo-0301", "usage": { "prompt_tokens": 18, "completion_tokens": 100, "total_tokens": 118 }, "choices": [ { "message": {...}, // 2 keys "finish_reason": "length", "index": 0 } ], "messages": [ { "role": "user", "content": "can you help me with planting a mango tree?" }, { "role": "assistant", "content": "Of course! Here are some steps to plant a mango tree: 1. Choose a spot: Mango trees need plenty of sunlight and well-draining soil. They also need protection from strong winds, so choose a spot that's sheltered. 2. Prepare the soil: Mango trees prefer slightly acidic soil, with a pH between 5.5 and 7. If your soil is too alkaline, add sulfur or peat moss to lower the pH. If it's too acidic, add lime" } ] } |
...
Message: This is a JSON for complete conversation that has happened between the user and the assistant.
Best Practices:
Chat completion action enables you to provide JSON input as well hence you can save the complete conversation between the users and the assistant in a JSON to give more focused and contextual replies related to that conversation.
Note |
---|
Since chat completion takes more input, the token consumption can be higher that text completion. |
Clear Remembered Chat History
...
Clear remembered history is used to delete or clear the system field where the chat history for chatGPT is stored.
...
OpenAI gives you the ability to provide a knowledge base of your use case or business for the AI to generate responses from. This enables the AI to give more accurate, contextual as well as particular answers instead of filtering them from the internet.
Create An Embedding:
To create an embedding, go into the Integrations and select OpenAI
...
Text : This is the text or main body of the embedding. The max character limit is 1000. You can put the details of the topic here for the AI to generate the response from.
Importing Embeddings:
Instead of manually creating embeddings you can create them in bulk by importing them as a CSV file.
...
Note |
---|
Make sure that the first rows of all columns should be the input fields name such as type, heading, text etc. and none of them should start with a capital letter. |
Embedding Match & Completion Actions
The embedding match action is used to match the entered prompt with best-matching embedding from the knowledge base
Input:
...
Input : This is where you will input or map the prompt you want to match the embedding to.
Response:
...
Embedding : The heading of the embedding the prompt is best matched to.
...
The embedding match and completion action is used to match the entered prompt with best matching embedding from the knowledge base and then generate the response using that particular knowledge base.
Input:
...
Input : This is where you will input or map the prompt you want to match the embedding to.
Introduction : This is used to provide more context to the prompt making the prompt more accurate and helps in raising the embedding match score.
Response:
...
Sample Response Data
Code Block |
---|
{ "status": "ok", "result": { "heading": "Free trial", "text": "UChat offer 14 days free trial. No credit card required, you can access to all the pro features. You can sign up here: https://www.uchat.com.au/register", "score": 0.903164959234692, "input": "Free trial for uchat", "completion": " Yes, UChat offers a 14-day free trial. No credit card is required and you can access all the pro features. You can sign up here: https://www.uchat.com.au/register." } } |
...