Skip to content

Commit 9e98c69

Browse files
committed
initial commit
1 parent f7760b5 commit 9e98c69

File tree

3 files changed

+52
-1
lines changed

3 files changed

+52
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,5 @@ cython_debug/
158158
# and can be added to the global gitignore or merged into this file. For a more nuclear
159159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160160
#.idea/
161+
myenv/
162+
.env

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,36 @@
11
# terminal_chat
2-
Terminal Chat with BARD
2+
Terminal Chat with BARD using [BARD API](https://github.com/dsdanielpark/Bard-API)
3+
- Get your BARD_API_KEY as instructed in the link above.
4+
5+
![image](https://github.com/pj8912/terminal_chat/assets/59218902/b7548d55-f5a0-4fc8-a77f-029aa3037e9a)
6+
7+
8+
## Install
9+
### Clone
10+
```
11+
git clone https://github.com/pj8912/terminal_chat.git
12+
```
13+
### Install Requirements
14+
```
15+
pip install -r requirements.txt
16+
```
17+
### BARD_API_KEY
18+
- put your `BARD_API_KEY` on .env file
19+
- eg: `.env`
20+
```
21+
BARD_API_KEY=your_bardapi_key
22+
```
23+
## Start
24+
```
25+
python app.py
26+
```
27+
28+
## LICENSE
29+
This project is licensed under the MIT License.
30+
31+
## Support :handshake:
32+
This is a simple in-terminal chat with `bard` built using `BARD API` and Python. If you find my work helpful please consider supporting me by donating. Your support helps me continue to create and share useful projects with the community. Thank you for your generosity and support!
33+
:handshake:
34+
35+
36+
<a href="https://www.buymeacoffee.com/gjohnpinto" target="_blank" align="center"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>

app.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import os
2+
from dotenv import load_dotenv
3+
from bardapi import Bard
4+
load_dotenv()
5+
6+
os.environ['_BARD_API_KEY'] = os.getenv("BARD_API_KEY")
7+
8+
bard = Bard()
9+
10+
print('*'*50,'Terminal Chat with BARD','*'*50, '\n')
11+
while True:
12+
user_input = input('\U0001F464 You: ')
13+
print('')
14+
print('\U0001F916 Bard:', bard.get_answer(user_input)['content'])
15+
print('-'*90, "\n")

0 commit comments

Comments
 (0)