-
Notifications
You must be signed in to change notification settings - Fork 172
Expand file tree
/
Copy pathbasic.py
More file actions
39 lines (35 loc) · 909 Bytes
/
basic.py
File metadata and controls
39 lines (35 loc) · 909 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
28
29
30
31
32
33
34
35
36
37
38
39
from agently import Agently
agent = Agently.create_agent()
user_input = "Hello"
welcome_words = {
"Hello": "Welcome word in English",
"你好": "Welcome word in Chinese",
"こんにちは": "Welcome word in Japanese",
"Bonjour": "Welcome word in French",
"Hola": "Welcome word in Spanish",
}
(
agent.input({"user_input": user_input})
.info(welcome_words)
.instruct(
[
"Judge user's region according {user_input}",
"Use {info} to help",
]
)
.examples(
[
{"user_input": "Hello", "user_region": "UK / US"},
{"user_input": "你好", "user_region": "China"},
]
)
.output(
{
"why": (str, "explanation"),
"user_region": (str,),
}
)
)
print(agent.prompt.to_messages()[0]["content"])
print("==================")
print(agent.prompt.to_text())