diff options
author | t.me/xtekky <98614666+xtekky@users.noreply.github.com> | 2023-04-06 21:57:16 +0200 |
---|---|---|
committer | t.me/xtekky <98614666+xtekky@users.noreply.github.com> | 2023-04-06 21:57:16 +0200 |
commit | 8b4e40d82a7f9def17b88ce9eb522fac4f56cc25 (patch) | |
tree | 8fceb39aa9da9211341bd0110c7f493e96e7992e /README.md | |
parent | updated t3nsor (gpt 3.5) (diff) | |
download | gpt4free-8b4e40d82a7f9def17b88ce9eb522fac4f56cc25.tar gpt4free-8b4e40d82a7f9def17b88ce9eb522fac4f56cc25.tar.gz gpt4free-8b4e40d82a7f9def17b88ce9eb522fac4f56cc25.tar.bz2 gpt4free-8b4e40d82a7f9def17b88ce9eb522fac4f56cc25.tar.lz gpt4free-8b4e40d82a7f9def17b88ce9eb522fac4f56cc25.tar.xz gpt4free-8b4e40d82a7f9def17b88ce9eb522fac4f56cc25.tar.zst gpt4free-8b4e40d82a7f9def17b88ce9eb522fac4f56cc25.zip |
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 58 |
1 files changed, 57 insertions, 1 deletions
@@ -12,6 +12,7 @@ This repository provides reverse-engineered language models from various sources - [`poe`](#example-poe) - [`t3nsor`](#example-t3nsor) - [`ora`](#example-ora) + - [`writesonic`](#example-writesonic) ## Current Sites <a name="current-sites"></a> @@ -158,6 +159,60 @@ while True: print(response.completion.choices[0].text) ``` +### Example: `writesonic` (use like openai pypi package) <a name="example-writesonic"></a> + +```python +# import writesonic +import writesonic + +# create account (3-4s) +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) + +# simple completion +response = writesonic.Completion.create( + api_key = account.key, + prompt = 'hello world' +) + +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 = [ + { + 'is_sent': True, + 'message': 'my name is Tekky' + }, + { + 'is_sent': False, + 'message': 'hello 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 +) + +print(response.completion.choices[0].text) # Argentina won the 2022 FIFA World Cup tournament held in Qatar ... +``` + ## Dependencies The repository is written in Python and requires the following packages: @@ -174,5 +229,6 @@ You can install these packages using the provided `requirements.txt` file. ├── ora/ ├── poe/ ├── t3nsor/ + ├── writesonic/ ├── README.md <-- this file. - └── requirements.txt + └── requirements.txt
\ No newline at end of file |