You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can use promises or async functions when defining a custom encoder or custom decoder for AWS Lambda Agents. For example, I can use Bedrock to constrain the user input to JSON, or make use of APIs to adjust or hydrate my input.
Current Behaviour
Error during agent dispatch: TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of Promise
at Function.from (node:buffer:322:9)
at writeBody (/home/ec2-user/REDACTED/node_modules/@smithy/node-http-handler/dist-cjs/index.js:189:28)
at writeRequestBody (/home/ec2-user/REDACTED/node_modules/@smithy/node-http-handler/dist-cjs/index.js:170:5)
at /home/ec2-user/REDACTED/node_modules/@smithy/node-http-handler/dist-cjs/index.js:399:33
at new Promise ()
at _NodeHttpHandler.handle (/home/ec2-user/REDACTED/node_modules/@smithy/node-http-handler/dist-cjs/index.js:289:12)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async /home/ec2-user/REDACTED/node_modules/@smithy/middleware-serde/dist-cjs/index.js:33:24
at async /home/ec2-user/REDACTED/node_modules/@smithy/core/dist-cjs/index.js:168:18
at async /home/ec2-user/REDACTED/node_modules/@smithy/middleware-retry/dist-cjs/index.js:320:38 {
code: 'ERR_INVALID_ARG_TYPE',
'$metadata': { attempts: 1, totalRetryDelay: 0 }
}
Expected Behaviour
I can use promises or async functions when defining a custom encoder or custom decoder for AWS Lambda Agents. For example, I can use Bedrock to constrain the user input to JSON, or make use of APIs to adjust or hydrate my input.
Current Behaviour
Error during agent dispatch: TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of Promise
at Function.from (node:buffer:322:9)
at writeBody (/home/ec2-user/REDACTED/node_modules/@smithy/node-http-handler/dist-cjs/index.js:189:28)
at writeRequestBody (/home/ec2-user/REDACTED/node_modules/@smithy/node-http-handler/dist-cjs/index.js:170:5)
at /home/ec2-user/REDACTED/node_modules/@smithy/node-http-handler/dist-cjs/index.js:399:33
at new Promise ()
at _NodeHttpHandler.handle (/home/ec2-user/REDACTED/node_modules/@smithy/node-http-handler/dist-cjs/index.js:289:12)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async /home/ec2-user/REDACTED/node_modules/@smithy/middleware-serde/dist-cjs/index.js:33:24
at async /home/ec2-user/REDACTED/node_modules/@smithy/core/dist-cjs/index.js:168:18
at async /home/ec2-user/REDACTED/node_modules/@smithy/middleware-retry/dist-cjs/index.js:320:38 {
code: 'ERR_INVALID_ARG_TYPE',
'$metadata': { attempts: 1, totalRetryDelay: 0 }
}
Code snippet
Possible Solution
No response
Steps to Reproduce
running the code above should be enough.
The text was updated successfully, but these errors were encountered: