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

Bing Search Pass Thru #8019

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sfarthin
Copy link

@sfarthin sfarthin commented Jan 27, 2025

Title

Enables Bing Search as a pass-thru endpoint

general_settings:
  pass_through_endpoints:
    - path: "/bing/search"
      target: "https://api.bing.microsoft.com/v7.0/search"
      auth: true
      merge_query_params: True
      headers:
        Ocp-Apim-Subscription-Key: "os.environ/AZURE_BING_SEARCH_API_KEY"

Type

🆕 New Feature

Changes

[REQUIRED] Testing - Attach a screenshot of any new tests passing locally

If UI changes, send a screenshot/GIF of working UI fixes

pytest tests/local_testing/test_pass_through_endpoints.py::test_pass_through_endpoint_bing -s

image

unclear why there is so much output.

Copy link

vercel bot commented Jan 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 27, 2025 2:13pm

Copy link
Contributor

@ishaan-jaff ishaan-jaff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requested changes

@@ -325,6 +327,25 @@ async def pass_through_request( # noqa: PLR0915
request=request, headers=headers, forward_headers=forward_headers
)

if merge_query_params:
# Get the query params from the request
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you make a helper function for doing this and call the helper

@@ -2175,6 +2175,7 @@ class SpecialHeaders(enum.Enum):
azure_authorization = "API-Key"
anthropic_authorization = "x-api-key"
google_ai_studio_authorization = "x-goog-api-key"
bing_search_authorization = "Ocp-Apim-Subscription-Key"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be apim_authorization header correct

I believe all apim requests can use this header ?

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.

2 participants