summaryrefslogtreecommitdiffstats
path: root/testing/deepai_test.py
diff options
context:
space:
mode:
authorading2210 <ading2019@gmail.com>2023-05-18 09:05:09 +0200
committerading2210 <ading2019@gmail.com>2023-05-18 09:07:29 +0200
commit34e042bb3388e261968b2279ac4268cbd89ec193 (patch)
tree7289075609fc1cdffdde7907b3e592abf7472ba2 /testing/deepai_test.py
parentMerge pull request #543 from mitchcapper/analytics_warning_pr (diff)
downloadgpt4free-34e042bb3388e261968b2279ac4268cbd89ec193.tar
gpt4free-34e042bb3388e261968b2279ac4268cbd89ec193.tar.gz
gpt4free-34e042bb3388e261968b2279ac4268cbd89ec193.tar.bz2
gpt4free-34e042bb3388e261968b2279ac4268cbd89ec193.tar.lz
gpt4free-34e042bb3388e261968b2279ac4268cbd89ec193.tar.xz
gpt4free-34e042bb3388e261968b2279ac4268cbd89ec193.tar.zst
gpt4free-34e042bb3388e261968b2279ac4268cbd89ec193.zip
Diffstat (limited to '')
-rw-r--r--testing/deepai_test.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/testing/deepai_test.py b/testing/deepai_test.py
new file mode 100644
index 00000000..474f663e
--- /dev/null
+++ b/testing/deepai_test.py
@@ -0,0 +1,18 @@
+from gpt4free import deepai
+
+#single completion
+for chunk in deepai.Completion.create("Write a list of possible vacation destinations:"):
+ print(chunk, end="", flush=True)
+print()
+
+#chat completion
+print("==============")
+messages = [ #taken from the openai docs
+ {"role": "system", "content": "You are a helpful assistant."},
+ {"role": "user", "content": "Who won the world series in 2020?"},
+ {"role": "assistant", "content": "The Los Angeles Dodgers won the World Series in 2020."},
+ {"role": "user", "content": "Where was it played?"}
+]
+for chunk in deepai.ChatCompletion.create(messages):
+ print(chunk, end="", flush=True)
+print() \ No newline at end of file