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

[Feature]: OpenAI api supports NextChat #169

Closed
Luo-hongyi opened this issue Jun 22, 2024 · 10 comments
Closed

[Feature]: OpenAI api supports NextChat #169

Luo-hongyi opened this issue Jun 22, 2024 · 10 comments
Labels
enhancement New feature or request

Comments

@Luo-hongyi
Copy link

NextChat use OPTIONS but not POST:

127.0.0.1:65392 - - [23/Jun/2024:00:30:40] "OPTIONS /v1/chat/completions" 405 31

@snowby666 snowby666 added the enhancement New feature or request label Jun 22, 2024
@snowby666
Copy link
Owner

I've added this in v1.5.7

@Luo-hongyi
Copy link
Author

Still doesn't work:

127.0.0.1:56781 - - [23/Jun/2024:22:49:45] "OPTIONS /v1/chat/completions" 422 82

@snowby666
Copy link
Owner

snowby666 commented Jun 23, 2024

can i see your data request?

@snowby666
Copy link
Owner

This is my test:
image

@snowby666
Copy link
Owner

Your response status is 422 so the request data format may be error:

Example
Correct:

{
	"stream": true,
	"model": "gpt-3.5-turbo",
	"messages": [
                     {"role": "system", "content": "You are a helpful assistant."},
                     {"role": "user", "content": "Who won the world series in 2020?"}
         ]
}

Invalid:

{
	"stream": true,
	"model": "gpt-3.5-turbo",
	"messages": [
                     {"role": "system", "content": "You are a helpful assistant."},
                     {"role": "user", "content": "Who won the world series in 2020?"},
         ]
}

@Luo-hongyi
Copy link
Author

CORS error

/#/:1 Access to fetch at 'http://127.0.0.1:8000/v1/chat/completions' from origin 'https://app.nextchat.dev' 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.

@snowby666
Copy link
Owner

I've updated new version with cors added

@Luo-hongyi
Copy link
Author

It works, thank you!

@Luo-hongyi
Copy link
Author

image

Each API call generated a new conversation in Poe. Is there any possibility of improvement?

@snowby666
Copy link
Owner

For now u can do this instead:
image

I'll add custom config in next version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants