@reititin/client 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -24,7 +24,7 @@ export const ReititinClient = ({ agentId, onMessage }) => {
|
|
|
24
24
|
const agent_id = lines.find(line => line.startsWith('agent_id:'))?.split(': ')[1];
|
|
25
25
|
const rawData = lines.find(line => line.startsWith('data:'))?.replace('data: ', '');
|
|
26
26
|
if (onMessage) {
|
|
27
|
-
const processedMessage = await onMessage(rawData);
|
|
27
|
+
const processedMessage = await onMessage(JSON.parse(rawData));
|
|
28
28
|
await axios.post(FINALIZE_URL, { chat_id: chat_id, agent_id: agent_id, message: processedMessage });
|
|
29
29
|
console.log(`Response sent.`);
|
|
30
30
|
}
|