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

OpenAPI tool #105

Open
Tomas2D opened this issue Oct 22, 2024 · 9 comments · May be fixed by #246
Open

OpenAPI tool #105

Tomas2D opened this issue Oct 22, 2024 · 9 comments · May be fixed by #246
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Tomas2D
Copy link
Contributor

Tomas2D commented Oct 22, 2024

Take the following implementation and add it to the framework.

https://github.com/i-am-bee/bee-api/blob/main/src/runs/execution/tools/api-call-tool.ts#L42C1-L43C1

Are there any blockers or things to consider? @pilartomas, @xjacka

@Tomas2D Tomas2D added enhancement New feature or request good first issue Good for newcomers hacktoberfest https://hacktoberfest.com labels Oct 22, 2024
@xjacka
Copy link

xjacka commented Oct 25, 2024

  1. The tool should accept the apiKey parameter.
  2. The tool should accept the http_proxy_url parameter and use this proxy for all requests.

chavan-arvind added a commit to chavan-arvind/bee-agent-framework that referenced this issue Oct 26, 2024
Related to i-am-bee#105

Add support for `apiKey` and `http_proxy_url` parameters to various tools.

* **DuckDuckGoSearchTool**:
  - Add `apiKey` and `http_proxy_url` parameters to `DuckDuckGoSearchToolOptions`.
  - Update `_run` method to use `http_proxy_url` for all requests.
  - Update `_run` method to include `apiKey` in headers if provided.

* **GoogleSearchTool**:
  - Add `http_proxy_url` parameter to `GoogleSearchToolOptions`.
  - Update `_run` method to use `http_proxy_url` for all requests.

* **OpenMeteoTool**:
  - Add `http_proxy_url` parameter to `ToolOptions`.
  - Update `_run` method to use `http_proxy_url` for all requests.
  - Update `_geocode` method to use `http_proxy_url` for all requests.
@Tomas2D
Copy link
Contributor Author

Tomas2D commented Oct 26, 2024

The second should be optional. I would allow the user to pass custom overrides for underlying fetch parameter calls.

@planetf1
Copy link

I'd be interested to take a look as a first issue within the framework/api.

Previously I've been looking at the stack and raising a few issues/PRs

I think the request here is to add the API tool into the built in tools (as documented here), similar to how we have google, wikipedia, openMeteo etc.

I'm not certain on what then needs to be added/left in the bee-api itself since in general custom tools are found dynamically. For core tools, mostly it just seems to require creating an instance of the tool

@xjacka
Copy link

xjacka commented Nov 1, 2024

Yes, this issue is about migrating this basic implementation to the framework and making it more robust. After that, we will use this tool instead of the current implementation in the API. This issue is only about the framework part.

@mmurad2
Copy link
Member

mmurad2 commented Nov 1, 2024

@planetf1 I just assigned you the ticket, feel free to reach out if you have any questions/blockers!

@mmurad2 mmurad2 removed the hacktoberfest https://hacktoberfest.com label Nov 1, 2024
@planetf1
Copy link

planetf1 commented Nov 1, 2024

@mmurad2 thanks

I'm making a first-pass at the change. I have implementation code, and just debugging a simple e2e test.
Will share as a draft PR once a basic test works

@planetf1
Copy link

planetf1 commented Nov 1, 2024

I've added a first-pass draft PR. There is still more to do, but since I am just learning about the bee framework, it would be great if you could check the nature of the change I'm proposing matches your expectations.

I made a few changes from the original code

  • http proxy is now a parameter
  • I removed the encryption of the api key (we don't have it in meteo, and it would require configuration + the crypto implementation from the framework)

Tests need more work

  • what endpoint could we test against?
    • do we need to spin up a simple server for our e2e test ?
    • or is there a public endpoint it's ok to use
    • similar for proxy
  • only a simple 'happy path' is coded to check something is sent and received. The response isn't valid, and may not be correct. Just enough to get the code structure in place by end of week.
  • many more parm combinations need testing

There's also improvements to the tool itself - such as how error responses are handled, timeout configuration etc.

@Tomas2D
Copy link
Contributor Author

Tomas2D commented Dec 4, 2024

@planetf1 I provided you with feedback a few weeks ago. Are you willing to work on this?

@planetf1
Copy link

planetf1 commented Dec 7, 2024

Hi @Tomas2D thanks for the feedback. I'm not going to be able to spend time on this in the short term, so please do reassign if needed.

@akihikokuroda akihikokuroda self-assigned this Dec 9, 2024
@akihikokuroda akihikokuroda linked a pull request Dec 11, 2024 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants