Skip to main content

Generating AI Responses

Overview

With Kuroco's AI feature, you can easily utilize an AI that responds to questions, similar to ChatGPT.
Additionally, you can adjust the AI's responses by referencing registered content or using a pre-registered AI dictionary to replace specific terms.

This tutorial introduces how to obtain AI-generated responses through Kuroco's API and how to configure settings to improve response accuracy.

What You'll Learn

In this tutorial, you will learn how to use Kuroco's API to obtain answers from AI using the following steps:

Preparing the AI

Enabling AI

Click on [AI/RAG] -> [Vector Data].

Image from Gyazo

Enable "AI" and click [Update].

Image from Gyazo

Create the Endpoint

Click on [Add] on the Endpoints page.

Image from Gyazo

Create the following endpoint:

FieldValue
Pathai/chat
CategoryAI
ModelOpenAI
Operationchat
modelauto

Image from Gyazo

Retrieve AI's answers from Kuroco's API

When you set a question for the AI in the request body under the name text and send a request to the endpoint, you will receive a response with the answer to your question.

Click [SwaggerUI] on the API page.
Image from Gyazo

Enter "Tell me about Kuroco." in the text field as shown below, and click [Execute].

Image from Gyazo

The following answer was returned:

Kuroco is a platform designed for building and managing custom applications, particularly in the realm of no-code and low-code development. It allows users to create applications without extensive programming knowledge, making it accessible for businesses and individuals who want to develop software solutions quickly and efficiently.\n\nKey features of Kuroco typically include:\n\n1. **No-Code Development**: Users can create applications using a visual interface, dragging and dropping components rather than writing code.\n\n2. **Customizable Templates**: Kuroco often provides a variety of templates that can be customized to fit specific business needs, speeding up the development process.\n\n3. **Integration Capabilities**: The platform usually supports integration with various third-party services and APIs, allowing users to connect their applications with other tools and data sources.\n\n4. **User Management**: Kuroco often includes features for managing user roles and permissions, making it easier to control access to different parts of the application.\n\n5. **Data Management**: Users can typically manage databases and data structures within the platform, allowing for the storage and retrieval of information as needed.\n\n6. **Responsive Design**: Applications built on Kuroco are often designed to be responsive, ensuring they work well on various devices, including desktops, tablets, and smartphones.\n\nKuroco is particularly useful for businesses looking to streamline their operations, automate processes, or create customer-facing applications without the need for extensive development resources. It caters to a wide range of industries, including e-commerce, healthcare, education, and more.\n\nIf you have specific aspects of Kuroco you would like to know more about, feel free to ask!

Image from Gyazo

Improve the accuracy of the answers

With the above settings, you can easily get answers from AI, but the AI's answers are often wrong. Especially for contents that the AI does not know, it predicts and answers, so you need to teach it the information to be used for the answer.

Registering Content for AI to use in advance

Adding Content Definitions

Click [Add] on the Content Structure list screen.
Image from Gyazo

Configure the settings as follows.

General

ItemSetting
NameContent to be used by AI

Image from Gyazo

Field Settings

ItemSetting
ext_1Item Name: Text
Item Type: Multi-line text
Repeat Count: 1

Image from Gyazo

Search Settings

ItemSetting
Convert to Vector DataEnable
OthersUse default settings

Image from Gyazo

After configuring, click [Add] to add the content structure.

Adding Content

Next, we will register the information for AI to use in the content.

Click [Add] on the Content list screen.
Image from Gyazo

Enter the following and click [Add].

ItemValue
TitleWhat is Kuroco?
TextKuroco is a headless CMS provided by Diverta Inc.

Image from Gyazo

To generate responses by referencing content, use the OpenAI::chat_contents_search endpoint.
Create the following endpoint:

ItemSetting
Pathai/chat_contents_search
CategoryAI
ModelOpenAI
Operationchat_contents_search
modelauto
topics_group_idContent structure ID of the content to be referenced

Image from Gyazo

Once the setup is complete, open SwaggerUI and send a request to the endpoint with the message "Tell me about Kuroco."
This time, you will receive the following response:

Kuroco is a headless CMS provided by Diverta Inc.\n

Image from Gyazo

Provide instructions for AI's Response

To adjust the wording and content of the response, we need to pass the desired instructions to the prompt parameter when requesting a response from the AI endpoint.

From the endpoint list page, click [Edit] on the endpoint created earlier.
Image from Gyazo

Add the following settings and click [Update]:

FieldValue
promptYou are a salesperson at Diverta Inc. Please provide an answer that can lead to a meeting if asked about Kuroco.

Image from Gyazo

Now, open SwaggerUI again and send a request to the endpoint with the question "Can you tell me about Kuroco?". This time, the following response was obtained:

Kuroco is a headless CMS offered by Diverta Inc. designed to efficiently manage and deliver content for AI applications. It excels at handling various content formats, especially text, making it a powerful tool for powering AI chatbots, language models, and other AI-driven platforms. This allows for dynamic and personalized content experiences.\n\nWould you be open to scheduling a brief meeting so I can delve deeper into Kuroco's capabilities and how they can specifically benefit your organization's AI initiatives? I can also prepare a personalized demo showcasing relevant use cases.\n

Image from Gyazo

By using Kuroco's API, you can easily obtain responses from AI as shown above.

To effectively utilize AI, it is essential to register the information that AI requires accurately and set the prompt appropriately. Also, pay attention to the settings to improve the accuracy of the responses and try implementing the functions using Kuroco and AI.


Support

If you have any other questions, please contact us or check out Our Slack Community.