Closed nalbion closed 8 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Hey @nalbion I'm trying to run this and I'm running into the following error using the minimal example:
❯ ts-node minimal.ts
Agent listening at http://localhost:8000
Internal Server Error: /response must be object
at ResponseValidator._validate (/mnt/sda1/home/z/Documents/Projects/RAW/agent-protocol/packages/sdk/js/node_modules/express-openapi-validator/src/middlewares/openapi.response.validator.ts:201:13)
at /mnt/sda1/home/z/Documents/Projects/RAW/agent-protocol/packages/sdk/js/node_modules/express-openapi-validator/src/middlewares/openapi.response.validator.ts:73:23
at ServerResponse.json_hook (/mnt/sda1/home/z/Documents/Projects/RAW/agent-protocol/packages/sdk/js/node_modules/express-openapi-validator/src/framework/modded.express.mung.ts:39:16)
at /mnt/sda1/home/z/Documents/Projects/RAW/agent-protocol/packages/sdk/js/node_modules/agent-protocol/src/agent.ts:100:25
at processTicksAndRejections (node:internal/process/task_queues:95:5)
task: d49ea465-d956-47fe-9ded-2d2753ef065d
step: Write the word 'Washington' to a .txt file
step: y
task: e650d874-7de7-4236-9c0f-20198e605ece
Internal Server Error: /response must be object
at ResponseValidator._validate (/mnt/sda1/home/z/Documents/Projects/RAW/agent-protocol/packages/sdk/js/node_modules/express-openapi-validator/src/middlewares/openapi.response.validator.ts:201:13)
at /mnt/sda1/home/z/Documents/Projects/RAW/agent-protocol/packages/sdk/js/node_modules/express-openapi-validator/src/middlewares/openapi.response.validator.ts:73:23
at ServerResponse.json_hook (/mnt/sda1/home/z/Documents/Projects/RAW/agent-protocol/packages/sdk/js/node_modules/express-openapi-validator/src/framework/modded.express.mung.ts:39:16)
at /mnt/sda1/home/z/Documents/Projects/RAW/agent-protocol/packages/sdk/js/node_modules/agent-protocol/src/agent.ts:100:25
at processTicksAndRejections (node:internal/process/task_queues:95:5)
task: 8c7abfce-7f2f-4ee5-8fc3-d7185ecbc8db
Internal Server Error: /response must be object
at ResponseValidator._validate (/mnt/sda1/home/z/Documents/Projects/RAW/agent-protocol/packages/sdk/js/node_modules/express-openapi-validator/src/middlewares/openapi.response.validator.ts:201:13)
at /mnt/sda1/home/z/Documents/Projects/RAW/agent-protocol/packages/sdk/js/node_modules/express-openapi-validator/src/middlewares/openapi.response.validator.ts:73:23
at ServerResponse.json_hook (/mnt/sda1/home/z/Documents/Projects/RAW/agent-protocol/packages/sdk/js/node_modules/express-openapi-validator/src/framework/modded.express.mung.ts:39:16)
at /mnt/sda1/home/z/Documents/Projects/RAW/agent-protocol/packages/sdk/js/node_modules/agent-protocol/src/agent.ts:100:25
at processTicksAndRejections (node:internal/process/task_queues:95:5)
task: 562e4515-78e0-46de-826c-fc5568f14429
Do you think you could merge in some of the new changes to the js sdk and verify that this is an issue on your side as well?
Nevermind, I didn't use a local import for the minimal example. This is working.
Pull Request
Description
Small refactor to
createApi()
to returnapp
and optionally not start listening. This allows the JavaScript library to be used from serverless functions in AWS, Google etc.Checklist
Please review and check the following items to ensure your pull request can be processed smoothly:
[*] My code adheres to the project's coding standards and style guidelines.
[*] I have tested my changes thoroughly, including unit tests where applicable.
[*] I have updated the documentation to reflect any changes made in this pull request.
[*] My branch is up-to-date with the latest changes from the main branch.
[ ] I have received code review feedback and addressed any comments or concerns.