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

Show Open AI library can talk to Xef server. #387

Merged
merged 7 commits into from
Sep 6, 2023

Conversation

raulraja
Copy link
Contributor

@raulraja raulraja commented Sep 4, 2023

The current frontend code uses a custom request to the xef server.
This PR replaces that custom code for the TS openai library.

Currently failing with:

Access to fetch at 'http://localhost:8081/chat/completions' from origin 'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

The goal here is to show a client with the openai library can target streaming with the Xef server.

@javipacheco javipacheco marked this pull request as ready for review September 6, 2023 13:44
Copy link
Contributor

@javipacheco javipacheco left a comment

Choose a reason for hiding this comment

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

🚀 LGTM!

@raulraja
Copy link
Contributor Author

raulraja commented Sep 6, 2023

I guess we'll merge this after fixing the CORS biz and open a new Pr just for the streaming portion

@raulraja raulraja merged commit 5c2d9e4 into main Sep 6, 2023
5 checks passed
@raulraja raulraja deleted the server-web-use-openai-client-with-xef-server branch September 6, 2023 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants