dennis111 commited on
Commit
7aecfc7
·
1 Parent(s): e0d0994
Files changed (2) hide show
  1. app.py +3 -1
  2. playground_api.ipynb +44 -12
app.py CHANGED
@@ -9,6 +9,7 @@ import time
9
  import base64
10
 
11
  from agent import *
 
12
 
13
  # (Keep Constants as is)
14
  # --- Constants ---
@@ -81,7 +82,8 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
81
  # 2. Fetch Questions
82
  print(f"Fetching questions from: {questions_url}")
83
  try:
84
- response = requests.get(questions_url, timeout=15)
 
85
  response.raise_for_status()
86
  questions_data = response.json()
87
  #with open('data.json', 'r') as json_file:
 
9
  import base64
10
 
11
  from agent import *
12
+ from app_playground import response
13
 
14
  # (Keep Constants as is)
15
  # --- Constants ---
 
82
  # 2. Fetch Questions
83
  print(f"Fetching questions from: {questions_url}")
84
  try:
85
+ #response = requests.get(questions_url, timeout=15)
86
+ response = requests.get("https://agents-course-unit4-scoring.hf.space/questions", timeout=20)
87
  response.raise_for_status()
88
  questions_data = response.json()
89
  #with open('data.json', 'r') as json_file:
playground_api.ipynb CHANGED
@@ -6,22 +6,24 @@
6
  "metadata": {
7
  "collapsed": true,
8
  "ExecuteTime": {
9
- "end_time": "2025-04-28T10:20:39.218680Z",
10
- "start_time": "2025-04-28T10:20:38.130341Z"
11
  }
12
  },
13
  "source": [
14
  "import pandas as pd\n",
15
- "import requests"
 
 
16
  ],
17
  "outputs": [],
18
- "execution_count": 1
19
  },
20
  {
21
  "metadata": {
22
  "ExecuteTime": {
23
- "end_time": "2025-04-28T10:20:40.018709Z",
24
- "start_time": "2025-04-28T10:20:39.500022Z"
25
  }
26
  },
27
  "cell_type": "code",
@@ -35,17 +37,23 @@
35
  ],
36
  "id": "bdd1221c22a2e327",
37
  "outputs": [],
38
- "execution_count": 2
39
  },
40
  {
41
  "metadata": {
42
  "ExecuteTime": {
43
- "end_time": "2025-04-28T10:46:17.105941Z",
44
- "start_time": "2025-04-28T10:46:17.094823Z"
45
  }
46
  },
47
  "cell_type": "code",
48
- "source": "qs",
 
 
 
 
 
 
49
  "id": "c928ddac67198fef",
50
  "outputs": [
51
  {
@@ -133,12 +141,36 @@
133
  " 'file_name': ''}]"
134
  ]
135
  },
136
- "execution_count": 12,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  "metadata": {},
138
  "output_type": "execute_result"
139
  }
140
  ],
141
- "execution_count": 12
142
  },
143
  {
144
  "metadata": {
 
6
  "metadata": {
7
  "collapsed": true,
8
  "ExecuteTime": {
9
+ "end_time": "2025-04-28T15:59:00.275329Z",
10
+ "start_time": "2025-04-28T15:59:00.268550Z"
11
  }
12
  },
13
  "source": [
14
  "import pandas as pd\n",
15
+ "import requests\n",
16
+ "\n",
17
+ "from app_playground import response"
18
  ],
19
  "outputs": [],
20
+ "execution_count": 23
21
  },
22
  {
23
  "metadata": {
24
  "ExecuteTime": {
25
+ "end_time": "2025-04-28T15:59:11.213651Z",
26
+ "start_time": "2025-04-28T15:59:10.507033Z"
27
  }
28
  },
29
  "cell_type": "code",
 
37
  ],
38
  "id": "bdd1221c22a2e327",
39
  "outputs": [],
40
+ "execution_count": 24
41
  },
42
  {
43
  "metadata": {
44
  "ExecuteTime": {
45
+ "end_time": "2025-04-28T16:00:32.565225Z",
46
+ "start_time": "2025-04-28T16:00:32.222567Z"
47
  }
48
  },
49
  "cell_type": "code",
50
+ "source": [
51
+ "response = requests.get(f\"{url}/questions\")\n",
52
+ "response.raise_for_status()\n",
53
+ "questions_data = response.json()\n",
54
+ "questions_data\n",
55
+ "response"
56
+ ],
57
  "id": "c928ddac67198fef",
58
  "outputs": [
59
  {
 
141
  " 'file_name': ''}]"
142
  ]
143
  },
144
+ "execution_count": 27,
145
+ "metadata": {},
146
+ "output_type": "execute_result"
147
+ }
148
+ ],
149
+ "execution_count": 27
150
+ },
151
+ {
152
+ "metadata": {
153
+ "ExecuteTime": {
154
+ "end_time": "2025-04-28T16:01:11.825Z",
155
+ "start_time": "2025-04-28T16:01:11.815026Z"
156
+ }
157
+ },
158
+ "cell_type": "code",
159
+ "source": "type(response)",
160
+ "id": "9c725fc54056cbbb",
161
+ "outputs": [
162
+ {
163
+ "data": {
164
+ "text/plain": [
165
+ "requests.models.Response"
166
+ ]
167
+ },
168
+ "execution_count": 29,
169
  "metadata": {},
170
  "output_type": "execute_result"
171
  }
172
  ],
173
+ "execution_count": 29
174
  },
175
  {
176
  "metadata": {