summaryrefslogtreecommitdiffstats
path: root/testing/test_chat_completion.py
blob: cc705f07ef3c5279f6dad021a07581af530601cd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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",
    provider=g4f.provider.Ails,
    messages=[{"role": "user", "content": "hello"}],
    stream=stream,
    active_server=5,
)

print(response)