missuo / FreeGPT35

Utilize the unlimited free GPT-3.5-Turbo API service provided by the login-free ChatGPT Web.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

python client can not be used.

OpenJarvisAI opened this issue · comments

Since

client = OpenAI(
        api_key="sk-fwref", base_url=base_url
    )

    a = client.models.list()

the Client will call base_url model list inside to connect, but it cannot return a response, how to make it work with python client?

import openai

openai.api_key = 'anything'
openai.base_url = "http://localhost:3040/v1/"

completion = openai.chat.completions.create(
	model="gpt-3.5-turbo",
	messages=[
		{"role": "user", "content": "Hello"},
	],
)

print(completion.choices[0].message.content)