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

HttpTool does not use the provided headers in requests #5638

Open
linznin opened this issue Feb 21, 2025 · 2 comments · May be fixed by #5660
Open

HttpTool does not use the provided headers in requests #5638

linznin opened this issue Feb 21, 2025 · 2 comments · May be fixed by #5660

Comments

@linznin
Copy link
Contributor

linznin commented Feb 21, 2025

What happened?

Describe the bug

The HttpTool in AutoGen accepts a headers parameter, but it is not being used in the request. This means that even if users provide headers, they do not take effect in HTTP requests.

To Reproduce
Steps to reproduce the behavior:

Create an instance of HttpTool with custom headers.

Make a request using the tool.

Observe that the headers are not included in the actual request.

Example code:
To Reproduce

from autogen_ext.tools.http import HttpTool

tool = HttpTool(
    name="test_tool",
    description="description",
    method="GET",
    url="https://httpbin.org/get",
    headers={"Authorization": "Bearer test_token"},
    return_type="text",
)

response = tool()
print(response)

Expected behavior
A clear and concise description of what you expected to happen.

Expected request with headers

{
    "headers": {
        "Authorization": "Bearer test_token",
        ...
    }
}

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Which packages was the bug in?

Python Extensions (autogen-ext)

AutoGen library version.

Python dev (main branch)

Other library version.

No response

Model used

No response

Model provider

None

Other model provider

No response

Python version

None

.NET version

None

Operating system

None

@jackgerrits
Copy link
Member

Thanks for reporting this! Are you interested in submitting a fix? The relevant file is here https://github.com/microsoft/autogen/blob/main/python/packages/autogen-ext/src/autogen_ext/tools/http/_http_tool.py

@ekzhu
Copy link
Collaborator

ekzhu commented Feb 21, 2025

cc @EItanya for info

@ekzhu ekzhu modified the milestones: 0.4.x-python, 0.4.8-python Feb 22, 2025
@linznin linznin linked a pull request Feb 22, 2025 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants