MCPcopy Create free account
hub / github.com/botbotrobotics/BotBrain / callPromptService

Function callPromptService

frontend/src/components/chat.tsx:134–154  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

132 };
133
134 const callPromptService = (input: string) => {
135 prompt.action({
136 input,
137 callback: (result) => {
138 const response: ChatMessage = {
139 id: (Date.now() + 1).toString(),
140 content: result.output,
141 sender: 'robot',
142 timestamp: new Date(),
143 };
144 setIsTyping(false);
145 setMessages((prev) => [...prev, response]);
146 moveChatToBottom();
147 },
148 failedCallback: (error?: string) => {
149 console.error(error);
150 setIsTyping(false);
151 setDisableInput(true);
152 },
153 });
154 };
155
156 return (
157 <div className="w-full h-full flex flex-col overflow-hidden">

Callers 1

sendMessageFunction · 0.85

Calls 1

moveChatToBottomFunction · 0.70

Tested by

no test coverage detected