diff options
author | Aymane Hrouch <jo.aymane@gmail.com> | 2023-04-27 16:43:59 +0200 |
---|---|---|
committer | Aymane Hrouch <jo.aymane@gmail.com> | 2023-04-27 16:43:59 +0200 |
commit | f1594cfddecf2bd47a25d54852834b392eaa4efd (patch) | |
tree | 6fec52831117ee43fe7141a153b7e123ff09d469 /testing/writesonic_test.py | |
parent | Merge pull request #201 from DanielShemesh/patch-4 (diff) | |
download | gpt4free-f1594cfddecf2bd47a25d54852834b392eaa4efd.tar gpt4free-f1594cfddecf2bd47a25d54852834b392eaa4efd.tar.gz gpt4free-f1594cfddecf2bd47a25d54852834b392eaa4efd.tar.bz2 gpt4free-f1594cfddecf2bd47a25d54852834b392eaa4efd.tar.lz gpt4free-f1594cfddecf2bd47a25d54852834b392eaa4efd.tar.xz gpt4free-f1594cfddecf2bd47a25d54852834b392eaa4efd.tar.zst gpt4free-f1594cfddecf2bd47a25d54852834b392eaa4efd.zip |
Diffstat (limited to '')
-rw-r--r-- | testing/writesonic_test.py | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/testing/writesonic_test.py b/testing/writesonic_test.py index e652877d..5c68bbe0 100644 --- a/testing/writesonic_test.py +++ b/testing/writesonic_test.py @@ -2,29 +2,29 @@ import writesonic # create account (3-4s) -account = writesonic.Account.create(logging = True) +account = writesonic.Account.create(logging=True) # with loging: - # 2023-04-06 21:50:25 INFO __main__ -> register success : '{"id":"51aa0809-3053-44f7-922a...' (2s) - # 2023-04-06 21:50:25 INFO __main__ -> id : '51aa0809-3053-44f7-922a-2b85d8d07edf' - # 2023-04-06 21:50:25 INFO __main__ -> token : 'eyJhbGciOiJIUzI1NiIsInR5cCI6Ik...' - # 2023-04-06 21:50:28 INFO __main__ -> got key : '194158c4-d249-4be0-82c6-5049e869533c' (2s) +# 2023-04-06 21:50:25 INFO __main__ -> register success : '{"id":"51aa0809-3053-44f7-922a...' (2s) +# 2023-04-06 21:50:25 INFO __main__ -> id : '51aa0809-3053-44f7-922a-2b85d8d07edf' +# 2023-04-06 21:50:25 INFO __main__ -> token : 'eyJhbGciOiJIUzI1NiIsInR5cCI6Ik...' +# 2023-04-06 21:50:28 INFO __main__ -> got key : '194158c4-d249-4be0-82c6-5049e869533c' (2s) # simple completion response = writesonic.Completion.create( - api_key = account.key, - prompt = 'hello world' + api_key=account.key, + prompt='hello world' ) -print(response.completion.choices[0].text) # Hello! How may I assist you today? +print(response.completion.choices[0].text) # Hello! How may I assist you today? # conversation response = writesonic.Completion.create( - api_key = account.key, - prompt = 'what is my name ?', - enable_memory = True, - history_data = [ + api_key=account.key, + prompt='what is my name ?', + enable_memory=True, + history_data=[ { 'is_sent': True, 'message': 'my name is Tekky' @@ -36,14 +36,14 @@ response = writesonic.Completion.create( ] ) -print(response.completion.choices[0].text) # Your name is Tekky. +print(response.completion.choices[0].text) # Your name is Tekky. # enable internet response = writesonic.Completion.create( - api_key = account.key, - prompt = 'who won the quatar world cup ?', - enable_google_results = True + api_key=account.key, + prompt='who won the quatar world cup ?', + enable_google_results=True ) -print(response.completion.choices[0].text) # Argentina won the 2022 FIFA World Cup tournament held in Qatar ...
\ No newline at end of file +print(response.completion.choices[0].text) # Argentina won the 2022 FIFA World Cup tournament held in Qatar ... |