Adding context to the client's query allows you to get a more accurate response from the neural network.
To do this, you need to add a new variable that will contain the required context. Then use the BPL function str.concat() to combine the user's query and your query into a single call to the neural network.
Example BPL expression:
$context = “You are a consultant for TWIN, this company develops voice and text bots. Answer the following question: ”
$question = str.concat($context, $question)
Where:
$context - a variable containing your query with the added context to be included in the user's query.$question - a variable containing the original user query that the neural network is processing; in this case, the variable is overridden to contain the result of concatenating the $context variable and the original value of the $question variable.str.concat() is a BPL function that takes two strings as parameters and concatenates them into a single string.$answer - a variable containing the response of the neural network.The final query looks as follows:
$context = “You are a consultant for TWIN, a company that develops voice and text bots.”
$question = str.concat($context, $question)
$answer = gpt4.ask($question, 0.8)
In this case, the neural network will receive a query of the form: “You are a consultant for TWIN, this company develops voice and text bots. Help me solve the problem...”.