Skip to content
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.

Commit

Permalink
better examples (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
TermuxMonet committed Jul 23, 2023
1 parent f07e92e commit dbd64dd
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ bard () {
}
```

## [Developer Documentation](https://github.com/acheong08/Bard/blob/main/DOCUMENTATION.md)
### Implementation:
```python
from os import environ
from Bard import Chatbot
Expand All @@ -54,9 +54,29 @@ Secure_1PSID = environ.get("BARD__Secure_1PSID")
Secure_1PSIDTS = environ.get("BARD__Secure_1PSIDTS")
chatbot = Chatbot(Secure_1PSID, Secure_1PSIDTS)

chatbot.ask("Hello, how are you?")
answer = chatbot.ask("Hello, how are you?")

print(answer['content']
```

### Async Implementation:
```python
import asyncio
from os import environ
from Bard import AsyncChatbot

Secure_1PSID = environ.get("BARD__Secure_1PSID")
Secure_1PSIDTS = environ.get("BARD__Secure_1PSIDTS")

async def main():
chatbot = await AsyncChatbot.create(Secure_1PSID, Secure_1PSIDTS)
response = await chatbot.ask("Hello, how are you?")
print(response['content'])

asyncio.run(main())
```

## [Developer Documentation](https://github.com/acheong08/Bard/blob/main/DOCUMENTATION.md)

Credits:
- [discordtehe](https://github.com/discordtehe) - Derivative of his original reverse engineering

0 comments on commit dbd64dd

Please sign in to comment.