diff options
author | noptuno <repollo.marrero@gmail.com> | 2023-04-28 02:40:47 +0200 |
---|---|---|
committer | noptuno <repollo.marrero@gmail.com> | 2023-04-28 02:40:47 +0200 |
commit | 6f6a73987201c9c303047c61389b82ad98b15597 (patch) | |
tree | bf67eb590d49979d6740bc1e94b4018df48bce98 /testing/writesonic_test.py | |
parent | Resolved merge conflicts and merged pr_218 into STREAMLIT_CHAT_IMPLEMENTATION (diff) | |
parent | Merging PR_218 openai_rev package with new streamlit chat app (diff) | |
download | gpt4free-6f6a73987201c9c303047c61389b82ad98b15597.tar gpt4free-6f6a73987201c9c303047c61389b82ad98b15597.tar.gz gpt4free-6f6a73987201c9c303047c61389b82ad98b15597.tar.bz2 gpt4free-6f6a73987201c9c303047c61389b82ad98b15597.tar.lz gpt4free-6f6a73987201c9c303047c61389b82ad98b15597.tar.xz gpt4free-6f6a73987201c9c303047c61389b82ad98b15597.tar.zst gpt4free-6f6a73987201c9c303047c61389b82ad98b15597.zip |
Diffstat (limited to 'testing/writesonic_test.py')
-rw-r--r-- | testing/writesonic_test.py | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/testing/writesonic_test.py b/testing/writesonic_test.py index 5c68bbe0..aff847f0 100644 --- a/testing/writesonic_test.py +++ b/testing/writesonic_test.py @@ -4,17 +4,14 @@ import writesonic # create account (3-4s) account = writesonic.Account.create(logging=True) -# with loging: +# 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) # simple completion -response = writesonic.Completion.create( - api_key=account.key, - prompt='hello world' -) +response = writesonic.Completion.create(api_key=account.key, prompt='hello world') print(response.completion.choices[0].text) # Hello! How may I assist you today? @@ -24,16 +21,7 @@ response = writesonic.Completion.create( api_key=account.key, prompt='what is my name ?', enable_memory=True, - history_data=[ - { - 'is_sent': True, - 'message': 'my name is Tekky' - }, - { - 'is_sent': False, - 'message': 'hello Tekky' - } - ] + history_data=[{'is_sent': True, 'message': 'my name is Tekky'}, {'is_sent': False, 'message': 'hello Tekky'}], ) print(response.completion.choices[0].text) # Your name is Tekky. @@ -41,9 +29,7 @@ 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 ... |