arre99 commited on
Commit
97a44d4
Β·
1 Parent(s): 6269c32

about page in markdown

Browse files
Files changed (2) hide show
  1. api_playground.ipynb +69 -23
  2. app.py +31 -2
api_playground.ipynb CHANGED
@@ -34,7 +34,7 @@
34
  },
35
  {
36
  "cell_type": "code",
37
- "execution_count": null,
38
  "id": "352270a0",
39
  "metadata": {},
40
  "outputs": [
@@ -53,34 +53,80 @@
53
  "core INFO \tProcessing timing data...\n",
54
  "req INFO \tUsing cached data for weather_data\n",
55
  "req INFO \tUsing cached data for race_control_messages\n",
56
- "core INFO \tFinished loading data for 20 drivers: ['1', '4', '81', '16', '63', '12', '44', '6', '23', '87', '14', '22', '10', '55', '7', '27', '30', '31', '5', '18']\n"
 
57
  ]
58
  },
59
  {
60
  "name": "stdout",
61
  "output_type": "stream",
62
  "text": [
63
- "{'Abbreviation': 'VER',\n",
64
- " 'BroadcastName': 'M VERSTAPPEN',\n",
65
- " 'ClassifiedPosition': '1',\n",
66
- " 'CountryCode': '',\n",
67
- " 'DriverId': 'max_verstappen',\n",
68
- " 'DriverNumber': '1',\n",
69
- " 'FirstName': 'Max',\n",
70
- " 'FullName': 'Max Verstappen',\n",
71
- " 'GridPosition': 1.0,\n",
72
- " 'HeadshotUrl': 'https://media.formula1.com/d_driver_fallback_image.png/content/dam/fom-website/drivers/M/MAXVER01_Max_Verstappen/maxver01.png.transform/1col/image.png',\n",
73
- " 'LastName': 'Verstappen',\n",
74
- " 'Points': 25.0,\n",
75
- " 'Position': 1.0,\n",
76
- " 'Q1': NaT,\n",
77
- " 'Q2': NaT,\n",
78
- " 'Q3': NaT,\n",
79
- " 'Status': 'Finished',\n",
80
- " 'TeamColor': '3671C6',\n",
81
- " 'TeamId': 'red_bull',\n",
82
- " 'TeamName': 'Red Bull Racing',\n",
83
- " 'Time': Timedelta('0 days 01:22:06.983000')}\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  ]
85
  }
86
  ],
 
34
  },
35
  {
36
  "cell_type": "code",
37
+ "execution_count": 16,
38
  "id": "352270a0",
39
  "metadata": {},
40
  "outputs": [
 
53
  "core INFO \tProcessing timing data...\n",
54
  "req INFO \tUsing cached data for weather_data\n",
55
  "req INFO \tUsing cached data for race_control_messages\n",
56
+ "core INFO \tFinished loading data for 20 drivers: ['1', '4', '81', '16', '63', '12', '44', '6', '23', '87', '14', '22', '10', '55', '7', '27', '30', '31', '5', '18']\n",
57
+ "data WARNING \tFailed to generate marker distance information: telemetry data has not been loaded\n"
58
  ]
59
  },
