UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

33 lines (32 loc) 687 B
import { JSONPath as o } from "jsonpath-plus"; function p(n) { const s = []; let a; try { a = JSON.parse(n.message); } catch (e) { return console.error(e), [{ reasoningText: n.message }]; } return o({ path: "$.output.message.content[*]", json: a }).forEach((e) => { const r = o({ path: "$.reasoningContent.reasoningText.text", json: e }); r[0] && s.push({ reasoningText: r[0] }); const t = o({ path: "$.toolUse[name,input]", json: e }); t.length > 0 && s.push({ toolName: t[0], toolInput: t[1] }); }), s; } export { p as default }; //# sourceMappingURL=extractMessageFromTraceEvent.js.map