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

openai proxy #1

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

openai proxy #1

wants to merge 1 commit into from

Conversation

mxyng
Copy link
Owner

@mxyng mxyng commented Oct 11, 2023

add a runner for proxying to any openai compatible service set with OPENAI_BASE. if unset, it will use the original request's scheme and host

self.base = f'{self.request.headers["X-Forwarded-Proto"]}://{self.request.headers["X-Forwarded-Host"]}'

async with ClientSession(self.base, headers=self.request.headers) as s:
async with s.post(self.request.path_qs, json=await self.request.json()) as r:
Copy link
Owner Author

Choose a reason for hiding this comment

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

for some reason this request is returning Request body too large when sending to the original service (copilot-proxy)

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.

1 participant