dennis111 commited on
Commit
4bae007
·
1 Parent(s): 60e7a59
Files changed (2) hide show
  1. app.py +8 -3
  2. playground_api.ipynb +37 -10
app.py CHANGED
@@ -4,6 +4,7 @@ import requests
4
  import inspect
5
  import pandas as pd
6
  from dotenv import load_dotenv
 
7
 
8
  from agent import *
9
 
@@ -58,9 +59,13 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
58
  # 2. Fetch Questions
59
  print(f"Fetching questions from: {questions_url}")
60
  try:
61
- response = requests.get(questions_url, timeout=15)
62
- response.raise_for_status()
63
- questions_data = response.json()
 
 
 
 
64
  if not questions_data:
65
  print("Fetched questions list is empty.")
66
  return "Fetched questions list is empty or invalid format.", None
 
4
  import inspect
5
  import pandas as pd
6
  from dotenv import load_dotenv
7
+ import json
8
 
9
  from agent import *
10
 
 
59
  # 2. Fetch Questions
60
  print(f"Fetching questions from: {questions_url}")
61
  try:
62
+ # response = requests.get(questions_url, timeout=15)
63
+ # response.raise_for_status()
64
+ # questions_data = response.json()
65
+ with open('data.json', 'r') as json_file:
66
+ data = json.load(json_file)
67
+ questions_data = data
68
+
69
  if not questions_data:
70
  print("Fetched questions list is empty.")
71
  return "Fetched questions list is empty or invalid format.", None
playground_api.ipynb CHANGED
@@ -6,19 +6,19 @@
6
  "metadata": {
7
  "collapsed": true,
8
  "ExecuteTime": {
9
- "end_time": "2025-04-26T15:17:22.192034Z",
10
- "start_time": "2025-04-26T15:17:22.136508Z"
11
  }
12
  },
13
  "source": "import requests",
14
  "outputs": [],
15
- "execution_count": 1
16
  },
17
  {
18
  "metadata": {
19
  "ExecuteTime": {
20
- "end_time": "2025-04-26T15:12:25.936273Z",
21
- "start_time": "2025-04-26T15:12:14.154935Z"
22
  }
23
  },
24
  "cell_type": "code",
@@ -32,13 +32,13 @@
32
  ],
33
  "id": "bdd1221c22a2e327",
34
  "outputs": [],
35
- "execution_count": 2
36
  },
37
  {
38
  "metadata": {
39
  "ExecuteTime": {
40
- "end_time": "2025-04-26T15:12:26.340935Z",
41
- "start_time": "2025-04-26T15:12:26.329838Z"
42
  }
43
  },
44
  "cell_type": "code",
@@ -130,12 +130,12 @@
130
  " 'file_name': ''}]"
131
  ]
132
  },
133
- "execution_count": 3,
134
  "metadata": {},
135
  "output_type": "execute_result"
136
  }
137
  ],
138
- "execution_count": 3
139
  },
140
  {
141
  "metadata": {},
@@ -144,6 +144,33 @@
144
  "execution_count": null,
145
  "source": "How many studio albums were published by Mercedes Sosa between 2000 and 2009 (included)? You can use the latest 2022 version of english wikipedia.",
146
  "id": "c812d96c77189406"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  }
148
  ],
149
  "metadata": {
 
6
  "metadata": {
7
  "collapsed": true,
8
  "ExecuteTime": {
9
+ "end_time": "2025-04-27T20:28:00.825672Z",
10
+ "start_time": "2025-04-27T20:28:00.218100Z"
11
  }
12
  },
13
  "source": "import requests",
14
  "outputs": [],
15
+ "execution_count": 2
16
  },
17
  {
18
  "metadata": {
19
  "ExecuteTime": {
20
+ "end_time": "2025-04-27T20:28:01.422432Z",
21
+ "start_time": "2025-04-27T20:28:00.834200Z"
22
  }
23
  },
24
  "cell_type": "code",
 
32
  ],
33
  "id": "bdd1221c22a2e327",
34
  "outputs": [],
35
+ "execution_count": 3
36
  },
37
  {
38
  "metadata": {
39
  "ExecuteTime": {
40
+ "end_time": "2025-04-27T20:28:02.396476Z",
41
+ "start_time": "2025-04-27T20:28:02.387997Z"
42
  }
43
  },
44
  "cell_type": "code",
 
130
  " 'file_name': ''}]"
131
  ]
132
  },
133
+ "execution_count": 4,
134
  "metadata": {},
135
  "output_type": "execute_result"
136
  }
137
  ],
138
+ "execution_count": 4
139
  },
140
  {
141
  "metadata": {},
 
144
  "execution_count": null,
145
  "source": "How many studio albums were published by Mercedes Sosa between 2000 and 2009 (included)? You can use the latest 2022 version of english wikipedia.",
146
  "id": "c812d96c77189406"
147
+ },
148
+ {
149
+ "metadata": {
150
+ "ExecuteTime": {
151
+ "end_time": "2025-04-27T20:29:07.422117Z",
152
+ "start_time": "2025-04-27T20:29:07.416663Z"
153
+ }
154
+ },
155
+ "cell_type": "code",
156
+ "source": [
157
+ "\n",
158
+ "import json\n",
159
+ "\n",
160
+ "with open('data.json', 'w') as json_file:\n",
161
+ " json.dump(qs, json_file)\n"
162
+ ],
163
+ "id": "87f95c1659ae73de",
164
+ "outputs": [],
165
+ "execution_count": 5
166
+ },
167
+ {
168
+ "metadata": {},
169
+ "cell_type": "code",
170
+ "outputs": [],
171
+ "execution_count": null,
172
+ "source": "",
173
+ "id": "799bcaab50ebff55"
174
  }
175
  ],
176
  "metadata": {