Skip to main content
Version: v5.1

AiPrompt component

The AiPrompt component is a platform framework component that functions independently with its own platform provider. You can input the Team and a text prompt; use the onResponse callback function to perform actions in your app with the response.

CalloutElementDescription
ATeam selector
BChatStarts a new conversation chat
CPromptClick to select from a previous conversation to continue

The following code demonstrates a simple implementation in the Reference App:

import { AiPrompt, PlatformProvider } from "@dtplatform/iaf-ai-components";
const ModelElemChat = ({ onResponse }) => {  return (    <div style={{ height: "100%", padding: "1rem" }}>      <PlatformProvider>        <AiPrompt             onResponse={({ ok, request, response, error, convId }) => {              console.log(                "AI response", { ok, request, convId, response, error }              );              onResponse(response.message)          }}        />      </PlatformProvider>    </div>  );};
export default ModelElemChat;