60
  {
61
  "name": "stdout",
62
  "output_type": "stream",
63
  "text": [
64
+ "CircuitInfo(corners= X Y Number Letter Angle Distance\n",
65
+ "0 5954.595977 -6043.797284 1 -359.859187 NaN\n",
66
+ "1 5411.746105 -6985.870033 2 -81.205284 NaN\n",
67
+ "2 3770.348048 -5370.929541 3 -131.304090 NaN\n",
68
+ "3 2554.616588 -4969.478669 4 -304.343564 NaN\n",
69
+ "4 1863.122660 -3634.685488 5 -131.398389 NaN\n",
70
+ "5 343.857125 -3137.336941 6 -311.879680 NaN\n",
71
+ "6 -615.746076 -519.819724 7 -106.459045 NaN\n",
72
+ "7 -3936.654450 -2323.145349 8 -57.888888 NaN\n",
73
+ "8 -5453.049412 -2538.215879 9 -110.431844 NaN\n",
74
+ "9 -6229.209841 449.908978 10 -1.787031 NaN\n",
75
+ "10 -5964.645828 1876.742727 11 -126.423013 NaN\n",
76
+ "11 -7552.525448 119.000613 12 -237.277364 NaN\n",
77
+ "12 -12335.806433 3018.433431 13 -125.951757 NaN\n",
78
+ "13 -13731.830146 2733.425582 14 -201.694648 NaN\n",
79
+ "14 -4974.205293 -1679.808731 15 -254.712390 NaN\n",
80
+ "15 -1819.327067 517.589808 16 -293.925016 NaN\n",
81
+ "16 -1184.012753 429.700268 17 -50.270393 NaN\n",
82
+ "17 332.706500 616.534453 18 -291.606210 NaN,\n",
83
+ " marshal_lights= X Y Number Letter Angle Distance\n",
84
+ "0 1690.855950 -638.228799 1 -319.688225 NaN\n",
85
+ "1 5783.596809 -5462.065134 2 -326.487422 NaN\n",
86
+ "2 4811.098103 -6861.098123 3 -135.071247 NaN\n",
87
+ "3 3613.521255 -5257.354862 4 -300.361781 NaN\n",
88
+ "4 1815.810860 -3592.898831 5 -297.867821 NaN\n",
89
+ "5 198.335929 -2984.219502 6 -140.707699 NaN\n",
90
+ "6 298.955074 -1117.388942 7 -335.948534 NaN\n",
91
+ "7 -1697.196338 -420.240677 8 -260.369093 NaN\n",
92
+ "8 -4279.213479 -2448.991996 9 -80.383553 NaN\n",
93
+ "9 -5705.360349 -2278.848846 10 -161.756206 NaN\n",
94
+ "10 -6223.720506 612.148266 11 -2.135760 NaN\n",
95
+ "11 -6037.625361 1929.727809 12 -295.371985 NaN\n",
96
+ "12 -7620.649284 74.874949 13 -58.450233 NaN\n",
97
+ "13 -10755.257143 583.334425 14 -126.874237 NaN\n",
98
+ "14 -12499.786963 3090.369959 15 -289.937350 NaN\n",
99
+ "15 -13787.721653 2369.387645 16 -170.487671 NaN\n",
100
+ "16 -12375.140308 938.000955 17 -122.280757 NaN\n",
101
+ "17 -10189.779019 -164.943254 18 -109.977438 NaN\n",
102
+ "18 -7499.143789 -1076.181403 19 -109.130546 NaN\n",
103
+ "19 -4733.288295 -1590.501071 20 -68.544674 NaN\n",
104
+ "20 -1984.075069 530.759537 21 -258.330855 NaN\n",
105
+ "21 -86.348618 755.041276 22 -284.607743 NaN,\n",
106
+ " marshal_sectors= X Y Number Letter Angle Distance\n",
107
+ "0 1749.509891 -706.732882 1 -319.461645 NaN\n",
108
+ "1 5890.822450 -5655.136054 2 -343.938801 NaN\n",
109
+ "2 4982.553266 -6958.944675 3 -107.988939 NaN\n",
110
+ "3 3770.348048 -5370.929541 4 -131.463504 NaN\n",
111
+ "4 1886.764195 -3655.599156 5 -311.621063 NaN\n",
112
+ "5 353.981975 -3146.309291 6 -311.728322 NaN\n",
113
+ "6 344.825980 -1220.364548 7 -337.684641 NaN\n",
114
+ "7 -1536.171947 -402.081185 8 -268.084725 NaN\n",
115
+ "8 -4239.222910 -2442.075986 9 -80.307903 NaN\n",
116
+ "9 -5607.722824 -2440.304958 10 -137.786652 NaN\n",
117
+ "10 -6229.209841 449.908978 11 -2.314662 NaN\n",
118
+ "11 -6082.609487 1931.331580 12 -271.786528 NaN\n",
119
+ "12 -7563.880972 111.645273 13 -237.193746 NaN\n",
120
+ "13 -10809.400279 623.878159 14 -306.809173 NaN\n",
121
+ "14 -12457.333265 3075.178205 15 -289.922395 NaN\n",
122
+ "15 -13782.934850 2342.759685 16 -169.348189 NaN\n",
123
+ "16 -12386.562623 945.247835 17 -122.394556 NaN\n",
124
+ "17 -10177.060736 -169.562715 18 -109.850944 NaN\n",
125
+ "18 -7417.936277 -1103.488715 19 -108.299236 NaN\n",
126
+ "19 -4779.517092 -1608.478900 20 -68.926520 NaN\n",
127
+ "20 -1948.165854 534.110177 21 -85.058804 NaN\n",
128
+ "21 53.048886 717.912969 22 -289.674903 NaN,\n",
129
+ " rotation=49.0)\n"
130
  ]
131
  }
