Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Modules"-"Tools"-"Writing a new tool"-"Implementing the Tool class"-"Advanced" has issue #104

Closed
akihikokuroda opened this issue Oct 22, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@akihikokuroda
Copy link
Contributor

Describe the bug
Executing the example tool in "Modules"-"Tools"-"Writing a new tool"-"Implementing the Tool class"-"Advanced" errors with the following the error message.

node:internal/modules/run_main:129
    triggerUncaughtException(
    ^

[ToolError: Tool "OpenLibrary" has occurred an error!] {
  isFatal: false,
  isRetryable: true,
  context: { input: { title: 'Hrry Potter' }, options: undefined },
  [errors]: [
    TypeError: Request with GET/HEAD method cannot have body.
        at node:internal/deps/undici/undici:13178:13
        at async OpenLibraryTool._run (/Users/akihikokuroda/development/repositories/i-am-bee/bee-agent-framework/examples/tools/custom/openLibrary.ts:59:22)
        at async Object.executor (/Users/akihikokuroda/development/repositories/i-am-bee/bee-agent-framework/src/tools/base.ts:222:19)
        at async pRetry.retries (/Users/akihikokuroda/development/repositories/i-am-bee/bee-agent-framework/src/internals/helpers/retryable.ts:168:16)
        at async handler (/Users/akihikokuroda/development/repositories/i-am-bee/bee-agent-framework/src/internals/helpers/retry.ts:48:14)
        at async pRetry (/Users/akihikokuroda/development/repositories/i-am-bee/bee-agent-framework/src/internals/helpers/retry.ts:71:10)
  ]
}

To Reproduce
Copy past the example in a xxx.ts file.
Add the following lines at the end.

const tool = new OpenLibraryTool();
const result = await tool.run({
  title: "Harry Potter",
});
console.log(result.getTextContent());

Expected behavior
It shows some response without error.

Screenshots / Code snippets

Set-up:
Additional context
The OpenLibrary site is always down for me so it doesn't matter to fix this issue or replace with different example.
The openLibraryTool example in the bee-community-tools` repository is doesn't have this issue.

@akihikokuroda akihikokuroda added the bug Something isn't working label Oct 22, 2024
@Tomas2D Tomas2D self-assigned this Oct 22, 2024
Tomas2D added a commit that referenced this issue Oct 22, 2024
@Tomas2D
Copy link
Contributor

Tomas2D commented Oct 22, 2024

Fixed. Thank you for the the report.

@Tomas2D Tomas2D closed this as completed Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants