Skip to content

Error from the tool-calling/watsonx example: "TypeError: Cannot read property 'map' of undefined or null at transformREST" #19

Open
@thebiss

Description

I am trying the watsonx tool calling example, and was successfully able to deploy everything, but npm start returns the error ECMAScript issue: TypeError: Cannot read property 'map' of undefined or null at transformREST

Log

/home/bbissell/.nvm/versions/node/v22.3.0/bin/node ./index.js
(node:93808) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
{tools: Array(3)}
Error: ECMAScript issue: TypeError: Cannot read property 'map' of undefined or null at transformREST (_local_:5:12(10)): {"response":{"data":{"books":[null]},"errors":[{"message":"ECMAScript issue: TypeError: Cannot read property 'map' of undefined or null at transformREST (_local_:5:12(10))","locations":[{"line":1,"column":18}],"path":["books",0]}],"status":200,"headers":{}},"request":{"query":"query($q:String){books(maxResults:1, q:$q){title,authors,volumeId}}\n","variables":{}}}
    at makeRequest (/home/bbissell/dev-in-wsl/_edu/agentic.l4/lab2/wxflows-lab/wxflows-main/examples/tool-calling/watsonx/node_modules/graphql-request/src/index.ts:426:11)
    at process.processTicksAndRejections (/home/bbissell/dev-in-wsl/_edu/agentic.l4/lab2/wxflows-lab/wxflows-main/examples/tool-calling/watsonx/lib/internal/process/task_queues.js:95:5)
    at async wxflows.execGraphQL (/home/bbissell/dev-in-wsl/_edu/agentic.l4/lab2/wxflows-lab/wxflows-main/examples/tool-calling/watsonx/node_modules/@wxflows/sdk/src/lib/wxflows.ts:66:20)
    at async wxflows.execTool (/home/bbissell/dev-in-wsl/_edu/agentic.l4/lab2/wxflows-lab/wxflows-main/examples/tool-calling/watsonx/node_modules/@wxflows/sdk/src/lib/wxflows.ts:89:14)
    at async file:///home/bbissell/dev-in-wsl/_edu/agentic.l4/lab2/wxflows-lab/wxflows-main/examples/tool-calling/watsonx/node_modules/@wxflows/sdk/dist/lib/watsonx/index.js:23:38
    at async Promise.all (index 0)
    at async wxflows.executeTools (/home/bbissell/dev-in-wsl/_edu/agentic.l4/lab2/wxflows-lab/wxflows-main/examples/tool-calling/watsonx/node_modules/@wxflows/sdk/src/lib/watsonx/index.ts:61:25)
    at async file:///home/bbissell/dev-in-wsl/_edu/agentic.l4/lab2/wxflows-lab/wxflows-main/examples/tool-calling/watsonx/index.js:45:24 {response: {…}, request: {…}, stack: 'Error: ECMAScript issue: TypeError: Cannot re…/examples/tool-calling/watsonx/index.js:45:24', message: 'ECMAScript issue: TypeError: Cannot read pro…itle,authors,volumeId}}\\n","variables":{}}}'}
{toolMessages: Array(2)}

{"status":200,"statusText":"OK","headers":{"date":"Sun, 19 Jan 2025 03:09:21 GMT","content-type":"application/json","transfer-encoding":"chunked","connection":"keep-alive","server-timing":"intid;desc=d0c4a943e0d23624","x-global-transaction-id":"b292bf76b6269331a7841fca268eca56","strict-transport-security":"max-age=31536000; includeSubDomains, max-age=31536000; includeSubDomains","referrer-policy":"strict-origin","x-requests-limit-remaining":"7","x-frame-options":"DENY","pragma":"no-cache","x-requests-limit-rate":"8","x-requests-limit-reset-after":"125","x-requests-limit-period":"1000","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block, 1; mode=block","content-security-policy":"default-src 'none'; script-src 'self'; connect-src 'self'; img-src 'self'; style-src 'self'; frame-ancestors 'none'; form-action 'self';","cache-control":"no-cache, no-store, must-revalidate","cf-cache-status":"DYNAMIC","server":"cloudflare","cf-ray":"9043a01a2e794cd0-BOS"},"result":{"id":"chatcmpl-eec5455077e74d9b8e324fbc09f0ced1","model_id":"mistralai/mistral-large","model":"mistralai/mistral-large","choices":[{"index":0,"message":{"role":"assistant","content":" I'm sorry, I couldn't find any information on the book \"Escape\" by James Patterson. It's possible that the book doesn't exist or that there was an error in the search."},"finish_reason":"stop"}],"created":1737256160,"model_version":"2.0.0","created_at":"2025-01-19T03:09:21.819Z","usage":{"completion_tokens":47,"prompt_tokens":1132,"total_tokens":1179},"system":{"warnings":[{"message":"This model is a Non-IBM Product governed by a third-party license that may impose use restrictions and other obligations. By using this model you agree to its terms as identified in the following URL.","id":"disclaimer_warning","more_info":"https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-models.html?context=wx"}]}}}

Environment Versions

$ wxflows version
wxflows
version: 1.0.0rc200
Python: 3.10.12 (main, Nov  6 2024, 20:22:13) [GCC 11.4.0]
Python path: /home/bbissell/dev-in-wsl/_edu/agentic.l4/lab2/wxflows-lab/.venv/bin/python

StepZen CLI
path: /home/bbissell/.nvm/versions/node/v22.3.0/bin/stepzen
version: stepzen/0.45.0 wsl-x64 node-v22.3.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions