Handling True Negatives
I created a simple bot which calls the GPT API from the Default Fallback Intent and used Dialogflow Messenger for the user interface.
I used the Accordion rich response to display the sometimes long responses inside the chat widget.

JSON response from GPT API:
{
"warning": "This model version is deprecated. Migrate before January 4, 2024 to avoid disruption of service. Learn more https://platform.openai.com/docs/deprecations",
"object": "text_completion",
"model": "text-davinci-003",
"choices": [
{
"text": "\n Dialogflow ES would be the best option for this use case. It is designed to help you quickly create conversational interfaces for websites, mobile applications, popular messaging platforms, and IoT devices. It can be used to create an FAQ chatbot based on the content in your WordPress website.",
"index": 0,
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 48,
"completion_tokens": 60,
"total_tokens": 108
}
}

JSON response from GPT API:
{
"warning": "This model version is deprecated. Migrate before January 4, 2024 to avoid disruption of service. Learn more https://platform.openai.com/docs/deprecations",
"object": "text_completion",
"model": "text-davinci-003",
"choices": [
{
"text": "\nDialogflow CX would be the best option for this use case. Dialogflow CX is designed for complex conversational flows and can handle product ordering bots with ease.",
"index": 0,
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 46,
"completion_tokens": 36,
"total_tokens": 82
}
}

JSON response from GPT API:
{
"warning": "This model version is deprecated. Migrate before January 4, 2024 to avoid disruption of service. Learn more https://platform.openai.com/docs/deprecations",
"object": "text_completion",
"model": "text-davinci-003",
"choices": [
{
"text": "\n Dialogflow CX would be the best option for this use case. Dialogflow CX is designed for complex, multi-turn conversations and can be used to create a chatbot that can provide relevant code samples based on your software product's documentation.",
"index": 0,
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 48,
"completion_tokens": 54,
"total_tokens": 102
}
}
In the next lesson I will explain how to build this integration.
You must be logged in to post a comment.