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

[Feat] browser should support custom base url for bing search #2321

Merged
merged 8 commits into from
Apr 16, 2024

Conversation

Mai0313
Copy link
Collaborator

@Mai0313 Mai0313 commented Apr 8, 2024

Why are these changes needed?

The browser utils which is called by WebSurferAgent should support custom base_url
This base_url has been named as bing_base_url since I wanna remain the same format/naming rule with bing_api_key.

This change has been tested using my own url; bing_base_url is optional field.

A simple pre-view of how to use is:

browser_config={
    "viewport_size": 4096,
    "bing_api_key": bing_api_key,  # the api from my company only accepts api_key in headers; but I decided to keep this as the same for normal usage.
    "bing_base_url": "https://mlop-azure-gateway.mediatek.inc/v7.0/search",
    "request_kwargs": {
        "verify": False,
        "headers": {
            "X-User-Id": "mtk30765",
            "api-key": bing_api_key
        }
    }
},

Related issue number

#2320

Checks

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 36.55%. Comparing base (4a44093) to head (5034f08).
Report is 1 commits behind head on main.

Files Patch % Lines
autogen/browser_utils.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2321      +/-   ##
==========================================
- Coverage   38.14%   36.55%   -1.59%     
==========================================
  Files          78       76       -2     
  Lines        7865     7859       -6     
  Branches     1683     1684       +1     
==========================================
- Hits         3000     2873     -127     
- Misses       4615     4742     +127     
+ Partials      250      244       -6     
Flag Coverage Δ
unittests 36.55% <0.00%> (-1.58%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

autogen/browser_utils.py Outdated Show resolved Hide resolved
@Mai0313 Mai0313 requested a review from jackgerrits April 9, 2024 01:39
@Mai0313 Mai0313 changed the title feat: browser is now support custom base url [Feat] browser should support custom base url for bing search Apr 9, 2024
@sonichi
Copy link
Contributor

sonichi commented Apr 16, 2024

@jackgerrits is this PR ready to merge?

jayralencar pushed a commit to jayralencar/autogen that referenced this pull request May 28, 2024
…oft#2321)

* feat: browser is now support custom base url

* fix: replae the base url position.

* Update bing_base_url parameter in SimpleTextBrowser class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants