Working with GPT
Integration Dasha with OpenAI GPT
Dasha Scripting Language allows you to integrate GPT flow with common dialog flow using #answerWithGPT function.
How does it work?
When you want to response to the user with GPT, you can call
var result = #answerWithGPT(`Your prompt`, interruptible:true, gptOptions: { model:"openai/gpt-4", openai_apikey: "YOUR APIKEY" }, sayOptions: { interruptDelay: 1.0 });
Where model is either:
- openai/gpt-4
- openai/gpt-4o-mini
- openai/gpt-3.5-turbo
- any other OpenAI model using prefix
openai/
openai_apikey
- your OpenAI APIKEY
interruptible
& interruptDelay
- allows user to interrupt an answer process, if user is speaking for interruptDelay
number of seconds
the result will contain information about what happened:
result.interrupted
will be true, if user has interrupted the systemresult.functionCalled
will be true, if gpt requested a function call (see docs below)
Asking GPT without reply to the customer
You can use #askGPT, which is simular to the #answerWithGPT for getting response from the GPT or for calling your functions.
Found a mistake? Email us, and we'll send you a free t-shirt!