forked from googleforgames/homerun
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.app.toml.template
More file actions
193 lines (174 loc) · 3.34 KB
/
config.app.toml.template
File metadata and controls
193 lines (174 loc) · 3.34 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
[vllm]
vllm_model_name="google/gemma-3-27b-it"
vllm_host = ""
[game]
game_id = "baseball"
enable_validator = "False"
[npc]
RESPONSE_LANGUAGE = "en-US"
[sql]
QUERY_SCENE = """
select scene_id, scene, status, goal, npcs, knowledge, game_id from smartnpc.scene
where scene_id=:scene_id and game_id=:game_id
"""
QUERY_NPC_BY_ID = """
select npc_id, game_id, background, name, class, class_level, status, lore_level from smartnpc.npc
where npc_id=:npc_id and game_id=:game_id
"""
QUERY_NPC_KNOWLEDGE = """
select background_id,
background_name,
content,
lore_level,
background,
(1 - (background_embeddings <=> :query_embeddings)) as score
from games.world_background
where lore_level <= :lore_level
order by score desc
limit 5
"""
QUERY_SEARCH_QUESTS_ALL = """
select
game_id,
quest_id,
quest_story,
min_level,
metadata,
quest_name,
provider_id
from games.quests
where provider_id = :provider_id and game_id=:game_id
limit 5
"""
QUERY_SEARCH_QUESTS = """
select
game_id,
quest_id,
quest_story,
min_level,
metadata,
quest_name,
provider_id,
(1 - (quest_embeddings <=> :query_embeddings)) as score
from games.quests
where provider_id = :provider_id and game_id=:game_id
order by (1 - (quest_embeddings <=> :query_embeddings)) desc
limit 5
"""
QUERY_PROMPT_TEMPLATE = """
SELECT prompt_id,
scene_id,
game_id,
prompt_template,
is_activate
FROM smartnpc.prompt_template
WHERE
is_activate = True and
prompt_id=:prompt_id and
game_id=:game_id and
CASE
WHEN scene_id = :scene_id THEN scene_id
ELSE 'default'
END = scene_id;
"""
QUERY_CONV_EXAMPLE = """
select
example_id,
game_id,
scene_id,
conversation_example,
is_activate
from smartnpc.conversation_examples
where
game_id=:game_id and
CASE
WHEN scene_id = :scene_id THEN scene_id
ELSE 'default'
END = scene_id
and
CASE
WHEN example_id = :example_id THEN example_id
ELSE 'default'
END = example_id;
"""
[baseball]
QUERY_TEAM = """
select team_id,
team_name,
team_year,
description,
roster,
default_lineup
from smartnpc.teams
where team_id=:team_id
"""
QUERY_TEAMS = """
select team_id,
team_name,
team_year,
description,
roster,
default_lineup
from smartnpc.teams
"""
QUERY_TEAM_ROSTER = """
select team_id,
session_id,
player_id,
roster
from smartnpc.rosters
where
team_id=:team_id And
session_id=:session_id And
player_id=:player_id
"""
QUERY_TEAM_LINEUP = """
select
team_id,
player_id,
session_id,
lineup
from smartnpc.lineup
where
team_id=:team_id And
session_id=:session_id And
player_id=:player_id
"""
UPSERT_TEAM_LINEUP = """
INSERT INTO smartnpc.lineup(
team_id,
player_id,
session_id,
lineup
)
values(
:team_id,
:player_id,
:session_id,
:lineup
)
ON CONFLICT(team_id, player_id)
DO UPDATE SET
session_id = :session_id,
lineup = :lineup;
"""
UPSERT_TEAM_ROSTER = """
INSERT INTO smartnpc.rosters(
team_id,
session_id,
player_id,
roster
)
values(
:team_id,
:session_id,
:player_id,
:roster
)
ON CONFLICT(team_id, session_id)
DO UPDATE SET
player_id = :player_id,
team_id=:team_id,
session_id=:session_id,
roster = :roster;
"""