summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--testing/test.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/testing/test.py b/testing/test.py
new file mode 100644
index 00000000..727b92ac
--- /dev/null
+++ b/testing/test.py
@@ -0,0 +1,13 @@
+import g4f
+
+# Set with provider
+stream = False
+response = g4f.ChatCompletion.create(model='gpt-3.5-turbo', provider=g4f.Provider.ChatgptLogin, messages=[
+ {"role": "user", "content": "hello"}], stream=stream)
+
+if stream:
+ for message in response:
+ print(message)
+else:
+ print(response)
+