mirror of https://github.com/xtekky/gpt4free
update usesless, add function to retrieve token
parent
8449728aa3
commit
7f4322e106
@ -1,23 +1,32 @@
|
||||
ai.usesless.com
|
||||
|
||||
to do:
|
||||
### Example: `usesless` <a name="example-usesless"></a>
|
||||
|
||||
- use random user agent in header
|
||||
- make the code better I guess (?)
|
||||
### create account
|
||||
|
||||
### Example: `usesless` <a name="example-usesless"></a>
|
||||
<p>create account first, this will create account.txt that contains mail and token</p>
|
||||
```python
|
||||
import usesless
|
||||
|
||||
usesless.Account.create(logging=True)
|
||||
|
||||
````
|
||||
|
||||
### completion
|
||||
<p>insert token from account.txt</p>
|
||||
|
||||
```python
|
||||
import usesless
|
||||
|
||||
message_id = ""
|
||||
token = <TOKENHERE> # usesless.Account.create(logging=True)
|
||||
while True:
|
||||
prompt = input("Question: ")
|
||||
if prompt == "!stop":
|
||||
break
|
||||
|
||||
req = usesless.Completion.create(prompt=prompt, parentMessageId=message_id)
|
||||
req = usesless.Completion.create(prompt=prompt, parentMessageId=message_id, token=token)
|
||||
|
||||
print(f"Answer: {req['text']}")
|
||||
message_id = req["id"]
|
||||
```
|
||||
````
|
||||
|
@ -0,0 +1,3 @@
|
||||
import usesless
|
||||
|
||||
usesless.Account.create(logging=True)
|
Loading…
Reference in New Issue