mrSpectrum commited on
Commit
328a89d
·
verified ·
1 Parent(s): b93edd8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -4
app.py CHANGED
@@ -1,7 +1,42 @@
1
  import gradio as gr
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- demo.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ from utils.bgg import get_game_details, get_hot_games, get_similar_games_v2, search
3
 
 
 
4
 
5
+ search_bgg = gr.Interface(
6
+ fn=search,
7
+ inputs=["text"],
8
+ outputs="json",
9
+ title="Board game geek search",
10
+ description="Search for the board games from Board Game Geek"
11
+ )
12
+
13
+ game_details = gr.Interface(
14
+ fn=get_game_details,
15
+ inputs=["text"],
16
+ outputs="json",
17
+ title="Game Details",
18
+ description="Get detailed information for board games (comma-separated IDs)"
19
+ )
20
+
21
+ hot_games = gr.Interface(
22
+ fn=get_hot_games,
23
+ inputs=[],
24
+ outputs="json",
25
+ title="Hot Games",
26
+ description="Get the list of the top 50 trending games today on Board Game Geek"
27
+ )
28
+
29
+ recommend_games = gr.Interface(
30
+ fn=get_similar_games_v2,
31
+ inputs=["text"],
32
+ outputs="json",
33
+ title="Recommend Games",
34
+ description="Get a list of similar games based on a given game ID"
35
+ )
36
+
37
+ bgg_tools = gr.TabbedInterface(
38
+ [search_bgg, game_details, hot_games, recommend_games],
39
+ ["Search", "Details", "Hot Games", "Recommend Games"]
40
+ )
41
+
42
+ bgg_tools.launch(mcp_server=True)