@iqai/adk 0.3.4 → 0.3.5

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.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 8ce3a6f: Fixes ai sdk tool response converstion issue
8
+
3
9
  ## 0.3.4
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1774,13 +1774,14 @@ 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);
1777
+ let output;
1778
+ const response = part.functionResponse.response;
1779
+ if (response === void 0 || response === null) {
1780
+ output = { type: "json", value: null };
1781
+ } else if (typeof response === "string") {
1782
+ output = { type: "text", value: response };
1783
+ } else {
1784
+ output = { type: "json", value: response };
1784
1785
  }
1785
1786
  return {
1786
1787
  type: "tool-result",
package/dist/index.mjs CHANGED
@@ -1774,13 +1774,14 @@ 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);
1777
+ let output;
1778
+ const response = part.functionResponse.response;
1779
+ if (response === void 0 || response === null) {
1780
+ output = { type: "json", value: null };
1781
+ } else if (typeof response === "string") {
1782
+ output = { type: "text", value: response };
1783
+ } else {
1784
+ output = { type: "json", value: response };
1784
1785
  }
1785
1786
  return {
1786
1787
  type: "tool-result",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iqai/adk",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
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",