Skip to content

Commit

Permalink
_
Browse files Browse the repository at this point in the history
  • Loading branch information
xtsea authored Jul 27, 2024
1 parent c23da93 commit 4b3d26c
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,37 +41,6 @@ Rendy@Ubuntu~ $ nano .env
Rendy@Ubuntu~ $ python3 bot.py
```

### Example payload

```python
# chatGPT-3

payload = {
"model": "text-davinci-003",
"prompt": "Hello World",
"max_tokens": 200,
"temperature": 0,
"top_p": 1,
"n": 1,
"stream": False,
"logprobs": None,
"stop": None
}

headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {OPENAI_API}"
}

url = "https://api.openai.com/v1/completions"

response = requests.post(url, json=payload, headers=headers)
data_example = response.json()

message_text = data_example["choices"][0]["text"]

await message.edit_text(message_text) # await or client.send_message(message.chat.id, message_text, reply_to_message_id=message.id)
```
### Library
* [Dan](https://github.com/pyrogram) For [Pyrogram](https://github.com/pyrogram/pyrogram)

Expand Down

0 comments on commit 4b3d26c

Please sign in to comment.