forked from jhinericusername/waterview
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpalm.py
More file actions
27 lines (20 loc) · 669 Bytes
/
palm.py
File metadata and controls
27 lines (20 loc) · 669 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import google.generativeai as palm
API_KEY = ""
palm.configure(api_key=API_KEY)
examples = [
("Hello!", "Hi there!"),
("How are you doing", "I am doing well! How are you feeling today?"),
]
prompt = input("Welcome to the chatbot! Please chat with me about anything! \n")
response = palm.chat(
messages=prompt,
temperature=1,
context="Speak like a therapy chatbot - ask a question related to the conversation as needed, but be empathetic and kind",
examples=examples,
)
for message in response.messages:
print(message["author"], message["content"])
while True:
s = input()
response = response.reply(s)
print(response.last)