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

api doesn't work in latest version 0.3.3.3 #2346

Open
hdsz25 opened this issue Nov 12, 2024 · 3 comments
Open

api doesn't work in latest version 0.3.3.3 #2346

hdsz25 opened this issue Nov 12, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@hdsz25
Copy link
Contributor

hdsz25 commented Nov 12, 2024

api doesn't work in latest version 0.3.3.3, when I roll back to 0.3.3.2 then it works!

image

@ricardotran92
Copy link

Hello, If I install by docker as guide, the version will be 0.3.3.3. How can I choose version 03.3.2 for Docker or Windows installation?

@hdsz25
Copy link
Contributor Author

hdsz25 commented Nov 14, 2024

Hello, If I install by docker as guide, the version will be 0.3.3.3. How can I choose version 03.3.2 for Docker or Windows installation?

I don't use docker to install. I directly use pip install:
pip install g4f=='0.3.3.2'

@ricardotran92
Copy link

Hello, If I install by docker as guide, the version will be 0.3.3.3. How can I choose version 03.3.2 for Docker or Windows installation?

I don't use docker to install. I directly use pip install: pip install g4f=='0.3.3.2'

It is nice. However, I think model ChatGPT is not free. When I try to run below code:

from g4f.client import Client
from g4f.Provider import RetryProvider, Phind, FreeChatgpt, Liaobots
import g4f.debug

g4f.debug.logging = True
g4f.debug.version_check = False

client = Client(
provider=RetryProvider([Phind, FreeChatgpt, Liaobots], shuffle=False),
api_key="API from https://platform.openai.com/",
)

try:
response = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[
{
"role": "user",
"content": "Xin chào, bạn sử dụng nền tảng GPT-3?",
# "content": prompts[0],
}
]
)

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

except Exception as e:
print(f"An error occurred: {e}")

Output:

Using RetryProvider provider and gpt-3.5-turbo model
Using FreeChatgpt provider
FreeChatgpt: ClientConnectorError: Cannot connect to host chat.chatgpt.org.uk:443 ssl:default [Connect call failed ('125.235.4.59', 443)]
Using Liaobots provider
Liaobots: RateLimitError: Response 402: Rate limit reached
An error occurred: RetryProvider failed:
FreeChatgpt: ClientConnectorError: Cannot connect to host chat.chatgpt.org.uk:443 ssl:default [Connect call failed ('125.235.4.59', 443)]
Liaobots: RateLimitError: Response 402: Rate limit reached

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants