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

ENH: ProxyHandler supports streaming #784

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

Conversation

sanand0
Copy link
Contributor

@sanand0 sanand0 commented Apr 8, 2024

Usage:

url:
  test:
    pattern: /(.*)
    handler: ProxyHandler
    kwargs:
      url: https://api.openai.com/v1/{0}
      request_headers:
        Authorization: "Bearer openai-api-key"
        Content-Type: true
      xsrf_cookies: false

Check:

curl -i localhost:9988/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4",
    "messages": [
      {
        "role": "system",
        "content": "You are a poet."
      },
      {
        "role": "user",
        "content": "Write a haiku about trees"
      }
    ],
    "stream": true
  }'

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.

None yet

1 participant