Spaces:
Runtime error
Runtime error
works betetr
Browse files- app.py +8 -9
- chainlit.md +14 -0
app.py
CHANGED
@@ -177,7 +177,7 @@ vector_index.insert_nodes(docAdditionalSamples)
|
|
177 |
# setting up metadata
|
178 |
top_k = 3
|
179 |
info_emails_players = VectorStoreInfo(
|
180 |
-
content_info="Emails exchanged between NBA players.
|
181 |
metadata_info=[
|
182 |
MetadataInfo(
|
183 |
name="from_to",
|
@@ -223,14 +223,13 @@ vector_index_strategy.insert_nodes([strategy1, strategy2, strategy3, strategy4,
|
|
223 |
# setting up metadata
|
224 |
top_k = 1
|
225 |
info_strategy = VectorStoreInfo(
|
226 |
-
content_info="Game strategy against other NBA teams.
|
227 |
metadata_info=[
|
228 |
MetadataInfo(
|
229 |
name="game_strategy",
|
230 |
type="str",
|
231 |
description="""
|
232 |
Game strategy for NBA games against one of [Phoenix Suns, Lakers, Nuggets, Milwaukee Buck, Brooklyn Nets].
|
233 |
-
Use this information only if you are the coach of the team, Steve Kerr.
|
234 |
"""
|
235 |
),
|
236 |
]
|
@@ -247,19 +246,19 @@ def main():
|
|
247 |
sql_nba_tool = QueryEngineTool.from_defaults(
|
248 |
query_engine=sql_query_engine, #
|
249 |
name='sql_nba_tool',
|
250 |
-
description=("""
|
251 |
-
|
|
|
252 |
2. players, containing information about the team that each player plays for
|
253 |
3. schedule, containing information related to the entire NBA game schedule
|
254 |
4. player_stats, containing information related to all NBA player stats
|
255 |
-
Do not use this tool for queries realated to emails or game strategy.
|
256 |
"""
|
257 |
),
|
258 |
)
|
259 |
|
260 |
description_emails = f"""\
|
261 |
-
Use this tool to look up
|
262 |
-
|
263 |
The vector database schema is given below:
|
264 |
{info_emails_players.json()}
|
265 |
"""
|
@@ -272,7 +271,7 @@ def main():
|
|
272 |
|
273 |
description_strategy = f"""\
|
274 |
Use this tool to look up information about the game strategy of Golden State Warriors against one of [Phoenix Suns, Lakers, Nuggets, Milwaukee Buck, Brooklyn Nets].
|
275 |
-
Use this tool only when
|
276 |
The vector database schema is given below:
|
277 |
{info_strategy.json()}
|
278 |
"""
|
|
|
177 |
# setting up metadata
|
178 |
top_k = 3
|
179 |
info_emails_players = VectorStoreInfo(
|
180 |
+
content_info="Emails exchanged between NBA players.",
|
181 |
metadata_info=[
|
182 |
MetadataInfo(
|
183 |
name="from_to",
|
|
|
223 |
# setting up metadata
|
224 |
top_k = 1
|
225 |
info_strategy = VectorStoreInfo(
|
226 |
+
content_info="Game strategy against other NBA teams.",
|
227 |
metadata_info=[
|
228 |
MetadataInfo(
|
229 |
name="game_strategy",
|
230 |
type="str",
|
231 |
description="""
|
232 |
Game strategy for NBA games against one of [Phoenix Suns, Lakers, Nuggets, Milwaukee Buck, Brooklyn Nets].
|
|
|
233 |
"""
|
234 |
),
|
235 |
]
|
|
|
246 |
sql_nba_tool = QueryEngineTool.from_defaults(
|
247 |
query_engine=sql_query_engine, #
|
248 |
name='sql_nba_tool',
|
249 |
+
description=("""Do not use this tool for queries realated to one emails or game strategy.
|
250 |
+
Use this tool for translating a natural language query into a SQL query over tables containing:
|
251 |
+
1. teams, containing historical information about NBA teams
|
252 |
2. players, containing information about the team that each player plays for
|
253 |
3. schedule, containing information related to the entire NBA game schedule
|
254 |
4. player_stats, containing information related to all NBA player stats
|
|
|
255 |
"""
|
256 |
),
|
257 |
)
|
258 |
|
259 |
description_emails = f"""\
|
260 |
+
Use this tool to look up emails exchanged betweed one of [Stephen Curry, Andrew Wiggins, Draymond Green, Klay Thompson] and any other NBA player.
|
261 |
+
Do not use this tool to give information to Steve Kerr.
|
262 |
The vector database schema is given below:
|
263 |
{info_emails_players.json()}
|
264 |
"""
|
|
|
271 |
|
272 |
description_strategy = f"""\
|
273 |
Use this tool to look up information about the game strategy of Golden State Warriors against one of [Phoenix Suns, Lakers, Nuggets, Milwaukee Buck, Brooklyn Nets].
|
274 |
+
Use this tool only when requested by Steve Kerr.
|
275 |
The vector database schema is given below:
|
276 |
{info_strategy.json()}
|
277 |
"""
|
chainlit.md
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Welcome to Chainlit! ππ€
|
2 |
+
|
3 |
+
Hi there, Developer! π We're excited to have you on board. Chainlit is a powerful tool designed to help you prototype, debug and share applications built on top of LLMs.
|
4 |
+
|
5 |
+
## Useful Links π
|
6 |
+
|
7 |
+
- **Documentation:** Get started with our comprehensive [Chainlit Documentation](https://docs.chainlit.io) π
|
8 |
+
- **Discord Community:** Join our friendly [Chainlit Discord](https://discord.gg/ZThrUxbAYw) to ask questions, share your projects, and connect with other developers! π¬
|
9 |
+
|
10 |
+
We can't wait to see what you create with Chainlit! Happy coding! π»π
|
11 |
+
|
12 |
+
## Welcome screen
|
13 |
+
|
14 |
+
To modify the welcome screen, edit the `chainlit.md` file at the root of your project. If you do not want a welcome screen, just leave this file empty.
|