@iqai/adk 0.3.3 → 0.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @iqai/adk
2
2
 
3
+ ## 0.3.4
4
+
5
+ ### Patch Changes
6
+
7
+ - f365669: Fixes ai sdk tool response converstion
8
+
3
9
  ## 0.3.3
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1774,11 +1774,19 @@ var AiSdkLlm = (_class6 = class extends BaseLlm {
1774
1774
  (part) => part.functionResponse
1775
1775
  );
1776
1776
  const contentParts2 = functionResponses.map((part) => {
1777
+ let output = part.functionResponse.response;
1778
+ if (!output || typeof output === "object" && Object.keys(output).length === 0) {
1779
+ output = JSON.stringify(output || {});
1780
+ } else if (typeof output === "object") {
1781
+ output = JSON.stringify(output);
1782
+ } else if (typeof output !== "string") {
1783
+ output = String(output);
1784
+ }
1777
1785
  return {
1778
1786
  type: "tool-result",
1779
1787
  toolCallId: part.functionResponse.id,
1780
1788
  toolName: part.functionResponse.name || "unknown",
1781
- output: part.functionResponse.response
1789
+ output
1782
1790
  };
1783
1791
  });
1784
1792
  return {
package/dist/index.mjs CHANGED
@@ -1774,11 +1774,19 @@ var AiSdkLlm = class extends BaseLlm {
1774
1774
  (part) => part.functionResponse
1775
1775
  );
1776
1776
  const contentParts2 = functionResponses.map((part) => {
1777
+ let output = part.functionResponse.response;
1778
+ if (!output || typeof output === "object" && Object.keys(output).length === 0) {
1779
+ output = JSON.stringify(output || {});
1780
+ } else if (typeof output === "object") {
1781
+ output = JSON.stringify(output);
1782
+ } else if (typeof output !== "string") {
1783
+ output = String(output);
1784
+ }
1777
1785
  return {
1778
1786
  type: "tool-result",
1779
1787
  toolCallId: part.functionResponse.id,
1780
1788
  toolName: part.functionResponse.name || "unknown",
1781
- output: part.functionResponse.response
1789
+ output
1782
1790
  };
1783
1791
  });
1784
1792
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iqai/adk",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Agent Development Kit for TypeScript with multi-provider LLM support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",