gpt4free/testing/test_chat_completion.py

17 lines
324 B
Python
Raw Normal View History

2023-07-28 13:07:17 +03:00
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).parent.parent))
import g4f
stream = False
response = g4f.ChatCompletion.create(
model="gpt-3.5-turbo",
2023-08-17 16:46:50 +03:00
provider=g4f.Provider.Ails,
2023-07-28 13:07:17 +03:00
messages=[{"role": "user", "content": "hello"}],
stream=stream,
active_server=5,
)
2023-08-17 16:02:19 +03:00
print(response)