132
  ],
app.py CHANGED
@@ -90,14 +90,43 @@ iface_driver_info = gr.Interface(
90
  description="Get personal information about a driver"
91
  )
92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  named_interfaces = {
 
94
  "Driver Championship Standings": iface_driver_championship_standings,
95
  "Constructor Championship Standings": iface_constructor_championship_standings,
96
  "Event Info": iface_event_info,
97
  "Season Calendar": iface_season_calendar,
98
  "Track Visualizations": iface_track_visualization,
99
  "Session Results": iface_session_results,
100
- "Driver Info": iface_driver_info
101
  }
102
 
103
  # Tab names and interfaces
@@ -109,7 +138,7 @@ interface_list = list(named_interfaces.values())
109
  gradio_server = gr.TabbedInterface(
110
  interface_list,
111
  tab_names=tab_names,
112
- title="Formula 1 MCP server"
113
  )
114
 
115
  # Launch the interface and MCP server
 
90
  description="Get personal information about a driver"
91
  )
92
 
93
+ # Create your markdown-only tab using Blocks
94
+ with gr.Blocks() as markdown_tab:
95
+ gr.Markdown("""
96
+ # 🏁 Formula 1 MCP server 🏎️
97
+
98
+ Welcome to the Formula 1 MCP server, your one-stop destination for comprehensive Formula 1 data and visualizations.
99
+ <br>
100
+ This application leverages the FastF1 library to provide detailed insights into Formula 1 races, drivers, and teams.
101
+
102
+ ## Available Tools
103
+
104
+ ### Championship Standings
105
+ - **Driver Championship**: Track driver positions, points, and wins
106
+ - **Constructor Championship**: Monitor team performances and rankings
107
+
108
+ ### Race Information
109
+ - **Event Info**: Get detailed information about specific Grand Prix events
110
+ - **Season Calendar**: View the complete race calendar for any season
111
+ - **Session Results**: Access race, qualifying, and sprint session results
112
+
113
+ ### Driver & Team Data
114
+ - **Driver Info**: View detailed driver profiles and statistics
115
+ - **Track Visualizations**: Explore interactive track maps with speed, gear, and corner data
116
+
117
+ ## Usage
118
+ Use the tabs above to navigate between different sections and explore the wealth of F1 data available at your fingertips.
119
+ """)
120
+
121
  named_interfaces = {
122
+ "About": markdown_tab,
123
  "Driver Championship Standings": iface_driver_championship_standings,
124
  "Constructor Championship Standings": iface_constructor_championship_standings,
125
  "Event Info": iface_event_info,
126
  "Season Calendar": iface_season_calendar,
127
  "Track Visualizations": iface_track_visualization,
128
  "Session Results": iface_session_results,
129
+ "Driver Info": iface_driver_info,
130
  }
131
 
132
  # Tab names and interfaces
 
138
  gradio_server = gr.TabbedInterface(
139
  interface_list,
140
  tab_names=tab_names,
141
+ title="🏁 Formula 1 MCP server 🏎️"
142
  )
143
 
144
  # Launch the interface and MCP server