rm notebooks
Browse files- games/angrybirds/notebooks/a.ipynb +0 -0
- games/angrybirds/notebooks/ai_v3.0.ipynb +0 -663
- games/angrybirds/notebooks/ai_v3.5.ipynb +0 -1146
- games/angrybirds/notebooks/ai_v3.7-config.ipynb +0 -844
- games/angrybirds/notebooks/demo.ipynb +0 -502
- games/angrybirds/notebooks/query.ipynb +0 -358
- games/angrybirds/notebooks/rm-pkl2.ipynb +0 -1008
- games/angrybirds/notebooks/sim.ipynb +0 -730
- games/angrybirds/notebooks/test-json.ipynb +0 -1158
- games/angrybirds/notebooks/test.ipynb +0 -1265
- games/angrybirds/notebooks/to_anhang.ipynb +0 -529
- games/angrybirds/notebooks/tok.ipynb +0 -106
- games/snake/notebooks/emb.ipynb +0 -137
- games/snake/notebooks/gen-all.ipynb +0 -0
- games/snake/notebooks/logs.ipynb +0 -0
- games/snake/notebooks/query.ipynb +0 -755
games/angrybirds/notebooks/a.ipynb
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
games/angrybirds/notebooks/ai_v3.0.ipynb
DELETED
|
@@ -1,663 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "code",
|
| 5 |
-
"execution_count": 1,
|
| 6 |
-
"id": "245fbc34-352d-4945-a689-d04f9365bb99",
|
| 7 |
-
"metadata": {},
|
| 8 |
-
"outputs": [],
|
| 9 |
-
"source": [
|
| 10 |
-
"%load_ext autoreload\n",
|
| 11 |
-
"%autoreload 2"
|
| 12 |
-
]
|
| 13 |
-
},
|
| 14 |
-
{
|
| 15 |
-
"cell_type": "code",
|
| 16 |
-
"execution_count": 2,
|
| 17 |
-
"id": "eaed216c-160a-4e31-96fe-015c140ff18b",
|
| 18 |
-
"metadata": {},
|
| 19 |
-
"outputs": [],
|
| 20 |
-
"source": [
|
| 21 |
-
"# from pprint import pprint"
|
| 22 |
-
]
|
| 23 |
-
},
|
| 24 |
-
{
|
| 25 |
-
"cell_type": "code",
|
| 26 |
-
"execution_count": 3,
|
| 27 |
-
"id": "97953551-8ef1-42c1-9317-99d5e65f535e",
|
| 28 |
-
"metadata": {},
|
| 29 |
-
"outputs": [],
|
| 30 |
-
"source": [
|
| 31 |
-
"import json\n",
|
| 32 |
-
"import pandas as pd\n",
|
| 33 |
-
"\n",
|
| 34 |
-
"import openai\n",
|
| 35 |
-
"from openai.embeddings_utils import get_embedding, cosine_similarity\n",
|
| 36 |
-
"\n",
|
| 37 |
-
"# from games.angrybirds.util import util\n",
|
| 38 |
-
"from games.angrybirds.config import config\n",
|
| 39 |
-
"# from games.angrybirds.prompt import prompt\n",
|
| 40 |
-
"# from games.angrybirds.query import query, yes_no_query\n",
|
| 41 |
-
"from games.angrybirds.angrybirds import angrybird"
|
| 42 |
-
]
|
| 43 |
-
},
|
| 44 |
-
{
|
| 45 |
-
"cell_type": "code",
|
| 46 |
-
"execution_count": null,
|
| 47 |
-
"id": "fc213f4c-cb07-468b-b15f-60e5120b3d94",
|
| 48 |
-
"metadata": {},
|
| 49 |
-
"outputs": [],
|
| 50 |
-
"source": []
|
| 51 |
-
},
|
| 52 |
-
{
|
| 53 |
-
"cell_type": "code",
|
| 54 |
-
"execution_count": 88,
|
| 55 |
-
"id": "0c876614-a9bf-4d0b-a728-07770f1ad9c5",
|
| 56 |
-
"metadata": {},
|
| 57 |
-
"outputs": [],
|
| 58 |
-
"source": [
|
| 59 |
-
"bird = angrybird()"
|
| 60 |
-
]
|
| 61 |
-
},
|
| 62 |
-
{
|
| 63 |
-
"cell_type": "code",
|
| 64 |
-
"execution_count": 89,
|
| 65 |
-
"id": "1411de96-97d5-4bac-b8ed-e279fb1edaa0",
|
| 66 |
-
"metadata": {},
|
| 67 |
-
"outputs": [
|
| 68 |
-
{
|
| 69 |
-
"data": {
|
| 70 |
-
"text/plain": [
|
| 71 |
-
"0"
|
| 72 |
-
]
|
| 73 |
-
},
|
| 74 |
-
"execution_count": 89,
|
| 75 |
-
"metadata": {},
|
| 76 |
-
"output_type": "execute_result"
|
| 77 |
-
}
|
| 78 |
-
],
|
| 79 |
-
"source": [
|
| 80 |
-
"len(bird.embeddings)"
|
| 81 |
-
]
|
| 82 |
-
},
|
| 83 |
-
{
|
| 84 |
-
"cell_type": "code",
|
| 85 |
-
"execution_count": 93,
|
| 86 |
-
"id": "163545c6-c707-401a-93b8-fb2cb9d65136",
|
| 87 |
-
"metadata": {},
|
| 88 |
-
"outputs": [
|
| 89 |
-
{
|
| 90 |
-
"name": "stdout",
|
| 91 |
-
"output_type": "stream",
|
| 92 |
-
"text": [
|
| 93 |
-
"initializing...\n",
|
| 94 |
-
"loading embeddings from a file...\n",
|
| 95 |
-
"/Users/shaojun/playgo/abc123/games/angrybirds/../../embeddings.pkl\n",
|
| 96 |
-
"pkl size: 72\n",
|
| 97 |
-
"embedding size: 74\n",
|
| 98 |
-
"creating embeddings by query OpenAI...\n"
|
| 99 |
-
]
|
| 100 |
-
},
|
| 101 |
-
{
|
| 102 |
-
"name": "stderr",
|
| 103 |
-
"output_type": "stream",
|
| 104 |
-
"text": [
|
| 105 |
-
" 0%| | 0/76 [00:00<?, ?it/s]"
|
| 106 |
-
]
|
| 107 |
-
},
|
| 108 |
-
{
|
| 109 |
-
"name": "stdout",
|
| 110 |
-
"output_type": "stream",
|
| 111 |
-
"text": [
|
| 112 |
-
"query Change background volumn...\n"
|
| 113 |
-
]
|
| 114 |
-
},
|
| 115 |
-
{
|
| 116 |
-
"name": "stderr",
|
| 117 |
-
"output_type": "stream",
|
| 118 |
-
"text": [
|
| 119 |
-
"100%|██████████████████████████████████████████| 76/76 [00:00<00:00, 164.48it/s]"
|
| 120 |
-
]
|
| 121 |
-
},
|
| 122 |
-
{
|
| 123 |
-
"name": "stdout",
|
| 124 |
-
"output_type": "stream",
|
| 125 |
-
"text": [
|
| 126 |
-
"embedding size: 75\n"
|
| 127 |
-
]
|
| 128 |
-
},
|
| 129 |
-
{
|
| 130 |
-
"name": "stderr",
|
| 131 |
-
"output_type": "stream",
|
| 132 |
-
"text": [
|
| 133 |
-
"\n"
|
| 134 |
-
]
|
| 135 |
-
}
|
| 136 |
-
],
|
| 137 |
-
"source": [
|
| 138 |
-
"bird.init_emb()"
|
| 139 |
-
]
|
| 140 |
-
},
|
| 141 |
-
{
|
| 142 |
-
"cell_type": "code",
|
| 143 |
-
"execution_count": 94,
|
| 144 |
-
"id": "31c02b28-0078-425d-87b6-702caeea02e3",
|
| 145 |
-
"metadata": {},
|
| 146 |
-
"outputs": [
|
| 147 |
-
{
|
| 148 |
-
"data": {
|
| 149 |
-
"text/plain": [
|
| 150 |
-
"75"
|
| 151 |
-
]
|
| 152 |
-
},
|
| 153 |
-
"execution_count": 94,
|
| 154 |
-
"metadata": {},
|
| 155 |
-
"output_type": "execute_result"
|
| 156 |
-
}
|
| 157 |
-
],
|
| 158 |
-
"source": [
|
| 159 |
-
"len(bird.embeddings)"
|
| 160 |
-
]
|
| 161 |
-
},
|
| 162 |
-
{
|
| 163 |
-
"cell_type": "code",
|
| 164 |
-
"execution_count": 95,
|
| 165 |
-
"id": "9389ebb2-de88-4c23-95ee-c8beb83af600",
|
| 166 |
-
"metadata": {},
|
| 167 |
-
"outputs": [],
|
| 168 |
-
"source": [
|
| 169 |
-
"import pickle"
|
| 170 |
-
]
|
| 171 |
-
},
|
| 172 |
-
{
|
| 173 |
-
"cell_type": "code",
|
| 174 |
-
"execution_count": null,
|
| 175 |
-
"id": "808c1f89-2b7e-4134-a73e-94689f4cce75",
|
| 176 |
-
"metadata": {},
|
| 177 |
-
"outputs": [],
|
| 178 |
-
"source": []
|
| 179 |
-
},
|
| 180 |
-
{
|
| 181 |
-
"cell_type": "code",
|
| 182 |
-
"execution_count": 96,
|
| 183 |
-
"id": "02478e9b-dd11-406a-b405-ea4ee56975b1",
|
| 184 |
-
"metadata": {},
|
| 185 |
-
"outputs": [],
|
| 186 |
-
"source": [
|
| 187 |
-
"import os"
|
| 188 |
-
]
|
| 189 |
-
},
|
| 190 |
-
{
|
| 191 |
-
"cell_type": "code",
|
| 192 |
-
"execution_count": 97,
|
| 193 |
-
"id": "7b506b8c-0b60-44e4-bb6e-f4af8439f04f",
|
| 194 |
-
"metadata": {},
|
| 195 |
-
"outputs": [
|
| 196 |
-
{
|
| 197 |
-
"data": {
|
| 198 |
-
"text/plain": [
|
| 199 |
-
"'/Users/shaojun/playgo/abc123'"
|
| 200 |
-
]
|
| 201 |
-
},
|
| 202 |
-
"execution_count": 97,
|
| 203 |
-
"metadata": {},
|
| 204 |
-
"output_type": "execute_result"
|
| 205 |
-
}
|
| 206 |
-
],
|
| 207 |
-
"source": [
|
| 208 |
-
"root = os.environ['PYTHONPATH']\n",
|
| 209 |
-
"root"
|
| 210 |
-
]
|
| 211 |
-
},
|
| 212 |
-
{
|
| 213 |
-
"cell_type": "code",
|
| 214 |
-
"execution_count": null,
|
| 215 |
-
"id": "30fb4dd7-35d8-442f-bd6e-29e15374e3d6",
|
| 216 |
-
"metadata": {},
|
| 217 |
-
"outputs": [],
|
| 218 |
-
"source": []
|
| 219 |
-
},
|
| 220 |
-
{
|
| 221 |
-
"cell_type": "code",
|
| 222 |
-
"execution_count": 98,
|
| 223 |
-
"id": "c2b17478-f627-4ad4-8efb-aa20690a312d",
|
| 224 |
-
"metadata": {},
|
| 225 |
-
"outputs": [
|
| 226 |
-
{
|
| 227 |
-
"data": {
|
| 228 |
-
"text/plain": [
|
| 229 |
-
"'/Users/shaojun/playgo/abc123/games/angrybirds/notebooks'"
|
| 230 |
-
]
|
| 231 |
-
},
|
| 232 |
-
"execution_count": 98,
|
| 233 |
-
"metadata": {},
|
| 234 |
-
"output_type": "execute_result"
|
| 235 |
-
}
|
| 236 |
-
],
|
| 237 |
-
"source": [
|
| 238 |
-
"pwd"
|
| 239 |
-
]
|
| 240 |
-
},
|
| 241 |
-
{
|
| 242 |
-
"cell_type": "code",
|
| 243 |
-
"execution_count": 99,
|
| 244 |
-
"id": "dd8c489e-cd3f-4df6-81c0-fe3fd2cc0d33",
|
| 245 |
-
"metadata": {},
|
| 246 |
-
"outputs": [],
|
| 247 |
-
"source": [
|
| 248 |
-
"with open(f'{root}/embeddings.pkl', 'wb') as f:\n",
|
| 249 |
-
" pickle.dump(bird.embeddings, f)"
|
| 250 |
-
]
|
| 251 |
-
},
|
| 252 |
-
{
|
| 253 |
-
"cell_type": "code",
|
| 254 |
-
"execution_count": 100,
|
| 255 |
-
"id": "07032487-3fe7-4729-8ca0-c57d6a485c28",
|
| 256 |
-
"metadata": {},
|
| 257 |
-
"outputs": [],
|
| 258 |
-
"source": [
|
| 259 |
-
"with open(f'{root}/embeddings.pkl', 'rb') as f:\n",
|
| 260 |
-
" tmp = pickle.load(f)"
|
| 261 |
-
]
|
| 262 |
-
},
|
| 263 |
-
{
|
| 264 |
-
"cell_type": "code",
|
| 265 |
-
"execution_count": 101,
|
| 266 |
-
"id": "ab7ec218-0e02-4a2b-9c16-ec26704b3519",
|
| 267 |
-
"metadata": {},
|
| 268 |
-
"outputs": [
|
| 269 |
-
{
|
| 270 |
-
"data": {
|
| 271 |
-
"text/plain": [
|
| 272 |
-
"True"
|
| 273 |
-
]
|
| 274 |
-
},
|
| 275 |
-
"execution_count": 101,
|
| 276 |
-
"metadata": {},
|
| 277 |
-
"output_type": "execute_result"
|
| 278 |
-
}
|
| 279 |
-
],
|
| 280 |
-
"source": [
|
| 281 |
-
"tmp == bird.embeddings"
|
| 282 |
-
]
|
| 283 |
-
},
|
| 284 |
-
{
|
| 285 |
-
"cell_type": "code",
|
| 286 |
-
"execution_count": 102,
|
| 287 |
-
"id": "bc896434-21ae-438c-90b1-6b590103e731",
|
| 288 |
-
"metadata": {},
|
| 289 |
-
"outputs": [
|
| 290 |
-
{
|
| 291 |
-
"data": {
|
| 292 |
-
"text/plain": [
|
| 293 |
-
"75"
|
| 294 |
-
]
|
| 295 |
-
},
|
| 296 |
-
"execution_count": 102,
|
| 297 |
-
"metadata": {},
|
| 298 |
-
"output_type": "execute_result"
|
| 299 |
-
}
|
| 300 |
-
],
|
| 301 |
-
"source": [
|
| 302 |
-
"len(tmp)"
|
| 303 |
-
]
|
| 304 |
-
},
|
| 305 |
-
{
|
| 306 |
-
"cell_type": "code",
|
| 307 |
-
"execution_count": 103,
|
| 308 |
-
"id": "9532b604-b7d6-4bd4-a0b9-c8c36470447b",
|
| 309 |
-
"metadata": {},
|
| 310 |
-
"outputs": [
|
| 311 |
-
{
|
| 312 |
-
"data": {
|
| 313 |
-
"text/plain": [
|
| 314 |
-
"75"
|
| 315 |
-
]
|
| 316 |
-
},
|
| 317 |
-
"execution_count": 103,
|
| 318 |
-
"metadata": {},
|
| 319 |
-
"output_type": "execute_result"
|
| 320 |
-
}
|
| 321 |
-
],
|
| 322 |
-
"source": [
|
| 323 |
-
"len(bird.embeddings)"
|
| 324 |
-
]
|
| 325 |
-
},
|
| 326 |
-
{
|
| 327 |
-
"cell_type": "code",
|
| 328 |
-
"execution_count": 41,
|
| 329 |
-
"id": "18888a7b-d32d-45b4-a9b3-3ce29b18a7f7",
|
| 330 |
-
"metadata": {},
|
| 331 |
-
"outputs": [],
|
| 332 |
-
"source": [
|
| 333 |
-
"# sim query"
|
| 334 |
-
]
|
| 335 |
-
},
|
| 336 |
-
{
|
| 337 |
-
"cell_type": "code",
|
| 338 |
-
"execution_count": 42,
|
| 339 |
-
"id": "4703a269-a1c0-48e4-8848-6b5cdb9b814b",
|
| 340 |
-
"metadata": {},
|
| 341 |
-
"outputs": [
|
| 342 |
-
{
|
| 343 |
-
"data": {
|
| 344 |
-
"text/plain": [
|
| 345 |
-
"68"
|
| 346 |
-
]
|
| 347 |
-
},
|
| 348 |
-
"execution_count": 42,
|
| 349 |
-
"metadata": {},
|
| 350 |
-
"output_type": "execute_result"
|
| 351 |
-
}
|
| 352 |
-
],
|
| 353 |
-
"source": [
|
| 354 |
-
"len(bird.embeddings)"
|
| 355 |
-
]
|
| 356 |
-
},
|
| 357 |
-
{
|
| 358 |
-
"cell_type": "code",
|
| 359 |
-
"execution_count": null,
|
| 360 |
-
"id": "567ca6d0-9291-4876-a3a2-77b12576f7f8",
|
| 361 |
-
"metadata": {},
|
| 362 |
-
"outputs": [],
|
| 363 |
-
"source": []
|
| 364 |
-
},
|
| 365 |
-
{
|
| 366 |
-
"cell_type": "code",
|
| 367 |
-
"execution_count": null,
|
| 368 |
-
"id": "de48b250-651c-4183-ad41-506f891d4a7d",
|
| 369 |
-
"metadata": {},
|
| 370 |
-
"outputs": [],
|
| 371 |
-
"source": []
|
| 372 |
-
},
|
| 373 |
-
{
|
| 374 |
-
"cell_type": "code",
|
| 375 |
-
"execution_count": 113,
|
| 376 |
-
"id": "5bf13de5-bc24-4804-8a7b-4fac0bef8799",
|
| 377 |
-
"metadata": {},
|
| 378 |
-
"outputs": [
|
| 379 |
-
{
|
| 380 |
-
"name": "stdout",
|
| 381 |
-
"output_type": "stream",
|
| 382 |
-
"text": [
|
| 383 |
-
"0.9333 14/15\tn\n",
|
| 384 |
-
"[('n', 14), ('y', 1)]\n"
|
| 385 |
-
]
|
| 386 |
-
},
|
| 387 |
-
{
|
| 388 |
-
"data": {
|
| 389 |
-
"text/plain": [
|
| 390 |
-
"'n'"
|
| 391 |
-
]
|
| 392 |
-
},
|
| 393 |
-
"execution_count": 113,
|
| 394 |
-
"metadata": {},
|
| 395 |
-
"output_type": "execute_result"
|
| 396 |
-
}
|
| 397 |
-
],
|
| 398 |
-
"source": [
|
| 399 |
-
"yes_no_query(\n",
|
| 400 |
-
" bird, \n",
|
| 401 |
-
" input_command, \n",
|
| 402 |
-
" \"The game developer mentioned the number of birds he/she wants to add\"\n",
|
| 403 |
-
")"
|
| 404 |
-
]
|
| 405 |
-
},
|
| 406 |
-
{
|
| 407 |
-
"cell_type": "code",
|
| 408 |
-
"execution_count": 110,
|
| 409 |
-
"id": "07fd3efa-ab40-48fb-8cc0-9cb49b9486e4",
|
| 410 |
-
"metadata": {},
|
| 411 |
-
"outputs": [
|
| 412 |
-
{
|
| 413 |
-
"name": "stdout",
|
| 414 |
-
"output_type": "stream",
|
| 415 |
-
"text": [
|
| 416 |
-
"0.5333 8/15\ty\n",
|
| 417 |
-
"[('y', 8), ('n', 7)]\n"
|
| 418 |
-
]
|
| 419 |
-
}
|
| 420 |
-
],
|
| 421 |
-
"source": [
|
| 422 |
-
"s = yes_no_query(\n",
|
| 423 |
-
" bird,\n",
|
| 424 |
-
" input_command, \n",
|
| 425 |
-
" \"\"\"\n",
|
| 426 |
-
"The game developer mentioned big bird, \n",
|
| 427 |
-
"magnet bird, \n",
|
| 428 |
-
"superheavy bird,\n",
|
| 429 |
-
"catapult bird,\n",
|
| 430 |
-
"flash bird,\n",
|
| 431 |
-
"antigravity bird.\n",
|
| 432 |
-
"\"\"\"\n",
|
| 433 |
-
")"
|
| 434 |
-
]
|
| 435 |
-
},
|
| 436 |
-
{
|
| 437 |
-
"cell_type": "code",
|
| 438 |
-
"execution_count": null,
|
| 439 |
-
"id": "549675ad-dadb-48c1-a72a-abc729374c25",
|
| 440 |
-
"metadata": {},
|
| 441 |
-
"outputs": [],
|
| 442 |
-
"source": []
|
| 443 |
-
},
|
| 444 |
-
{
|
| 445 |
-
"cell_type": "code",
|
| 446 |
-
"execution_count": 105,
|
| 447 |
-
"id": "26ac79de-dcda-4fae-99b6-a755667d7340",
|
| 448 |
-
"metadata": {},
|
| 449 |
-
"outputs": [
|
| 450 |
-
{
|
| 451 |
-
"data": {
|
| 452 |
-
"text/plain": [
|
| 453 |
-
"'add six pig'"
|
| 454 |
-
]
|
| 455 |
-
},
|
| 456 |
-
"execution_count": 105,
|
| 457 |
-
"metadata": {},
|
| 458 |
-
"output_type": "execute_result"
|
| 459 |
-
}
|
| 460 |
-
],
|
| 461 |
-
"source": [
|
| 462 |
-
"input_command = 'add six pig'\n",
|
| 463 |
-
"input_command"
|
| 464 |
-
]
|
| 465 |
-
},
|
| 466 |
-
{
|
| 467 |
-
"cell_type": "code",
|
| 468 |
-
"execution_count": 106,
|
| 469 |
-
"id": "963beef6-296d-446a-a9fe-d741faf8712b",
|
| 470 |
-
"metadata": {},
|
| 471 |
-
"outputs": [
|
| 472 |
-
{
|
| 473 |
-
"data": {
|
| 474 |
-
"text/plain": [
|
| 475 |
-
"['OK', ['pig', 'add', {}], 'Add a pig.', 0.978199749271284]"
|
| 476 |
-
]
|
| 477 |
-
},
|
| 478 |
-
"execution_count": 106,
|
| 479 |
-
"metadata": {},
|
| 480 |
-
"output_type": "execute_result"
|
| 481 |
-
}
|
| 482 |
-
],
|
| 483 |
-
"source": [
|
| 484 |
-
"bird.query_emb('add a pig')"
|
| 485 |
-
]
|
| 486 |
-
},
|
| 487 |
-
{
|
| 488 |
-
"cell_type": "code",
|
| 489 |
-
"execution_count": 107,
|
| 490 |
-
"id": "f24b37cd-5d03-4395-8a35-d06e0714c42a",
|
| 491 |
-
"metadata": {},
|
| 492 |
-
"outputs": [
|
| 493 |
-
{
|
| 494 |
-
"data": {
|
| 495 |
-
"text/plain": [
|
| 496 |
-
"['OK',\n",
|
| 497 |
-
" ['pig', 'add', {'quantiy': 6}],\n",
|
| 498 |
-
" 'Please add six pigs.',\n",
|
| 499 |
-
" 0.9358702373920165]"
|
| 500 |
-
]
|
| 501 |
-
},
|
| 502 |
-
"execution_count": 107,
|
| 503 |
-
"metadata": {},
|
| 504 |
-
"output_type": "execute_result"
|
| 505 |
-
}
|
| 506 |
-
],
|
| 507 |
-
"source": [
|
| 508 |
-
"bird.query_emb('add six pig')"
|
| 509 |
-
]
|
| 510 |
-
},
|
| 511 |
-
{
|
| 512 |
-
"cell_type": "code",
|
| 513 |
-
"execution_count": 108,
|
| 514 |
-
"id": "003a4073-81a2-4e64-879e-3b43ffc37042",
|
| 515 |
-
"metadata": {},
|
| 516 |
-
"outputs": [
|
| 517 |
-
{
|
| 518 |
-
"data": {
|
| 519 |
-
"text/plain": [
|
| 520 |
-
"['OK',\n",
|
| 521 |
-
" ['change background', {'args': 'picture'}],\n",
|
| 522 |
-
" 'Change background color',\n",
|
| 523 |
-
" 1.0000000000000002]"
|
| 524 |
-
]
|
| 525 |
-
},
|
| 526 |
-
"execution_count": 108,
|
| 527 |
-
"metadata": {},
|
| 528 |
-
"output_type": "execute_result"
|
| 529 |
-
}
|
| 530 |
-
],
|
| 531 |
-
"source": [
|
| 532 |
-
"bird.query_emb('Change background color')"
|
| 533 |
-
]
|
| 534 |
-
},
|
| 535 |
-
{
|
| 536 |
-
"cell_type": "code",
|
| 537 |
-
"execution_count": 109,
|
| 538 |
-
"id": "1c782904-f139-4db4-b792-a012fb104d1b",
|
| 539 |
-
"metadata": {},
|
| 540 |
-
"outputs": [
|
| 541 |
-
{
|
| 542 |
-
"data": {
|
| 543 |
-
"text/plain": [
|
| 544 |
-
"['OK',\n",
|
| 545 |
-
" ['change background', {'args': 'picture'}],\n",
|
| 546 |
-
" 'Change background picture',\n",
|
| 547 |
-
" 0.9748124378288634]"
|
| 548 |
-
]
|
| 549 |
-
},
|
| 550 |
-
"execution_count": 109,
|
| 551 |
-
"metadata": {},
|
| 552 |
-
"output_type": "execute_result"
|
| 553 |
-
}
|
| 554 |
-
],
|
| 555 |
-
"source": [
|
| 556 |
-
"bird.query_emb('Change background photo')"
|
| 557 |
-
]
|
| 558 |
-
},
|
| 559 |
-
{
|
| 560 |
-
"cell_type": "code",
|
| 561 |
-
"execution_count": 110,
|
| 562 |
-
"id": "d5388d71-bb51-412d-b21e-78816163c4b0",
|
| 563 |
-
"metadata": {},
|
| 564 |
-
"outputs": [
|
| 565 |
-
{
|
| 566 |
-
"data": {
|
| 567 |
-
"text/plain": [
|
| 568 |
-
"['OK',\n",
|
| 569 |
-
" ['change background', {'args': 'picture'}],\n",
|
| 570 |
-
" 'Change background picture',\n",
|
| 571 |
-
" 1.0000000000000002]"
|
| 572 |
-
]
|
| 573 |
-
},
|
| 574 |
-
"execution_count": 110,
|
| 575 |
-
"metadata": {},
|
| 576 |
-
"output_type": "execute_result"
|
| 577 |
-
}
|
| 578 |
-
],
|
| 579 |
-
"source": [
|
| 580 |
-
"bird.query_emb('Change background picture')"
|
| 581 |
-
]
|
| 582 |
-
},
|
| 583 |
-
{
|
| 584 |
-
"cell_type": "code",
|
| 585 |
-
"execution_count": 111,
|
| 586 |
-
"id": "58c6b518-8aad-467b-8a1b-757f17a1a2e3",
|
| 587 |
-
"metadata": {},
|
| 588 |
-
"outputs": [
|
| 589 |
-
{
|
| 590 |
-
"data": {
|
| 591 |
-
"text/plain": [
|
| 592 |
-
"['OK',\n",
|
| 593 |
-
" [['change background', {'args': 'picture'}],\n",
|
| 594 |
-
" ['change background', {'args': 'music'}]],\n",
|
| 595 |
-
" 'Change background',\n",
|
| 596 |
-
" 0.9996814755558403]"
|
| 597 |
-
]
|
| 598 |
-
},
|
| 599 |
-
"execution_count": 111,
|
| 600 |
-
"metadata": {},
|
| 601 |
-
"output_type": "execute_result"
|
| 602 |
-
}
|
| 603 |
-
],
|
| 604 |
-
"source": [
|
| 605 |
-
"bird.query_emb('Change background')"
|
| 606 |
-
]
|
| 607 |
-
},
|
| 608 |
-
{
|
| 609 |
-
"cell_type": "code",
|
| 610 |
-
"execution_count": 112,
|
| 611 |
-
"id": "658907ca-27ba-4c00-9cfa-3abec9e15019",
|
| 612 |
-
"metadata": {},
|
| 613 |
-
"outputs": [
|
| 614 |
-
{
|
| 615 |
-
"data": {
|
| 616 |
-
"text/plain": [
|
| 617 |
-
"['OK',\n",
|
| 618 |
-
" [['change background', {'args': 'music'}],\n",
|
| 619 |
-
" ['change background', {'args': 'volumn'}]],\n",
|
| 620 |
-
" 'Change background sound',\n",
|
| 621 |
-
" 0.931697521066715]"
|
| 622 |
-
]
|
| 623 |
-
},
|
| 624 |
-
"execution_count": 112,
|
| 625 |
-
"metadata": {},
|
| 626 |
-
"output_type": "execute_result"
|
| 627 |
-
}
|
| 628 |
-
],
|
| 629 |
-
"source": [
|
| 630 |
-
"bird.query_emb('Change sound')"
|
| 631 |
-
]
|
| 632 |
-
},
|
| 633 |
-
{
|
| 634 |
-
"cell_type": "code",
|
| 635 |
-
"execution_count": null,
|
| 636 |
-
"id": "c4219d23-5a3e-4b5e-9f57-e2be83e9145b",
|
| 637 |
-
"metadata": {},
|
| 638 |
-
"outputs": [],
|
| 639 |
-
"source": []
|
| 640 |
-
}
|
| 641 |
-
],
|
| 642 |
-
"metadata": {
|
| 643 |
-
"kernelspec": {
|
| 644 |
-
"display_name": "Python 3 (ipykernel)",
|
| 645 |
-
"language": "python",
|
| 646 |
-
"name": "python3"
|
| 647 |
-
},
|
| 648 |
-
"language_info": {
|
| 649 |
-
"codemirror_mode": {
|
| 650 |
-
"name": "ipython",
|
| 651 |
-
"version": 3
|
| 652 |
-
},
|
| 653 |
-
"file_extension": ".py",
|
| 654 |
-
"mimetype": "text/x-python",
|
| 655 |
-
"name": "python",
|
| 656 |
-
"nbconvert_exporter": "python",
|
| 657 |
-
"pygments_lexer": "ipython3",
|
| 658 |
-
"version": "3.11.4"
|
| 659 |
-
}
|
| 660 |
-
},
|
| 661 |
-
"nbformat": 4,
|
| 662 |
-
"nbformat_minor": 5
|
| 663 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
games/angrybirds/notebooks/ai_v3.5.ipynb
DELETED
|
@@ -1,1146 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "code",
|
| 5 |
-
"execution_count": 295,
|
| 6 |
-
"id": "245fbc34-352d-4945-a689-d04f9365bb99",
|
| 7 |
-
"metadata": {},
|
| 8 |
-
"outputs": [
|
| 9 |
-
{
|
| 10 |
-
"name": "stdout",
|
| 11 |
-
"output_type": "stream",
|
| 12 |
-
"text": [
|
| 13 |
-
"The autoreload extension is already loaded. To reload it, use:\n",
|
| 14 |
-
" %reload_ext autoreload\n"
|
| 15 |
-
]
|
| 16 |
-
}
|
| 17 |
-
],
|
| 18 |
-
"source": [
|
| 19 |
-
"%load_ext autoreload\n",
|
| 20 |
-
"%autoreload 2"
|
| 21 |
-
]
|
| 22 |
-
},
|
| 23 |
-
{
|
| 24 |
-
"cell_type": "code",
|
| 25 |
-
"execution_count": 296,
|
| 26 |
-
"id": "eaed216c-160a-4e31-96fe-015c140ff18b",
|
| 27 |
-
"metadata": {},
|
| 28 |
-
"outputs": [],
|
| 29 |
-
"source": [
|
| 30 |
-
"# from pprint import pprint"
|
| 31 |
-
]
|
| 32 |
-
},
|
| 33 |
-
{
|
| 34 |
-
"cell_type": "code",
|
| 35 |
-
"execution_count": 297,
|
| 36 |
-
"id": "97953551-8ef1-42c1-9317-99d5e65f535e",
|
| 37 |
-
"metadata": {},
|
| 38 |
-
"outputs": [],
|
| 39 |
-
"source": [
|
| 40 |
-
"import json\n",
|
| 41 |
-
"import pandas as pd\n",
|
| 42 |
-
"\n",
|
| 43 |
-
"import openai\n",
|
| 44 |
-
"from openai.embeddings_utils import get_embedding, cosine_similarity\n",
|
| 45 |
-
"\n",
|
| 46 |
-
"# from games.angrybirds.util import util\n",
|
| 47 |
-
"from games.angrybirds.config import config\n",
|
| 48 |
-
"# from games.angrybirds.prompt import prompt\n",
|
| 49 |
-
"# from games.angrybirds.query import query, yes_no_query\n",
|
| 50 |
-
"from games.angrybirds.angrybirds import angrybird"
|
| 51 |
-
]
|
| 52 |
-
},
|
| 53 |
-
{
|
| 54 |
-
"cell_type": "code",
|
| 55 |
-
"execution_count": null,
|
| 56 |
-
"id": "fc213f4c-cb07-468b-b15f-60e5120b3d94",
|
| 57 |
-
"metadata": {},
|
| 58 |
-
"outputs": [],
|
| 59 |
-
"source": []
|
| 60 |
-
},
|
| 61 |
-
{
|
| 62 |
-
"cell_type": "code",
|
| 63 |
-
"execution_count": 298,
|
| 64 |
-
"id": "0c876614-a9bf-4d0b-a728-07770f1ad9c5",
|
| 65 |
-
"metadata": {},
|
| 66 |
-
"outputs": [],
|
| 67 |
-
"source": [
|
| 68 |
-
"bird = angrybird()"
|
| 69 |
-
]
|
| 70 |
-
},
|
| 71 |
-
{
|
| 72 |
-
"cell_type": "code",
|
| 73 |
-
"execution_count": 299,
|
| 74 |
-
"id": "1411de96-97d5-4bac-b8ed-e279fb1edaa0",
|
| 75 |
-
"metadata": {},
|
| 76 |
-
"outputs": [
|
| 77 |
-
{
|
| 78 |
-
"data": {
|
| 79 |
-
"text/plain": [
|
| 80 |
-
"0"
|
| 81 |
-
]
|
| 82 |
-
},
|
| 83 |
-
"execution_count": 299,
|
| 84 |
-
"metadata": {},
|
| 85 |
-
"output_type": "execute_result"
|
| 86 |
-
}
|
| 87 |
-
],
|
| 88 |
-
"source": [
|
| 89 |
-
"len(bird.embeddings)"
|
| 90 |
-
]
|
| 91 |
-
},
|
| 92 |
-
{
|
| 93 |
-
"cell_type": "code",
|
| 94 |
-
"execution_count": 300,
|
| 95 |
-
"id": "129403ce-69f4-4f2a-9b22-7b3e36d78f24",
|
| 96 |
-
"metadata": {},
|
| 97 |
-
"outputs": [
|
| 98 |
-
{
|
| 99 |
-
"data": {
|
| 100 |
-
"text/plain": [
|
| 101 |
-
"{}"
|
| 102 |
-
]
|
| 103 |
-
},
|
| 104 |
-
"execution_count": 300,
|
| 105 |
-
"metadata": {},
|
| 106 |
-
"output_type": "execute_result"
|
| 107 |
-
}
|
| 108 |
-
],
|
| 109 |
-
"source": [
|
| 110 |
-
"bird.embeddings"
|
| 111 |
-
]
|
| 112 |
-
},
|
| 113 |
-
{
|
| 114 |
-
"cell_type": "code",
|
| 115 |
-
"execution_count": 301,
|
| 116 |
-
"id": "163545c6-c707-401a-93b8-fb2cb9d65136",
|
| 117 |
-
"metadata": {},
|
| 118 |
-
"outputs": [
|
| 119 |
-
{
|
| 120 |
-
"name": "stdout",
|
| 121 |
-
"output_type": "stream",
|
| 122 |
-
"text": [
|
| 123 |
-
"initializing...\n",
|
| 124 |
-
"loading embeddings from a file...\n",
|
| 125 |
-
"/Users/shaojun/playgo/abc123/embeddings.pkl\n",
|
| 126 |
-
"pkl size: 766\n",
|
| 127 |
-
"embedding size: 766\n",
|
| 128 |
-
"creating embeddings by query OpenAI...\n",
|
| 129 |
-
"query 'move birds'...\n",
|
| 130 |
-
"query 'move pigs'...\n",
|
| 131 |
-
"query 'move houses'...\n",
|
| 132 |
-
"query 'move obstacles'...\n",
|
| 133 |
-
"embedding size: 770\n",
|
| 134 |
-
"train size: 770\n"
|
| 135 |
-
]
|
| 136 |
-
}
|
| 137 |
-
],
|
| 138 |
-
"source": [
|
| 139 |
-
"bird.init_emb()"
|
| 140 |
-
]
|
| 141 |
-
},
|
| 142 |
-
{
|
| 143 |
-
"cell_type": "code",
|
| 144 |
-
"execution_count": 265,
|
| 145 |
-
"id": "31c02b28-0078-425d-87b6-702caeea02e3",
|
| 146 |
-
"metadata": {},
|
| 147 |
-
"outputs": [
|
| 148 |
-
{
|
| 149 |
-
"data": {
|
| 150 |
-
"text/plain": [
|
| 151 |
-
"767"
|
| 152 |
-
]
|
| 153 |
-
},
|
| 154 |
-
"execution_count": 265,
|
| 155 |
-
"metadata": {},
|
| 156 |
-
"output_type": "execute_result"
|
| 157 |
-
}
|
| 158 |
-
],
|
| 159 |
-
"source": [
|
| 160 |
-
"len(bird.embeddings)"
|
| 161 |
-
]
|
| 162 |
-
},
|
| 163 |
-
{
|
| 164 |
-
"cell_type": "code",
|
| 165 |
-
"execution_count": 266,
|
| 166 |
-
"id": "9389ebb2-de88-4c23-95ee-c8beb83af600",
|
| 167 |
-
"metadata": {},
|
| 168 |
-
"outputs": [],
|
| 169 |
-
"source": [
|
| 170 |
-
"import pickle"
|
| 171 |
-
]
|
| 172 |
-
},
|
| 173 |
-
{
|
| 174 |
-
"cell_type": "code",
|
| 175 |
-
"execution_count": null,
|
| 176 |
-
"id": "808c1f89-2b7e-4134-a73e-94689f4cce75",
|
| 177 |
-
"metadata": {},
|
| 178 |
-
"outputs": [],
|
| 179 |
-
"source": []
|
| 180 |
-
},
|
| 181 |
-
{
|
| 182 |
-
"cell_type": "code",
|
| 183 |
-
"execution_count": null,
|
| 184 |
-
"id": "067905b6-b030-4df1-9570-d45885f775eb",
|
| 185 |
-
"metadata": {},
|
| 186 |
-
"outputs": [],
|
| 187 |
-
"source": []
|
| 188 |
-
},
|
| 189 |
-
{
|
| 190 |
-
"cell_type": "code",
|
| 191 |
-
"execution_count": 227,
|
| 192 |
-
"id": "02478e9b-dd11-406a-b405-ea4ee56975b1",
|
| 193 |
-
"metadata": {},
|
| 194 |
-
"outputs": [],
|
| 195 |
-
"source": [
|
| 196 |
-
"import os"
|
| 197 |
-
]
|
| 198 |
-
},
|
| 199 |
-
{
|
| 200 |
-
"cell_type": "code",
|
| 201 |
-
"execution_count": 228,
|
| 202 |
-
"id": "7b506b8c-0b60-44e4-bb6e-f4af8439f04f",
|
| 203 |
-
"metadata": {},
|
| 204 |
-
"outputs": [
|
| 205 |
-
{
|
| 206 |
-
"data": {
|
| 207 |
-
"text/plain": [
|
| 208 |
-
"'/Users/shaojun/playgo/abc123'"
|
| 209 |
-
]
|
| 210 |
-
},
|
| 211 |
-
"execution_count": 228,
|
| 212 |
-
"metadata": {},
|
| 213 |
-
"output_type": "execute_result"
|
| 214 |
-
}
|
| 215 |
-
],
|
| 216 |
-
"source": [
|
| 217 |
-
"root = os.environ['PYTHONPATH']\n",
|
| 218 |
-
"root"
|
| 219 |
-
]
|
| 220 |
-
},
|
| 221 |
-
{
|
| 222 |
-
"cell_type": "code",
|
| 223 |
-
"execution_count": null,
|
| 224 |
-
"id": "e977cf56-3bfc-4c87-884e-58577b3808cd",
|
| 225 |
-
"metadata": {},
|
| 226 |
-
"outputs": [],
|
| 227 |
-
"source": []
|
| 228 |
-
},
|
| 229 |
-
{
|
| 230 |
-
"cell_type": "code",
|
| 231 |
-
"execution_count": 229,
|
| 232 |
-
"id": "30fb4dd7-35d8-442f-bd6e-29e15374e3d6",
|
| 233 |
-
"metadata": {},
|
| 234 |
-
"outputs": [],
|
| 235 |
-
"source": [
|
| 236 |
-
"with open(f'{root}/game_train.json', 'w') as f:\n",
|
| 237 |
-
" json.dump(config.game_train, f, indent=4)"
|
| 238 |
-
]
|
| 239 |
-
},
|
| 240 |
-
{
|
| 241 |
-
"cell_type": "code",
|
| 242 |
-
"execution_count": 230,
|
| 243 |
-
"id": "3c051dbf-d547-4297-8f14-f464e58e9a64",
|
| 244 |
-
"metadata": {},
|
| 245 |
-
"outputs": [],
|
| 246 |
-
"source": [
|
| 247 |
-
"with open(f'{root}/game_train.json', 'r') as f:\n",
|
| 248 |
-
" tmp = json.load(f)"
|
| 249 |
-
]
|
| 250 |
-
},
|
| 251 |
-
{
|
| 252 |
-
"cell_type": "code",
|
| 253 |
-
"execution_count": 231,
|
| 254 |
-
"id": "77789684-e7b1-4e28-b9b7-5fbca3b6d376",
|
| 255 |
-
"metadata": {},
|
| 256 |
-
"outputs": [
|
| 257 |
-
{
|
| 258 |
-
"data": {
|
| 259 |
-
"text/plain": [
|
| 260 |
-
"True"
|
| 261 |
-
]
|
| 262 |
-
},
|
| 263 |
-
"execution_count": 231,
|
| 264 |
-
"metadata": {},
|
| 265 |
-
"output_type": "execute_result"
|
| 266 |
-
}
|
| 267 |
-
],
|
| 268 |
-
"source": [
|
| 269 |
-
"config.game_train == tmp"
|
| 270 |
-
]
|
| 271 |
-
},
|
| 272 |
-
{
|
| 273 |
-
"cell_type": "code",
|
| 274 |
-
"execution_count": null,
|
| 275 |
-
"id": "ce058298-2236-4ede-adca-164d6d1249e1",
|
| 276 |
-
"metadata": {},
|
| 277 |
-
"outputs": [],
|
| 278 |
-
"source": []
|
| 279 |
-
},
|
| 280 |
-
{
|
| 281 |
-
"cell_type": "code",
|
| 282 |
-
"execution_count": 232,
|
| 283 |
-
"id": "dd8c489e-cd3f-4df6-81c0-fe3fd2cc0d33",
|
| 284 |
-
"metadata": {},
|
| 285 |
-
"outputs": [],
|
| 286 |
-
"source": [
|
| 287 |
-
"with open(f'{root}/embeddings.pkl', 'wb') as f:\n",
|
| 288 |
-
" pickle.dump(bird.embeddings, f)"
|
| 289 |
-
]
|
| 290 |
-
},
|
| 291 |
-
{
|
| 292 |
-
"cell_type": "code",
|
| 293 |
-
"execution_count": 233,
|
| 294 |
-
"id": "07032487-3fe7-4729-8ca0-c57d6a485c28",
|
| 295 |
-
"metadata": {},
|
| 296 |
-
"outputs": [],
|
| 297 |
-
"source": [
|
| 298 |
-
"with open(f'{root}/embeddings.pkl', 'rb') as f:\n",
|
| 299 |
-
" tmp = pickle.load(f)"
|
| 300 |
-
]
|
| 301 |
-
},
|
| 302 |
-
{
|
| 303 |
-
"cell_type": "code",
|
| 304 |
-
"execution_count": 234,
|
| 305 |
-
"id": "ab7ec218-0e02-4a2b-9c16-ec26704b3519",
|
| 306 |
-
"metadata": {},
|
| 307 |
-
"outputs": [
|
| 308 |
-
{
|
| 309 |
-
"data": {
|
| 310 |
-
"text/plain": [
|
| 311 |
-
"True"
|
| 312 |
-
]
|
| 313 |
-
},
|
| 314 |
-
"execution_count": 234,
|
| 315 |
-
"metadata": {},
|
| 316 |
-
"output_type": "execute_result"
|
| 317 |
-
}
|
| 318 |
-
],
|
| 319 |
-
"source": [
|
| 320 |
-
"tmp == bird.embeddings"
|
| 321 |
-
]
|
| 322 |
-
},
|
| 323 |
-
{
|
| 324 |
-
"cell_type": "code",
|
| 325 |
-
"execution_count": 235,
|
| 326 |
-
"id": "bc896434-21ae-438c-90b1-6b590103e731",
|
| 327 |
-
"metadata": {},
|
| 328 |
-
"outputs": [
|
| 329 |
-
{
|
| 330 |
-
"data": {
|
| 331 |
-
"text/plain": [
|
| 332 |
-
"471"
|
| 333 |
-
]
|
| 334 |
-
},
|
| 335 |
-
"execution_count": 235,
|
| 336 |
-
"metadata": {},
|
| 337 |
-
"output_type": "execute_result"
|
| 338 |
-
}
|
| 339 |
-
],
|
| 340 |
-
"source": [
|
| 341 |
-
"len(tmp)"
|
| 342 |
-
]
|
| 343 |
-
},
|
| 344 |
-
{
|
| 345 |
-
"cell_type": "code",
|
| 346 |
-
"execution_count": 236,
|
| 347 |
-
"id": "9532b604-b7d6-4bd4-a0b9-c8c36470447b",
|
| 348 |
-
"metadata": {},
|
| 349 |
-
"outputs": [
|
| 350 |
-
{
|
| 351 |
-
"data": {
|
| 352 |
-
"text/plain": [
|
| 353 |
-
"471"
|
| 354 |
-
]
|
| 355 |
-
},
|
| 356 |
-
"execution_count": 236,
|
| 357 |
-
"metadata": {},
|
| 358 |
-
"output_type": "execute_result"
|
| 359 |
-
}
|
| 360 |
-
],
|
| 361 |
-
"source": [
|
| 362 |
-
"len(bird.embeddings)"
|
| 363 |
-
]
|
| 364 |
-
},
|
| 365 |
-
{
|
| 366 |
-
"cell_type": "code",
|
| 367 |
-
"execution_count": 237,
|
| 368 |
-
"id": "18888a7b-d32d-45b4-a9b3-3ce29b18a7f7",
|
| 369 |
-
"metadata": {},
|
| 370 |
-
"outputs": [],
|
| 371 |
-
"source": [
|
| 372 |
-
"# sim query"
|
| 373 |
-
]
|
| 374 |
-
},
|
| 375 |
-
{
|
| 376 |
-
"cell_type": "code",
|
| 377 |
-
"execution_count": 238,
|
| 378 |
-
"id": "4703a269-a1c0-48e4-8848-6b5cdb9b814b",
|
| 379 |
-
"metadata": {},
|
| 380 |
-
"outputs": [
|
| 381 |
-
{
|
| 382 |
-
"data": {
|
| 383 |
-
"text/plain": [
|
| 384 |
-
"471"
|
| 385 |
-
]
|
| 386 |
-
},
|
| 387 |
-
"execution_count": 238,
|
| 388 |
-
"metadata": {},
|
| 389 |
-
"output_type": "execute_result"
|
| 390 |
-
}
|
| 391 |
-
],
|
| 392 |
-
"source": [
|
| 393 |
-
"len(bird.embeddings)"
|
| 394 |
-
]
|
| 395 |
-
},
|
| 396 |
-
{
|
| 397 |
-
"cell_type": "code",
|
| 398 |
-
"execution_count": null,
|
| 399 |
-
"id": "4ff48663-e767-4936-807d-07fb8c42ce92",
|
| 400 |
-
"metadata": {},
|
| 401 |
-
"outputs": [],
|
| 402 |
-
"source": []
|
| 403 |
-
},
|
| 404 |
-
{
|
| 405 |
-
"cell_type": "code",
|
| 406 |
-
"execution_count": 302,
|
| 407 |
-
"id": "567ca6d0-9291-4876-a3a2-77b12576f7f8",
|
| 408 |
-
"metadata": {},
|
| 409 |
-
"outputs": [
|
| 410 |
-
{
|
| 411 |
-
"name": "stdout",
|
| 412 |
-
"output_type": "stream",
|
| 413 |
-
"text": [
|
| 414 |
-
"skip init\n"
|
| 415 |
-
]
|
| 416 |
-
},
|
| 417 |
-
{
|
| 418 |
-
"data": {
|
| 419 |
-
"text/plain": [
|
| 420 |
-
"['OK', ['pig', 'change position', {}], 'move pigs', 0.9765097225482317]"
|
| 421 |
-
]
|
| 422 |
-
},
|
| 423 |
-
"execution_count": 302,
|
| 424 |
-
"metadata": {},
|
| 425 |
-
"output_type": "execute_result"
|
| 426 |
-
}
|
| 427 |
-
],
|
| 428 |
-
"source": [
|
| 429 |
-
"# x = 'i want to add birds'\n",
|
| 430 |
-
"# x = 'Add birds.'\n",
|
| 431 |
-
"# x = 'Add a bird.'\n",
|
| 432 |
-
"# x = 'bird list'\n",
|
| 433 |
-
"# x = 'reduce a bird'\n",
|
| 434 |
-
"x = 'remove a bird'\n",
|
| 435 |
-
"x = 'The game is too difficult. add more birds'\n",
|
| 436 |
-
"# x = 'birds'\n",
|
| 437 |
-
"x = 'reduce a pig'\n",
|
| 438 |
-
"x = 'Add Magnet Bird'\n",
|
| 439 |
-
"x = 'Anti-gravity bird'\n",
|
| 440 |
-
"x = 'move pig'\n",
|
| 441 |
-
"\n",
|
| 442 |
-
"bird.query_emb(x)"
|
| 443 |
-
]
|
| 444 |
-
},
|
| 445 |
-
{
|
| 446 |
-
"cell_type": "code",
|
| 447 |
-
"execution_count": 289,
|
| 448 |
-
"id": "d53944cf-437f-4081-a0ce-3bc67abd67c6",
|
| 449 |
-
"metadata": {},
|
| 450 |
-
"outputs": [],
|
| 451 |
-
"source": [
|
| 452 |
-
"from openai.embeddings_utils import cosine_similarity as openai_cosine_similarity\n"
|
| 453 |
-
]
|
| 454 |
-
},
|
| 455 |
-
{
|
| 456 |
-
"cell_type": "code",
|
| 457 |
-
"execution_count": 292,
|
| 458 |
-
"id": "c90fd66f-5d1b-4ea1-9dfa-801c24469440",
|
| 459 |
-
"metadata": {},
|
| 460 |
-
"outputs": [
|
| 461 |
-
{
|
| 462 |
-
"name": "stdout",
|
| 463 |
-
"output_type": "stream",
|
| 464 |
-
"text": [
|
| 465 |
-
"add one big bird 0.7962442494188581\n",
|
| 466 |
-
"add a big bird 0.7965765066894088\n",
|
| 467 |
-
"add two big birds 0.8103686756491976\n",
|
| 468 |
-
"add three big birds 0.8135757009624476\n",
|
| 469 |
-
"add magnet birds 0.8164196001609102\n",
|
| 470 |
-
"add catapult birds 0.8200955417278051\n",
|
| 471 |
-
"delete magnet birds 0.8216137811946468\n",
|
| 472 |
-
"delete birds 0.8228437232796108\n",
|
| 473 |
-
"add one elderly pig 0.8976585322979147\n",
|
| 474 |
-
"add an elderly pig 0.9035534949298423\n",
|
| 475 |
-
"add elderly pigs 0.9102856910269412\n",
|
| 476 |
-
"add one pig 0.9170617809681969\n",
|
| 477 |
-
"add a pig 0.9257477545332493\n",
|
| 478 |
-
"add pigs 0.9412379122704083\n",
|
| 479 |
-
"change the position of birds 0.8047532670923457\n",
|
| 480 |
-
"change the position of pigs 0.9107673506300684\n",
|
| 481 |
-
"change the position of houses 0.7765230737101322\n",
|
| 482 |
-
"change the position of obstacles 0.7781499359161194\n"
|
| 483 |
-
]
|
| 484 |
-
}
|
| 485 |
-
],
|
| 486 |
-
"source": [
|
| 487 |
-
"imput_emb = bird._compute_emb(x)\n",
|
| 488 |
-
"top_cmd = None\n",
|
| 489 |
-
"top_sim = 0\n",
|
| 490 |
-
"for cmd in bird.embeddings:\n",
|
| 491 |
-
" sim = openai_cosine_similarity(\n",
|
| 492 |
-
" imput_emb, \n",
|
| 493 |
-
" bird.embeddings[cmd],\n",
|
| 494 |
-
" )\n",
|
| 495 |
-
" if cmd.find('position') != -1:\n",
|
| 496 |
-
" print(cmd, sim)\n",
|
| 497 |
-
" if sim == 1.0:\n",
|
| 498 |
-
" continue\n",
|
| 499 |
-
" if sim > top_sim:\n",
|
| 500 |
-
" top_cmd = cmd\n",
|
| 501 |
-
" top_sim = sim\n",
|
| 502 |
-
" print(top_cmd, top_sim)"
|
| 503 |
-
]
|
| 504 |
-
},
|
| 505 |
-
{
|
| 506 |
-
"cell_type": "code",
|
| 507 |
-
"execution_count": 286,
|
| 508 |
-
"id": "18a90c6c-9b5e-4e36-a98b-beb91d2b4e0f",
|
| 509 |
-
"metadata": {},
|
| 510 |
-
"outputs": [
|
| 511 |
-
{
|
| 512 |
-
"data": {
|
| 513 |
-
"text/plain": [
|
| 514 |
-
"('change the position of pigs', 0.946176004901703)"
|
| 515 |
-
]
|
| 516 |
-
},
|
| 517 |
-
"execution_count": 286,
|
| 518 |
-
"metadata": {},
|
| 519 |
-
"output_type": "execute_result"
|
| 520 |
-
}
|
| 521 |
-
],
|
| 522 |
-
"source": [
|
| 523 |
-
"top_cmd, top_sim"
|
| 524 |
-
]
|
| 525 |
-
},
|
| 526 |
-
{
|
| 527 |
-
"cell_type": "code",
|
| 528 |
-
"execution_count": 125,
|
| 529 |
-
"id": "de48b250-651c-4183-ad41-506f891d4a7d",
|
| 530 |
-
"metadata": {},
|
| 531 |
-
"outputs": [
|
| 532 |
-
{
|
| 533 |
-
"data": {
|
| 534 |
-
"text/plain": [
|
| 535 |
-
"['OK',\n",
|
| 536 |
-
" ['pig', 'increase health points', {}],\n",
|
| 537 |
-
" 'the pigs are too weak. increase the hp for them',\n",
|
| 538 |
-
" 1.0]"
|
| 539 |
-
]
|
| 540 |
-
},
|
| 541 |
-
"execution_count": 125,
|
| 542 |
-
"metadata": {},
|
| 543 |
-
"output_type": "execute_result"
|
| 544 |
-
}
|
| 545 |
-
],
|
| 546 |
-
"source": [
|
| 547 |
-
"# x = 'i want to add birds'\n",
|
| 548 |
-
"# x = 'Add birds.'\n",
|
| 549 |
-
"# x = 'Add a bird.'\n",
|
| 550 |
-
"# x = \"bird picture\"\n",
|
| 551 |
-
"x = 'The pigs are too weak. Increase the HP for them'\n",
|
| 552 |
-
"\n",
|
| 553 |
-
"bird.query_emb(x)"
|
| 554 |
-
]
|
| 555 |
-
},
|
| 556 |
-
{
|
| 557 |
-
"cell_type": "code",
|
| 558 |
-
"execution_count": null,
|
| 559 |
-
"id": "f5786cfe-8499-44fc-9220-4f494d2fe8f1",
|
| 560 |
-
"metadata": {},
|
| 561 |
-
"outputs": [],
|
| 562 |
-
"source": []
|
| 563 |
-
},
|
| 564 |
-
{
|
| 565 |
-
"cell_type": "code",
|
| 566 |
-
"execution_count": 126,
|
| 567 |
-
"id": "8a3ff0d8-2220-4b0d-bebd-a048804abc83",
|
| 568 |
-
"metadata": {},
|
| 569 |
-
"outputs": [],
|
| 570 |
-
"source": [
|
| 571 |
-
"from pathlib import Path"
|
| 572 |
-
]
|
| 573 |
-
},
|
| 574 |
-
{
|
| 575 |
-
"cell_type": "code",
|
| 576 |
-
"execution_count": 129,
|
| 577 |
-
"id": "9f0a9d29-0abe-41c5-ac3a-65c73ae5ea20",
|
| 578 |
-
"metadata": {},
|
| 579 |
-
"outputs": [
|
| 580 |
-
{
|
| 581 |
-
"ename": "NameError",
|
| 582 |
-
"evalue": "name '__file__' is not defined",
|
| 583 |
-
"output_type": "error",
|
| 584 |
-
"traceback": [
|
| 585 |
-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
| 586 |
-
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
|
| 587 |
-
"Cell \u001b[0;32mIn[129], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m Path(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mos\u001b[38;5;241m.\u001b[39mpath\u001b[38;5;241m.\u001b[39mdirname(\u001b[38;5;18;43m__file__\u001b[39;49m)\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m/../../embeddings.pkl\u001b[39m\u001b[38;5;124m'\u001b[39m)\n",
|
| 588 |
-
"\u001b[0;31mNameError\u001b[0m: name '__file__' is not defined"
|
| 589 |
-
]
|
| 590 |
-
}
|
| 591 |
-
],
|
| 592 |
-
"source": [
|
| 593 |
-
"Path(f'{os.path.dirname(__file__)}/../../embeddings.pkl')"
|
| 594 |
-
]
|
| 595 |
-
},
|
| 596 |
-
{
|
| 597 |
-
"cell_type": "code",
|
| 598 |
-
"execution_count": 73,
|
| 599 |
-
"id": "4affbcb6-0959-4871-b5e9-dc9a9591ebf7",
|
| 600 |
-
"metadata": {},
|
| 601 |
-
"outputs": [],
|
| 602 |
-
"source": [
|
| 603 |
-
"command = 'add 6 birds'"
|
| 604 |
-
]
|
| 605 |
-
},
|
| 606 |
-
{
|
| 607 |
-
"cell_type": "code",
|
| 608 |
-
"execution_count": 70,
|
| 609 |
-
"id": "d99b6d4d-5b29-4bc6-9731-fad79d4f7643",
|
| 610 |
-
"metadata": {},
|
| 611 |
-
"outputs": [
|
| 612 |
-
{
|
| 613 |
-
"data": {
|
| 614 |
-
"text/plain": [
|
| 615 |
-
"[{'role': 'system', 'content': 'You are a helpful assistant.'},\n",
|
| 616 |
-
" {'role': 'user', 'content': 'add 6 birds'}]"
|
| 617 |
-
]
|
| 618 |
-
},
|
| 619 |
-
"execution_count": 70,
|
| 620 |
-
"metadata": {},
|
| 621 |
-
"output_type": "execute_result"
|
| 622 |
-
}
|
| 623 |
-
],
|
| 624 |
-
"source": [
|
| 625 |
-
"bird._get_full_prompt(command)"
|
| 626 |
-
]
|
| 627 |
-
},
|
| 628 |
-
{
|
| 629 |
-
"cell_type": "code",
|
| 630 |
-
"execution_count": 24,
|
| 631 |
-
"id": "97d52d34-4a29-418a-b16b-ce2343e9f618",
|
| 632 |
-
"metadata": {},
|
| 633 |
-
"outputs": [
|
| 634 |
-
{
|
| 635 |
-
"name": "stdout",
|
| 636 |
-
"output_type": "stream",
|
| 637 |
-
"text": [
|
| 638 |
-
"----------\n",
|
| 639 |
-
"\n",
|
| 640 |
-
"When the user says:\n",
|
| 641 |
-
"\n",
|
| 642 |
-
"'add antigravity birds'\n",
|
| 643 |
-
"\n",
|
| 644 |
-
"Did the user mention antigravity birds?\n",
|
| 645 |
-
"\n",
|
| 646 |
-
"Please answer yes or no.\n",
|
| 647 |
-
"Please do not explain.\n",
|
| 648 |
-
"\n",
|
| 649 |
-
"----------\n",
|
| 650 |
-
"0.8000 12/15\ty\n",
|
| 651 |
-
"[('y', 12), ('n', 3)]\n"
|
| 652 |
-
]
|
| 653 |
-
},
|
| 654 |
-
{
|
| 655 |
-
"data": {
|
| 656 |
-
"text/plain": [
|
| 657 |
-
"'y'"
|
| 658 |
-
]
|
| 659 |
-
},
|
| 660 |
-
"execution_count": 24,
|
| 661 |
-
"metadata": {},
|
| 662 |
-
"output_type": "execute_result"
|
| 663 |
-
}
|
| 664 |
-
],
|
| 665 |
-
"source": [
|
| 666 |
-
"bird.query_chatgpt_yes_no(\n",
|
| 667 |
-
" \"add antigravity birds\", \n",
|
| 668 |
-
" # \"Did the user mention a number?\"\n",
|
| 669 |
-
" \"Did the user mention antigravity birds?\",\n",
|
| 670 |
-
")"
|
| 671 |
-
]
|
| 672 |
-
},
|
| 673 |
-
{
|
| 674 |
-
"cell_type": "code",
|
| 675 |
-
"execution_count": 25,
|
| 676 |
-
"id": "baa47858-baf0-40cf-b4ec-43f4c0a5e303",
|
| 677 |
-
"metadata": {},
|
| 678 |
-
"outputs": [
|
| 679 |
-
{
|
| 680 |
-
"name": "stdout",
|
| 681 |
-
"output_type": "stream",
|
| 682 |
-
"text": [
|
| 683 |
-
"----------\n",
|
| 684 |
-
"\n",
|
| 685 |
-
"When the user says:\n",
|
| 686 |
-
"\n",
|
| 687 |
-
"'add 4 antigrevity birds'\n",
|
| 688 |
-
"\n",
|
| 689 |
-
"Did the user want to add some birds?\n",
|
| 690 |
-
"\n",
|
| 691 |
-
"Please answer yes or no.\n",
|
| 692 |
-
"Please do not explain.\n",
|
| 693 |
-
"\n",
|
| 694 |
-
"----------\n",
|
| 695 |
-
"0.8667 13/15\ty\n",
|
| 696 |
-
"[('y', 13), ('n', 2)]\n"
|
| 697 |
-
]
|
| 698 |
-
},
|
| 699 |
-
{
|
| 700 |
-
"data": {
|
| 701 |
-
"text/plain": [
|
| 702 |
-
"'y'"
|
| 703 |
-
]
|
| 704 |
-
},
|
| 705 |
-
"execution_count": 25,
|
| 706 |
-
"metadata": {},
|
| 707 |
-
"output_type": "execute_result"
|
| 708 |
-
}
|
| 709 |
-
],
|
| 710 |
-
"source": [
|
| 711 |
-
"bird.query_chatgpt_yes_no(\n",
|
| 712 |
-
" \"add 4 antigrevity birds\", \n",
|
| 713 |
-
" # \"Did the user mention a number?\"\n",
|
| 714 |
-
" \"Did the user want to add some birds?\",\n",
|
| 715 |
-
")"
|
| 716 |
-
]
|
| 717 |
-
},
|
| 718 |
-
{
|
| 719 |
-
"cell_type": "code",
|
| 720 |
-
"execution_count": null,
|
| 721 |
-
"id": "e0417f76-71dc-4b47-b5a3-fa1dfafabcf6",
|
| 722 |
-
"metadata": {},
|
| 723 |
-
"outputs": [],
|
| 724 |
-
"source": []
|
| 725 |
-
},
|
| 726 |
-
{
|
| 727 |
-
"cell_type": "code",
|
| 728 |
-
"execution_count": 26,
|
| 729 |
-
"id": "895d4714-e164-46a1-bdbc-21a52af5e2f2",
|
| 730 |
-
"metadata": {},
|
| 731 |
-
"outputs": [
|
| 732 |
-
{
|
| 733 |
-
"name": "stdout",
|
| 734 |
-
"output_type": "stream",
|
| 735 |
-
"text": [
|
| 736 |
-
"----------\n",
|
| 737 |
-
"\n",
|
| 738 |
-
"When the user says:\n",
|
| 739 |
-
"\n",
|
| 740 |
-
"'add 221 antigravity birds'\n",
|
| 741 |
-
"\n",
|
| 742 |
-
"How many birds did the user want to add?\n",
|
| 743 |
-
"\n",
|
| 744 |
-
"Just provide the number in numerical form.\n",
|
| 745 |
-
"Please do not explain.\n",
|
| 746 |
-
"\n",
|
| 747 |
-
"----------\n",
|
| 748 |
-
"1.0000 15/15\t221\n",
|
| 749 |
-
"[('221', 15)]\n"
|
| 750 |
-
]
|
| 751 |
-
},
|
| 752 |
-
{
|
| 753 |
-
"data": {
|
| 754 |
-
"text/plain": [
|
| 755 |
-
"'221'"
|
| 756 |
-
]
|
| 757 |
-
},
|
| 758 |
-
"execution_count": 26,
|
| 759 |
-
"metadata": {},
|
| 760 |
-
"output_type": "execute_result"
|
| 761 |
-
}
|
| 762 |
-
],
|
| 763 |
-
"source": [
|
| 764 |
-
"bird.query_chatgpt_number(\n",
|
| 765 |
-
" \"add 221 antigravity birds\", \n",
|
| 766 |
-
" # \"Did the user mention a number?\"\n",
|
| 767 |
-
" \"How many birds did the user want to add?\",\n",
|
| 768 |
-
")"
|
| 769 |
-
]
|
| 770 |
-
},
|
| 771 |
-
{
|
| 772 |
-
"cell_type": "code",
|
| 773 |
-
"execution_count": null,
|
| 774 |
-
"id": "637c12b4-24d8-42b2-9c0a-3438a41d7aeb",
|
| 775 |
-
"metadata": {},
|
| 776 |
-
"outputs": [],
|
| 777 |
-
"source": []
|
| 778 |
-
},
|
| 779 |
-
{
|
| 780 |
-
"cell_type": "code",
|
| 781 |
-
"execution_count": 27,
|
| 782 |
-
"id": "5a878ccf-6575-4440-a5fa-d81d046f9dee",
|
| 783 |
-
"metadata": {},
|
| 784 |
-
"outputs": [],
|
| 785 |
-
"source": [
|
| 786 |
-
"# print(json.dumps(bird.list_functionality(), indent=4))"
|
| 787 |
-
]
|
| 788 |
-
},
|
| 789 |
-
{
|
| 790 |
-
"cell_type": "code",
|
| 791 |
-
"execution_count": 28,
|
| 792 |
-
"id": "06c7907e-0e2f-44be-9b75-692a5354f1c0",
|
| 793 |
-
"metadata": {},
|
| 794 |
-
"outputs": [],
|
| 795 |
-
"source": [
|
| 796 |
-
"# print(json.dumps(bird.show_json(), indent=4))"
|
| 797 |
-
]
|
| 798 |
-
},
|
| 799 |
-
{
|
| 800 |
-
"cell_type": "code",
|
| 801 |
-
"execution_count": 168,
|
| 802 |
-
"id": "85717861-b3d7-4637-ae6a-dccd25ef0ccc",
|
| 803 |
-
"metadata": {},
|
| 804 |
-
"outputs": [
|
| 805 |
-
{
|
| 806 |
-
"name": "stdout",
|
| 807 |
-
"output_type": "stream",
|
| 808 |
-
"text": [
|
| 809 |
-
"ok\n"
|
| 810 |
-
]
|
| 811 |
-
}
|
| 812 |
-
],
|
| 813 |
-
"source": [
|
| 814 |
-
"print('ok')"
|
| 815 |
-
]
|
| 816 |
-
},
|
| 817 |
-
{
|
| 818 |
-
"cell_type": "code",
|
| 819 |
-
"execution_count": null,
|
| 820 |
-
"id": "42d0d053-b523-4cd7-9571-063dc8b5ebc2",
|
| 821 |
-
"metadata": {},
|
| 822 |
-
"outputs": [],
|
| 823 |
-
"source": []
|
| 824 |
-
},
|
| 825 |
-
{
|
| 826 |
-
"cell_type": "code",
|
| 827 |
-
"execution_count": null,
|
| 828 |
-
"id": "3806172f-6f72-415d-9e71-80d64a0638c6",
|
| 829 |
-
"metadata": {},
|
| 830 |
-
"outputs": [],
|
| 831 |
-
"source": []
|
| 832 |
-
},
|
| 833 |
-
{
|
| 834 |
-
"cell_type": "code",
|
| 835 |
-
"execution_count": 180,
|
| 836 |
-
"id": "3ff452d6-0bc6-4a8b-b113-df47ceded955",
|
| 837 |
-
"metadata": {},
|
| 838 |
-
"outputs": [
|
| 839 |
-
{
|
| 840 |
-
"name": "stdout",
|
| 841 |
-
"output_type": "stream",
|
| 842 |
-
"text": [
|
| 843 |
-
"from chatGPT (1): To add a pig to the game, you would need to create a new character model and implement its behavior and interactions within the game environment.\n",
|
| 844 |
-
"from chatGPT (2): To add a pig to the game, the game developer will need to create a new character model and associated behaviors for the pig. This includes defining its appearance, movements, interactions, and any unique abilities or behaviors it may have in the game.\n",
|
| 845 |
-
"from chatGPT (3): Sure! When you say \"add a pig,\" it means that you want to include a pig character in the game. This pig will be one of the targets for the Angry Birds to eliminate.\n",
|
| 846 |
-
"from chatGPT (4): To add a pig to the game, you would need to create a pig character with its unique behavior, physics, and visual representation within the game's environment.\n",
|
| 847 |
-
"from chatGPT (5): To add a pig to the game, you would need to incorporate pig character design, behavior, and spawn locations within the game's code.\n",
|
| 848 |
-
"from chatGPT (6): To add a pig to the game, you will need to create a new character or object that represents the pig. This includes designing its appearance, behavior, and any abilities or interactions it may have within the game.\n",
|
| 849 |
-
"from chatGPT (7): As a game developer, when you say \"add a pig,\" the concise response would be to add a pig character to the game with the necessary attributes, behavior, and visuals.\n",
|
| 850 |
-
"from chatGPT (8): To add a pig, the game developer needs to create a pig character in the game's code or design a pig asset that can be added to the game environment.\n",
|
| 851 |
-
"from chatGPT (9): To add a pig, you need to create a pig character with its own attributes such as size, weight, and abilities. This character should be visually represented in the game and programmed to interact with the birds and the game environment.\n",
|
| 852 |
-
"from chatGPT (10): Sure, I understand that as a game developer, you want to add a pig to the game.\n"
|
| 853 |
-
]
|
| 854 |
-
}
|
| 855 |
-
],
|
| 856 |
-
"source": [
|
| 857 |
-
"for i, x in enumerate(bird.query_chatgpt_nlp_response('add a pig', n=10)):\n",
|
| 858 |
-
" print(f'from chatGPT ({i+1}): {x}')"
|
| 859 |
-
]
|
| 860 |
-
},
|
| 861 |
-
{
|
| 862 |
-
"cell_type": "code",
|
| 863 |
-
"execution_count": 242,
|
| 864 |
-
"id": "8e55af03-d673-452b-b70d-b69b4e231dee",
|
| 865 |
-
"metadata": {},
|
| 866 |
-
"outputs": [],
|
| 867 |
-
"source": [
|
| 868 |
-
"prompt1 = f\"\"\"\n",
|
| 869 |
-
"{config.game_desc}\n",
|
| 870 |
-
"\"\"\"\n",
|
| 871 |
-
"full_prompt = bird._get_full_prompt(prompt1)\n",
|
| 872 |
-
"# print(prompt)\n",
|
| 873 |
-
"choices = bird._query_chatgpt(bird._get_full_prompt(prompt1), n=1)\n",
|
| 874 |
-
"\n",
|
| 875 |
-
"\n",
|
| 876 |
-
"prompt2 = f\"\"\"\n",
|
| 877 |
-
"As a game developer, when I say, \n",
|
| 878 |
-
"\n",
|
| 879 |
-
"{command}\n",
|
| 880 |
-
"\n",
|
| 881 |
-
"give me a concise response.\n",
|
| 882 |
-
"\"\"\"\n"
|
| 883 |
-
]
|
| 884 |
-
},
|
| 885 |
-
{
|
| 886 |
-
"cell_type": "code",
|
| 887 |
-
"execution_count": 243,
|
| 888 |
-
"id": "40ea1f8c-0cd8-4570-b5c0-c815dd02c5a1",
|
| 889 |
-
"metadata": {},
|
| 890 |
-
"outputs": [
|
| 891 |
-
{
|
| 892 |
-
"data": {
|
| 893 |
-
"text/plain": [
|
| 894 |
-
"[\"Certainly! I'll be happy to assist you. How can I help you with developing the Angry Birds game?\"]"
|
| 895 |
-
]
|
| 896 |
-
},
|
| 897 |
-
"execution_count": 243,
|
| 898 |
-
"metadata": {},
|
| 899 |
-
"output_type": "execute_result"
|
| 900 |
-
}
|
| 901 |
-
],
|
| 902 |
-
"source": [
|
| 903 |
-
"choices"
|
| 904 |
-
]
|
| 905 |
-
},
|
| 906 |
-
{
|
| 907 |
-
"cell_type": "code",
|
| 908 |
-
"execution_count": 244,
|
| 909 |
-
"id": "b56959d9-7885-4482-a26f-aebfbf5a3a87",
|
| 910 |
-
"metadata": {},
|
| 911 |
-
"outputs": [
|
| 912 |
-
{
|
| 913 |
-
"data": {
|
| 914 |
-
"text/plain": [
|
| 915 |
-
"\"Certainly! I'll be happy to assist you. How can I help you with developing the Angry Birds game?\""
|
| 916 |
-
]
|
| 917 |
-
},
|
| 918 |
-
"execution_count": 244,
|
| 919 |
-
"metadata": {},
|
| 920 |
-
"output_type": "execute_result"
|
| 921 |
-
}
|
| 922 |
-
],
|
| 923 |
-
"source": [
|
| 924 |
-
"choices[0]"
|
| 925 |
-
]
|
| 926 |
-
},
|
| 927 |
-
{
|
| 928 |
-
"cell_type": "code",
|
| 929 |
-
"execution_count": 245,
|
| 930 |
-
"id": "d652917a-1985-4c15-9082-697599795afd",
|
| 931 |
-
"metadata": {},
|
| 932 |
-
"outputs": [
|
| 933 |
-
{
|
| 934 |
-
"data": {
|
| 935 |
-
"text/plain": [
|
| 936 |
-
"[{'role': 'system', 'content': 'You are a helpful assistant.'},\n",
|
| 937 |
-
" {'role': 'user',\n",
|
| 938 |
-
" 'content': '\\n\\nImaging we are developing the game of the Angry Birds, \\nand the game is described as the following: \\n\\nIn Angry Birds, players take control of a group of birds who are seeking \\nrevenge on a group of green pigs that have stolen their eggs. \\nThe gameplay involves using a slingshot to launch the birds at various \\nstructures where the pigs are hiding. The objective is to \\neliminate all the pigs on each level and score as many points as possible.\\n\\nA game developer is building the game, \\nand I need you to help me figure out what is going on.\\n\\n'}]"
|
| 939 |
-
]
|
| 940 |
-
},
|
| 941 |
-
"execution_count": 245,
|
| 942 |
-
"metadata": {},
|
| 943 |
-
"output_type": "execute_result"
|
| 944 |
-
}
|
| 945 |
-
],
|
| 946 |
-
"source": [
|
| 947 |
-
"full_prompt"
|
| 948 |
-
]
|
| 949 |
-
},
|
| 950 |
-
{
|
| 951 |
-
"cell_type": "code",
|
| 952 |
-
"execution_count": null,
|
| 953 |
-
"id": "f9a53efc-cb26-4d9e-b425-347a14e7901e",
|
| 954 |
-
"metadata": {},
|
| 955 |
-
"outputs": [],
|
| 956 |
-
"source": []
|
| 957 |
-
},
|
| 958 |
-
{
|
| 959 |
-
"cell_type": "code",
|
| 960 |
-
"execution_count": 246,
|
| 961 |
-
"id": "0ef8cdfd-9c79-4530-ba08-1eca474ef420",
|
| 962 |
-
"metadata": {},
|
| 963 |
-
"outputs": [],
|
| 964 |
-
"source": [
|
| 965 |
-
"full_prompt.append({\n",
|
| 966 |
-
" \"role\": \"assistant\", \n",
|
| 967 |
-
" \"content\": choices[0]})"
|
| 968 |
-
]
|
| 969 |
-
},
|
| 970 |
-
{
|
| 971 |
-
"cell_type": "code",
|
| 972 |
-
"execution_count": 247,
|
| 973 |
-
"id": "2df8919b-4e89-4f78-ae4c-dcaac5eec9fd",
|
| 974 |
-
"metadata": {},
|
| 975 |
-
"outputs": [
|
| 976 |
-
{
|
| 977 |
-
"data": {
|
| 978 |
-
"text/plain": [
|
| 979 |
-
"[{'role': 'system', 'content': 'You are a helpful assistant.'},\n",
|
| 980 |
-
" {'role': 'user',\n",
|
| 981 |
-
" 'content': '\\n\\nImaging we are developing the game of the Angry Birds, \\nand the game is described as the following: \\n\\nIn Angry Birds, players take control of a group of birds who are seeking \\nrevenge on a group of green pigs that have stolen their eggs. \\nThe gameplay involves using a slingshot to launch the birds at various \\nstructures where the pigs are hiding. The objective is to \\neliminate all the pigs on each level and score as many points as possible.\\n\\nA game developer is building the game, \\nand I need you to help me figure out what is going on.\\n\\n'},\n",
|
| 982 |
-
" {'role': 'assistant',\n",
|
| 983 |
-
" 'content': \"Certainly! I'll be happy to assist you. How can I help you with developing the Angry Birds game?\"}]"
|
| 984 |
-
]
|
| 985 |
-
},
|
| 986 |
-
"execution_count": 247,
|
| 987 |
-
"metadata": {},
|
| 988 |
-
"output_type": "execute_result"
|
| 989 |
-
}
|
| 990 |
-
],
|
| 991 |
-
"source": [
|
| 992 |
-
"full_prompt"
|
| 993 |
-
]
|
| 994 |
-
},
|
| 995 |
-
{
|
| 996 |
-
"cell_type": "code",
|
| 997 |
-
"execution_count": 248,
|
| 998 |
-
"id": "4289159c-ce4c-48a7-bfcb-c6f904119a66",
|
| 999 |
-
"metadata": {},
|
| 1000 |
-
"outputs": [],
|
| 1001 |
-
"source": [
|
| 1002 |
-
"full_prompt.append({\n",
|
| 1003 |
-
" \"role\": \"user\", \n",
|
| 1004 |
-
" \"content\": \"\"\"\n",
|
| 1005 |
-
"As a game developer, \n",
|
| 1006 |
-
"Add 5 pink pigs. \n",
|
| 1007 |
-
"\n",
|
| 1008 |
-
"Please give a one sentence response.\"\"\"})"
|
| 1009 |
-
]
|
| 1010 |
-
},
|
| 1011 |
-
{
|
| 1012 |
-
"cell_type": "code",
|
| 1013 |
-
"execution_count": 249,
|
| 1014 |
-
"id": "8c4f7555-24cc-4b5f-badd-a89b32b55aa7",
|
| 1015 |
-
"metadata": {},
|
| 1016 |
-
"outputs": [
|
| 1017 |
-
{
|
| 1018 |
-
"data": {
|
| 1019 |
-
"text/plain": [
|
| 1020 |
-
"[{'role': 'system', 'content': 'You are a helpful assistant.'},\n",
|
| 1021 |
-
" {'role': 'user',\n",
|
| 1022 |
-
" 'content': '\\n\\nImaging we are developing the game of the Angry Birds, \\nand the game is described as the following: \\n\\nIn Angry Birds, players take control of a group of birds who are seeking \\nrevenge on a group of green pigs that have stolen their eggs. \\nThe gameplay involves using a slingshot to launch the birds at various \\nstructures where the pigs are hiding. The objective is to \\neliminate all the pigs on each level and score as many points as possible.\\n\\nA game developer is building the game, \\nand I need you to help me figure out what is going on.\\n\\n'},\n",
|
| 1023 |
-
" {'role': 'assistant',\n",
|
| 1024 |
-
" 'content': \"Certainly! I'll be happy to assist you. How can I help you with developing the Angry Birds game?\"},\n",
|
| 1025 |
-
" {'role': 'user',\n",
|
| 1026 |
-
" 'content': '\\nAs a game developer, \\nAdd 5 pink pigs. \\n\\nPlease give a one sentence response.'}]"
|
| 1027 |
-
]
|
| 1028 |
-
},
|
| 1029 |
-
"execution_count": 249,
|
| 1030 |
-
"metadata": {},
|
| 1031 |
-
"output_type": "execute_result"
|
| 1032 |
-
}
|
| 1033 |
-
],
|
| 1034 |
-
"source": [
|
| 1035 |
-
"full_prompt"
|
| 1036 |
-
]
|
| 1037 |
-
},
|
| 1038 |
-
{
|
| 1039 |
-
"cell_type": "code",
|
| 1040 |
-
"execution_count": 250,
|
| 1041 |
-
"id": "cf888b66-b154-4ba9-aaed-b21137bce213",
|
| 1042 |
-
"metadata": {},
|
| 1043 |
-
"outputs": [],
|
| 1044 |
-
"source": [
|
| 1045 |
-
"choices = bird._query_chatgpt(full_prompt, n=5)\n"
|
| 1046 |
-
]
|
| 1047 |
-
},
|
| 1048 |
-
{
|
| 1049 |
-
"cell_type": "code",
|
| 1050 |
-
"execution_count": 251,
|
| 1051 |
-
"id": "3cfc4984-72f8-4d2e-904b-8627ef6b6d4d",
|
| 1052 |
-
"metadata": {},
|
| 1053 |
-
"outputs": [
|
| 1054 |
-
{
|
| 1055 |
-
"data": {
|
| 1056 |
-
"text/plain": [
|
| 1057 |
-
"['Sure, I will add 5 pink pigs to the game.',\n",
|
| 1058 |
-
" 'Sure, I will add 5 pink pigs to the game.',\n",
|
| 1059 |
-
" 'Sure, I will add 5 pink pigs to the game.',\n",
|
| 1060 |
-
" 'I have added 5 pink pigs to the game.',\n",
|
| 1061 |
-
" 'Sure, I will add 5 pink pigs to the game.']"
|
| 1062 |
-
]
|
| 1063 |
-
},
|
| 1064 |
-
"execution_count": 251,
|
| 1065 |
-
"metadata": {},
|
| 1066 |
-
"output_type": "execute_result"
|
| 1067 |
-
}
|
| 1068 |
-
],
|
| 1069 |
-
"source": [
|
| 1070 |
-
"choices"
|
| 1071 |
-
]
|
| 1072 |
-
},
|
| 1073 |
-
{
|
| 1074 |
-
"cell_type": "code",
|
| 1075 |
-
"execution_count": null,
|
| 1076 |
-
"id": "8ae1af73-d0c3-49a0-9c68-2ebd37539778",
|
| 1077 |
-
"metadata": {},
|
| 1078 |
-
"outputs": [],
|
| 1079 |
-
"source": []
|
| 1080 |
-
},
|
| 1081 |
-
{
|
| 1082 |
-
"cell_type": "code",
|
| 1083 |
-
"execution_count": 26,
|
| 1084 |
-
"id": "c92de3b4-e6ef-42d7-811f-5c1dde2c8c46",
|
| 1085 |
-
"metadata": {},
|
| 1086 |
-
"outputs": [
|
| 1087 |
-
{
|
| 1088 |
-
"data": {
|
| 1089 |
-
"text/plain": [
|
| 1090 |
-
"{'version': '2.0.1-2023-07-28-d',\n",
|
| 1091 |
-
" 'data': ['add one or more birds',\n",
|
| 1092 |
-
" 'add one or more houses',\n",
|
| 1093 |
-
" 'add one or more pigs',\n",
|
| 1094 |
-
" 'change background',\n",
|
| 1095 |
-
" 'change bird size',\n",
|
| 1096 |
-
" 'change pig size',\n",
|
| 1097 |
-
" 'change position',\n",
|
| 1098 |
-
" 'change skin',\n",
|
| 1099 |
-
" 'decrease HP for a pig',\n",
|
| 1100 |
-
" 'delete a bird',\n",
|
| 1101 |
-
" 'delete a pig',\n",
|
| 1102 |
-
" 'increase HP for a pig',\n",
|
| 1103 |
-
" 'list birds',\n",
|
| 1104 |
-
" 'list pigs']}"
|
| 1105 |
-
]
|
| 1106 |
-
},
|
| 1107 |
-
"execution_count": 26,
|
| 1108 |
-
"metadata": {},
|
| 1109 |
-
"output_type": "execute_result"
|
| 1110 |
-
}
|
| 1111 |
-
],
|
| 1112 |
-
"source": [
|
| 1113 |
-
"bird.list_functionality()"
|
| 1114 |
-
]
|
| 1115 |
-
},
|
| 1116 |
-
{
|
| 1117 |
-
"cell_type": "code",
|
| 1118 |
-
"execution_count": null,
|
| 1119 |
-
"id": "22769a08-a9c6-44d2-b539-e2e3b99f5a3e",
|
| 1120 |
-
"metadata": {},
|
| 1121 |
-
"outputs": [],
|
| 1122 |
-
"source": []
|
| 1123 |
-
}
|
| 1124 |
-
],
|
| 1125 |
-
"metadata": {
|
| 1126 |
-
"kernelspec": {
|
| 1127 |
-
"display_name": "Python 3 (ipykernel)",
|
| 1128 |
-
"language": "python",
|
| 1129 |
-
"name": "python3"
|
| 1130 |
-
},
|
| 1131 |
-
"language_info": {
|
| 1132 |
-
"codemirror_mode": {
|
| 1133 |
-
"name": "ipython",
|
| 1134 |
-
"version": 3
|
| 1135 |
-
},
|
| 1136 |
-
"file_extension": ".py",
|
| 1137 |
-
"mimetype": "text/x-python",
|
| 1138 |
-
"name": "python",
|
| 1139 |
-
"nbconvert_exporter": "python",
|
| 1140 |
-
"pygments_lexer": "ipython3",
|
| 1141 |
-
"version": "3.11.4"
|
| 1142 |
-
}
|
| 1143 |
-
},
|
| 1144 |
-
"nbformat": 4,
|
| 1145 |
-
"nbformat_minor": 5
|
| 1146 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
games/angrybirds/notebooks/ai_v3.7-config.ipynb
DELETED
|
@@ -1,844 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "code",
|
| 5 |
-
"execution_count": 36,
|
| 6 |
-
"id": "245fbc34-352d-4945-a689-d04f9365bb99",
|
| 7 |
-
"metadata": {},
|
| 8 |
-
"outputs": [
|
| 9 |
-
{
|
| 10 |
-
"name": "stdout",
|
| 11 |
-
"output_type": "stream",
|
| 12 |
-
"text": [
|
| 13 |
-
"The autoreload extension is already loaded. To reload it, use:\n",
|
| 14 |
-
" %reload_ext autoreload\n"
|
| 15 |
-
]
|
| 16 |
-
}
|
| 17 |
-
],
|
| 18 |
-
"source": [
|
| 19 |
-
"%load_ext autoreload\n",
|
| 20 |
-
"%autoreload 2"
|
| 21 |
-
]
|
| 22 |
-
},
|
| 23 |
-
{
|
| 24 |
-
"cell_type": "code",
|
| 25 |
-
"execution_count": 37,
|
| 26 |
-
"id": "eaed216c-160a-4e31-96fe-015c140ff18b",
|
| 27 |
-
"metadata": {},
|
| 28 |
-
"outputs": [],
|
| 29 |
-
"source": [
|
| 30 |
-
"# from pprint import pprint"
|
| 31 |
-
]
|
| 32 |
-
},
|
| 33 |
-
{
|
| 34 |
-
"cell_type": "code",
|
| 35 |
-
"execution_count": 38,
|
| 36 |
-
"id": "97953551-8ef1-42c1-9317-99d5e65f535e",
|
| 37 |
-
"metadata": {},
|
| 38 |
-
"outputs": [],
|
| 39 |
-
"source": [
|
| 40 |
-
"import json\n",
|
| 41 |
-
"import pandas as pd\n",
|
| 42 |
-
"import pickle\n",
|
| 43 |
-
"\n",
|
| 44 |
-
"import openai\n",
|
| 45 |
-
"from openai.embeddings_utils import get_embedding, cosine_similarity\n",
|
| 46 |
-
"\n",
|
| 47 |
-
"# from games.angrybirds.util import util\n",
|
| 48 |
-
"from games.angrybirds.config import config\n",
|
| 49 |
-
"# from games.angrybirds.prompt import prompt\n",
|
| 50 |
-
"# from games.angrybirds.query import query, yes_no_query\n",
|
| 51 |
-
"from games.angrybirds.angrybirds import angrybird"
|
| 52 |
-
]
|
| 53 |
-
},
|
| 54 |
-
{
|
| 55 |
-
"cell_type": "code",
|
| 56 |
-
"execution_count": null,
|
| 57 |
-
"id": "fc213f4c-cb07-468b-b15f-60e5120b3d94",
|
| 58 |
-
"metadata": {},
|
| 59 |
-
"outputs": [],
|
| 60 |
-
"source": []
|
| 61 |
-
},
|
| 62 |
-
{
|
| 63 |
-
"cell_type": "code",
|
| 64 |
-
"execution_count": 39,
|
| 65 |
-
"id": "0c876614-a9bf-4d0b-a728-07770f1ad9c5",
|
| 66 |
-
"metadata": {},
|
| 67 |
-
"outputs": [
|
| 68 |
-
{
|
| 69 |
-
"name": "stdout",
|
| 70 |
-
"output_type": "stream",
|
| 71 |
-
"text": [
|
| 72 |
-
"before add_config\n",
|
| 73 |
-
"779\n",
|
| 74 |
-
"779\n",
|
| 75 |
-
"779\n",
|
| 76 |
-
"779\n",
|
| 77 |
-
"779\n",
|
| 78 |
-
"779\n",
|
| 79 |
-
"779\n",
|
| 80 |
-
"779\n",
|
| 81 |
-
"779\n",
|
| 82 |
-
"779\n",
|
| 83 |
-
"after add_config\n",
|
| 84 |
-
"779\n",
|
| 85 |
-
"final\n",
|
| 86 |
-
"779\n"
|
| 87 |
-
]
|
| 88 |
-
}
|
| 89 |
-
],
|
| 90 |
-
"source": [
|
| 91 |
-
"bird = angrybird()"
|
| 92 |
-
]
|
| 93 |
-
},
|
| 94 |
-
{
|
| 95 |
-
"cell_type": "code",
|
| 96 |
-
"execution_count": 9,
|
| 97 |
-
"id": "1411de96-97d5-4bac-b8ed-e279fb1edaa0",
|
| 98 |
-
"metadata": {},
|
| 99 |
-
"outputs": [
|
| 100 |
-
{
|
| 101 |
-
"data": {
|
| 102 |
-
"text/plain": [
|
| 103 |
-
"0"
|
| 104 |
-
]
|
| 105 |
-
},
|
| 106 |
-
"execution_count": 9,
|
| 107 |
-
"metadata": {},
|
| 108 |
-
"output_type": "execute_result"
|
| 109 |
-
}
|
| 110 |
-
],
|
| 111 |
-
"source": [
|
| 112 |
-
"len(bird.embeddings)"
|
| 113 |
-
]
|
| 114 |
-
},
|
| 115 |
-
{
|
| 116 |
-
"cell_type": "code",
|
| 117 |
-
"execution_count": 10,
|
| 118 |
-
"id": "129403ce-69f4-4f2a-9b22-7b3e36d78f24",
|
| 119 |
-
"metadata": {},
|
| 120 |
-
"outputs": [
|
| 121 |
-
{
|
| 122 |
-
"data": {
|
| 123 |
-
"text/plain": [
|
| 124 |
-
"{}"
|
| 125 |
-
]
|
| 126 |
-
},
|
| 127 |
-
"execution_count": 10,
|
| 128 |
-
"metadata": {},
|
| 129 |
-
"output_type": "execute_result"
|
| 130 |
-
}
|
| 131 |
-
],
|
| 132 |
-
"source": [
|
| 133 |
-
"bird.embeddings"
|
| 134 |
-
]
|
| 135 |
-
},
|
| 136 |
-
{
|
| 137 |
-
"cell_type": "code",
|
| 138 |
-
"execution_count": 11,
|
| 139 |
-
"id": "50e372eb-48ba-4378-b866-f2b7120bc94e",
|
| 140 |
-
"metadata": {},
|
| 141 |
-
"outputs": [
|
| 142 |
-
{
|
| 143 |
-
"data": {
|
| 144 |
-
"text/plain": [
|
| 145 |
-
"779"
|
| 146 |
-
]
|
| 147 |
-
},
|
| 148 |
-
"execution_count": 11,
|
| 149 |
-
"metadata": {},
|
| 150 |
-
"output_type": "execute_result"
|
| 151 |
-
}
|
| 152 |
-
],
|
| 153 |
-
"source": [
|
| 154 |
-
"len(bird.train)"
|
| 155 |
-
]
|
| 156 |
-
},
|
| 157 |
-
{
|
| 158 |
-
"cell_type": "code",
|
| 159 |
-
"execution_count": null,
|
| 160 |
-
"id": "f78b2c43-bfc7-478f-894d-d757b0e9927f",
|
| 161 |
-
"metadata": {},
|
| 162 |
-
"outputs": [],
|
| 163 |
-
"source": []
|
| 164 |
-
},
|
| 165 |
-
{
|
| 166 |
-
"cell_type": "code",
|
| 167 |
-
"execution_count": 12,
|
| 168 |
-
"id": "163545c6-c707-401a-93b8-fb2cb9d65136",
|
| 169 |
-
"metadata": {},
|
| 170 |
-
"outputs": [
|
| 171 |
-
{
|
| 172 |
-
"name": "stdout",
|
| 173 |
-
"output_type": "stream",
|
| 174 |
-
"text": [
|
| 175 |
-
"initializing...\n",
|
| 176 |
-
"loading embeddings from a file...\n",
|
| 177 |
-
"pkl size: 779\n",
|
| 178 |
-
"embedding size: 779\n",
|
| 179 |
-
"creating embeddings by query OpenAI...\n",
|
| 180 |
-
"embedding size: 779\n",
|
| 181 |
-
"train size: 779\n"
|
| 182 |
-
]
|
| 183 |
-
}
|
| 184 |
-
],
|
| 185 |
-
"source": [
|
| 186 |
-
"bird.init_emb()"
|
| 187 |
-
]
|
| 188 |
-
},
|
| 189 |
-
{
|
| 190 |
-
"cell_type": "code",
|
| 191 |
-
"execution_count": 13,
|
| 192 |
-
"id": "31c02b28-0078-425d-87b6-702caeea02e3",
|
| 193 |
-
"metadata": {},
|
| 194 |
-
"outputs": [
|
| 195 |
-
{
|
| 196 |
-
"data": {
|
| 197 |
-
"text/plain": [
|
| 198 |
-
"779"
|
| 199 |
-
]
|
| 200 |
-
},
|
| 201 |
-
"execution_count": 13,
|
| 202 |
-
"metadata": {},
|
| 203 |
-
"output_type": "execute_result"
|
| 204 |
-
}
|
| 205 |
-
],
|
| 206 |
-
"source": [
|
| 207 |
-
"len(bird.embeddings)"
|
| 208 |
-
]
|
| 209 |
-
},
|
| 210 |
-
{
|
| 211 |
-
"cell_type": "code",
|
| 212 |
-
"execution_count": null,
|
| 213 |
-
"id": "067905b6-b030-4df1-9570-d45885f775eb",
|
| 214 |
-
"metadata": {},
|
| 215 |
-
"outputs": [],
|
| 216 |
-
"source": []
|
| 217 |
-
},
|
| 218 |
-
{
|
| 219 |
-
"cell_type": "code",
|
| 220 |
-
"execution_count": 11,
|
| 221 |
-
"id": "02478e9b-dd11-406a-b405-ea4ee56975b1",
|
| 222 |
-
"metadata": {},
|
| 223 |
-
"outputs": [],
|
| 224 |
-
"source": [
|
| 225 |
-
"import os"
|
| 226 |
-
]
|
| 227 |
-
},
|
| 228 |
-
{
|
| 229 |
-
"cell_type": "code",
|
| 230 |
-
"execution_count": 12,
|
| 231 |
-
"id": "7b506b8c-0b60-44e4-bb6e-f4af8439f04f",
|
| 232 |
-
"metadata": {},
|
| 233 |
-
"outputs": [
|
| 234 |
-
{
|
| 235 |
-
"data": {
|
| 236 |
-
"text/plain": [
|
| 237 |
-
"'/Users/shaojun/playgo/bbc123'"
|
| 238 |
-
]
|
| 239 |
-
},
|
| 240 |
-
"execution_count": 12,
|
| 241 |
-
"metadata": {},
|
| 242 |
-
"output_type": "execute_result"
|
| 243 |
-
}
|
| 244 |
-
],
|
| 245 |
-
"source": [
|
| 246 |
-
"root = os.environ['PYTHONPATH']\n",
|
| 247 |
-
"root"
|
| 248 |
-
]
|
| 249 |
-
},
|
| 250 |
-
{
|
| 251 |
-
"cell_type": "code",
|
| 252 |
-
"execution_count": null,
|
| 253 |
-
"id": "e977cf56-3bfc-4c87-884e-58577b3808cd",
|
| 254 |
-
"metadata": {},
|
| 255 |
-
"outputs": [],
|
| 256 |
-
"source": []
|
| 257 |
-
},
|
| 258 |
-
{
|
| 259 |
-
"cell_type": "code",
|
| 260 |
-
"execution_count": 13,
|
| 261 |
-
"id": "5662bd80-03c5-4793-94c3-4d0392c08102",
|
| 262 |
-
"metadata": {},
|
| 263 |
-
"outputs": [
|
| 264 |
-
{
|
| 265 |
-
"name": "stdout",
|
| 266 |
-
"output_type": "stream",
|
| 267 |
-
"text": [
|
| 268 |
-
"before add_config\n",
|
| 269 |
-
"779\n",
|
| 270 |
-
"779\n",
|
| 271 |
-
"779\n",
|
| 272 |
-
"779\n",
|
| 273 |
-
"779\n",
|
| 274 |
-
"779\n",
|
| 275 |
-
"779\n",
|
| 276 |
-
"779\n",
|
| 277 |
-
"779\n",
|
| 278 |
-
"779\n",
|
| 279 |
-
"after add_config\n",
|
| 280 |
-
"779\n",
|
| 281 |
-
"final\n",
|
| 282 |
-
"779\n"
|
| 283 |
-
]
|
| 284 |
-
}
|
| 285 |
-
],
|
| 286 |
-
"source": [
|
| 287 |
-
"conf = config()\n",
|
| 288 |
-
"conf.init_game_train()"
|
| 289 |
-
]
|
| 290 |
-
},
|
| 291 |
-
{
|
| 292 |
-
"cell_type": "code",
|
| 293 |
-
"execution_count": 177,
|
| 294 |
-
"id": "30fb4dd7-35d8-442f-bd6e-29e15374e3d6",
|
| 295 |
-
"metadata": {},
|
| 296 |
-
"outputs": [],
|
| 297 |
-
"source": [
|
| 298 |
-
"with open(f'../game_train.json', 'w') as f:\n",
|
| 299 |
-
" json.dump(config.game_train, f, indent=4)"
|
| 300 |
-
]
|
| 301 |
-
},
|
| 302 |
-
{
|
| 303 |
-
"cell_type": "code",
|
| 304 |
-
"execution_count": 178,
|
| 305 |
-
"id": "3c051dbf-d547-4297-8f14-f464e58e9a64",
|
| 306 |
-
"metadata": {},
|
| 307 |
-
"outputs": [],
|
| 308 |
-
"source": [
|
| 309 |
-
"with open(f'../game_train.json', 'r') as f:\n",
|
| 310 |
-
" tmp = json.load(f)"
|
| 311 |
-
]
|
| 312 |
-
},
|
| 313 |
-
{
|
| 314 |
-
"cell_type": "code",
|
| 315 |
-
"execution_count": 179,
|
| 316 |
-
"id": "77789684-e7b1-4e28-b9b7-5fbca3b6d376",
|
| 317 |
-
"metadata": {},
|
| 318 |
-
"outputs": [
|
| 319 |
-
{
|
| 320 |
-
"data": {
|
| 321 |
-
"text/plain": [
|
| 322 |
-
"True"
|
| 323 |
-
]
|
| 324 |
-
},
|
| 325 |
-
"execution_count": 179,
|
| 326 |
-
"metadata": {},
|
| 327 |
-
"output_type": "execute_result"
|
| 328 |
-
}
|
| 329 |
-
],
|
| 330 |
-
"source": [
|
| 331 |
-
"config.game_train == tmp"
|
| 332 |
-
]
|
| 333 |
-
},
|
| 334 |
-
{
|
| 335 |
-
"cell_type": "code",
|
| 336 |
-
"execution_count": null,
|
| 337 |
-
"id": "ce058298-2236-4ede-adca-164d6d1249e1",
|
| 338 |
-
"metadata": {},
|
| 339 |
-
"outputs": [],
|
| 340 |
-
"source": []
|
| 341 |
-
},
|
| 342 |
-
{
|
| 343 |
-
"cell_type": "code",
|
| 344 |
-
"execution_count": 180,
|
| 345 |
-
"id": "dd8c489e-cd3f-4df6-81c0-fe3fd2cc0d33",
|
| 346 |
-
"metadata": {},
|
| 347 |
-
"outputs": [],
|
| 348 |
-
"source": [
|
| 349 |
-
"with open(f'{root}/embeddings.pkl', 'wb') as f:\n",
|
| 350 |
-
" pickle.dump(bird.embeddings, f)"
|
| 351 |
-
]
|
| 352 |
-
},
|
| 353 |
-
{
|
| 354 |
-
"cell_type": "code",
|
| 355 |
-
"execution_count": 181,
|
| 356 |
-
"id": "07032487-3fe7-4729-8ca0-c57d6a485c28",
|
| 357 |
-
"metadata": {},
|
| 358 |
-
"outputs": [],
|
| 359 |
-
"source": [
|
| 360 |
-
"with open(f'{root}/embeddings.pkl', 'rb') as f:\n",
|
| 361 |
-
" tmp = pickle.load(f)"
|
| 362 |
-
]
|
| 363 |
-
},
|
| 364 |
-
{
|
| 365 |
-
"cell_type": "code",
|
| 366 |
-
"execution_count": 182,
|
| 367 |
-
"id": "ab7ec218-0e02-4a2b-9c16-ec26704b3519",
|
| 368 |
-
"metadata": {},
|
| 369 |
-
"outputs": [
|
| 370 |
-
{
|
| 371 |
-
"data": {
|
| 372 |
-
"text/plain": [
|
| 373 |
-
"True"
|
| 374 |
-
]
|
| 375 |
-
},
|
| 376 |
-
"execution_count": 182,
|
| 377 |
-
"metadata": {},
|
| 378 |
-
"output_type": "execute_result"
|
| 379 |
-
}
|
| 380 |
-
],
|
| 381 |
-
"source": [
|
| 382 |
-
"tmp == bird.embeddings"
|
| 383 |
-
]
|
| 384 |
-
},
|
| 385 |
-
{
|
| 386 |
-
"cell_type": "code",
|
| 387 |
-
"execution_count": 183,
|
| 388 |
-
"id": "bc896434-21ae-438c-90b1-6b590103e731",
|
| 389 |
-
"metadata": {},
|
| 390 |
-
"outputs": [
|
| 391 |
-
{
|
| 392 |
-
"data": {
|
| 393 |
-
"text/plain": [
|
| 394 |
-
"779"
|
| 395 |
-
]
|
| 396 |
-
},
|
| 397 |
-
"execution_count": 183,
|
| 398 |
-
"metadata": {},
|
| 399 |
-
"output_type": "execute_result"
|
| 400 |
-
}
|
| 401 |
-
],
|
| 402 |
-
"source": [
|
| 403 |
-
"len(tmp)"
|
| 404 |
-
]
|
| 405 |
-
},
|
| 406 |
-
{
|
| 407 |
-
"cell_type": "code",
|
| 408 |
-
"execution_count": 184,
|
| 409 |
-
"id": "9532b604-b7d6-4bd4-a0b9-c8c36470447b",
|
| 410 |
-
"metadata": {},
|
| 411 |
-
"outputs": [
|
| 412 |
-
{
|
| 413 |
-
"data": {
|
| 414 |
-
"text/plain": [
|
| 415 |
-
"779"
|
| 416 |
-
]
|
| 417 |
-
},
|
| 418 |
-
"execution_count": 184,
|
| 419 |
-
"metadata": {},
|
| 420 |
-
"output_type": "execute_result"
|
| 421 |
-
}
|
| 422 |
-
],
|
| 423 |
-
"source": [
|
| 424 |
-
"len(bird.embeddings)"
|
| 425 |
-
]
|
| 426 |
-
},
|
| 427 |
-
{
|
| 428 |
-
"cell_type": "code",
|
| 429 |
-
"execution_count": 163,
|
| 430 |
-
"id": "18888a7b-d32d-45b4-a9b3-3ce29b18a7f7",
|
| 431 |
-
"metadata": {},
|
| 432 |
-
"outputs": [],
|
| 433 |
-
"source": [
|
| 434 |
-
"# sim query"
|
| 435 |
-
]
|
| 436 |
-
},
|
| 437 |
-
{
|
| 438 |
-
"cell_type": "code",
|
| 439 |
-
"execution_count": 164,
|
| 440 |
-
"id": "4703a269-a1c0-48e4-8848-6b5cdb9b814b",
|
| 441 |
-
"metadata": {},
|
| 442 |
-
"outputs": [
|
| 443 |
-
{
|
| 444 |
-
"data": {
|
| 445 |
-
"text/plain": [
|
| 446 |
-
"774"
|
| 447 |
-
]
|
| 448 |
-
},
|
| 449 |
-
"execution_count": 164,
|
| 450 |
-
"metadata": {},
|
| 451 |
-
"output_type": "execute_result"
|
| 452 |
-
}
|
| 453 |
-
],
|
| 454 |
-
"source": [
|
| 455 |
-
"len(bird.embeddings)"
|
| 456 |
-
]
|
| 457 |
-
},
|
| 458 |
-
{
|
| 459 |
-
"cell_type": "code",
|
| 460 |
-
"execution_count": 126,
|
| 461 |
-
"id": "78b30acb-50eb-48a9-9d57-e8af47a5de2d",
|
| 462 |
-
"metadata": {},
|
| 463 |
-
"outputs": [
|
| 464 |
-
{
|
| 465 |
-
"data": {
|
| 466 |
-
"text/plain": [
|
| 467 |
-
"False"
|
| 468 |
-
]
|
| 469 |
-
},
|
| 470 |
-
"execution_count": 126,
|
| 471 |
-
"metadata": {},
|
| 472 |
-
"output_type": "execute_result"
|
| 473 |
-
}
|
| 474 |
-
],
|
| 475 |
-
"source": [
|
| 476 |
-
"'move the pigs' in bird.embeddings"
|
| 477 |
-
]
|
| 478 |
-
},
|
| 479 |
-
{
|
| 480 |
-
"cell_type": "code",
|
| 481 |
-
"execution_count": 127,
|
| 482 |
-
"id": "9bc42449-80a7-4365-964d-910dc3151396",
|
| 483 |
-
"metadata": {},
|
| 484 |
-
"outputs": [
|
| 485 |
-
{
|
| 486 |
-
"data": {
|
| 487 |
-
"text/plain": [
|
| 488 |
-
"True"
|
| 489 |
-
]
|
| 490 |
-
},
|
| 491 |
-
"execution_count": 127,
|
| 492 |
-
"metadata": {},
|
| 493 |
-
"output_type": "execute_result"
|
| 494 |
-
}
|
| 495 |
-
],
|
| 496 |
-
"source": [
|
| 497 |
-
"'change the position of pigs' in bird.embeddings"
|
| 498 |
-
]
|
| 499 |
-
},
|
| 500 |
-
{
|
| 501 |
-
"cell_type": "code",
|
| 502 |
-
"execution_count": 128,
|
| 503 |
-
"id": "d54fcdcc-2db4-4cba-839c-361c30a5743f",
|
| 504 |
-
"metadata": {},
|
| 505 |
-
"outputs": [
|
| 506 |
-
{
|
| 507 |
-
"data": {
|
| 508 |
-
"text/plain": [
|
| 509 |
-
"False"
|
| 510 |
-
]
|
| 511 |
-
},
|
| 512 |
-
"execution_count": 128,
|
| 513 |
-
"metadata": {},
|
| 514 |
-
"output_type": "execute_result"
|
| 515 |
-
}
|
| 516 |
-
],
|
| 517 |
-
"source": [
|
| 518 |
-
"'change the positon of pigs' in bird.embeddings"
|
| 519 |
-
]
|
| 520 |
-
},
|
| 521 |
-
{
|
| 522 |
-
"cell_type": "code",
|
| 523 |
-
"execution_count": 14,
|
| 524 |
-
"id": "acda65fa-803d-432f-b8d3-79863e0b4e9e",
|
| 525 |
-
"metadata": {},
|
| 526 |
-
"outputs": [
|
| 527 |
-
{
|
| 528 |
-
"data": {
|
| 529 |
-
"text/plain": [
|
| 530 |
-
"True"
|
| 531 |
-
]
|
| 532 |
-
},
|
| 533 |
-
"execution_count": 14,
|
| 534 |
-
"metadata": {},
|
| 535 |
-
"output_type": "execute_result"
|
| 536 |
-
}
|
| 537 |
-
],
|
| 538 |
-
"source": [
|
| 539 |
-
"'move pigs' in bird.embeddings"
|
| 540 |
-
]
|
| 541 |
-
},
|
| 542 |
-
{
|
| 543 |
-
"cell_type": "code",
|
| 544 |
-
"execution_count": null,
|
| 545 |
-
"id": "c885da07-e53d-4586-b340-8f9de0515fc2",
|
| 546 |
-
"metadata": {},
|
| 547 |
-
"outputs": [],
|
| 548 |
-
"source": []
|
| 549 |
-
},
|
| 550 |
-
{
|
| 551 |
-
"cell_type": "code",
|
| 552 |
-
"execution_count": 130,
|
| 553 |
-
"id": "4ff48663-e767-4936-807d-07fb8c42ce92",
|
| 554 |
-
"metadata": {},
|
| 555 |
-
"outputs": [
|
| 556 |
-
{
|
| 557 |
-
"name": "stdout",
|
| 558 |
-
"output_type": "stream",
|
| 559 |
-
"text": [
|
| 560 |
-
"{\n",
|
| 561 |
-
" \"version\": \"3.8.0.2023-08-09-e\",\n",
|
| 562 |
-
" \"data\": [\n",
|
| 563 |
-
" \"(1) [unified] add/delete one or more (special) birds/pigs\",\n",
|
| 564 |
-
" \"(2) add one or more houses\",\n",
|
| 565 |
-
" \"(3) change HP\",\n",
|
| 566 |
-
" \"(4) change background\",\n",
|
| 567 |
-
" \"(5) change positions\",\n",
|
| 568 |
-
" \"(6) change size\",\n",
|
| 569 |
-
" \"(7) change skin\",\n",
|
| 570 |
-
" \"(8) list birds or pigs\"\n",
|
| 571 |
-
" ]\n",
|
| 572 |
-
"}\n"
|
| 573 |
-
]
|
| 574 |
-
}
|
| 575 |
-
],
|
| 576 |
-
"source": [
|
| 577 |
-
"print(json.dumps(bird.list_functionality(), indent=4))"
|
| 578 |
-
]
|
| 579 |
-
},
|
| 580 |
-
{
|
| 581 |
-
"cell_type": "code",
|
| 582 |
-
"execution_count": 131,
|
| 583 |
-
"id": "982c3666-7b6a-4300-a2ac-b1a42c216c09",
|
| 584 |
-
"metadata": {},
|
| 585 |
-
"outputs": [
|
| 586 |
-
{
|
| 587 |
-
"name": "stdout",
|
| 588 |
-
"output_type": "stream",
|
| 589 |
-
"text": [
|
| 590 |
-
"0 (1) [unified] add/delete one or more (special) birds/pigs\n",
|
| 591 |
-
"1 (2) add one or more houses\n",
|
| 592 |
-
"2 (3) change HP\n",
|
| 593 |
-
"3 (4) change background\n",
|
| 594 |
-
"4 (5) change positions\n",
|
| 595 |
-
"5 (6) change size\n",
|
| 596 |
-
"6 (7) change skin\n",
|
| 597 |
-
"7 (8) list birds or pigs\n"
|
| 598 |
-
]
|
| 599 |
-
}
|
| 600 |
-
],
|
| 601 |
-
"source": [
|
| 602 |
-
"for i, x in enumerate(bird.list_functionality()['data']):\n",
|
| 603 |
-
" print(i,x)"
|
| 604 |
-
]
|
| 605 |
-
},
|
| 606 |
-
{
|
| 607 |
-
"cell_type": "code",
|
| 608 |
-
"execution_count": 132,
|
| 609 |
-
"id": "3a11c8b8-4cea-42fc-930b-66dd7330c074",
|
| 610 |
-
"metadata": {},
|
| 611 |
-
"outputs": [],
|
| 612 |
-
"source": [
|
| 613 |
-
"# print(json.dumps(bird.show_json(),indent=4))"
|
| 614 |
-
]
|
| 615 |
-
},
|
| 616 |
-
{
|
| 617 |
-
"cell_type": "code",
|
| 618 |
-
"execution_count": null,
|
| 619 |
-
"id": "75cf385f-ba62-452d-a98a-fd3d0bd36031",
|
| 620 |
-
"metadata": {},
|
| 621 |
-
"outputs": [],
|
| 622 |
-
"source": []
|
| 623 |
-
},
|
| 624 |
-
{
|
| 625 |
-
"cell_type": "code",
|
| 626 |
-
"execution_count": 11,
|
| 627 |
-
"id": "e8c93b82-86ca-4c2a-aa79-2b9b1d4e6351",
|
| 628 |
-
"metadata": {},
|
| 629 |
-
"outputs": [
|
| 630 |
-
{
|
| 631 |
-
"name": "stdout",
|
| 632 |
-
"output_type": "stream",
|
| 633 |
-
"text": [
|
| 634 |
-
"skip init\n",
|
| 635 |
-
"\n",
|
| 636 |
-
"--------------------\n",
|
| 637 |
-
"query count: 1\n",
|
| 638 |
-
"input: add two birds\n",
|
| 639 |
-
"{\n",
|
| 640 |
-
" \"status\": \"OK\",\n",
|
| 641 |
-
" \"result\": [\n",
|
| 642 |
-
" \"bird\",\n",
|
| 643 |
-
" \"add\",\n",
|
| 644 |
-
" {\n",
|
| 645 |
-
" \"quantity\": 2\n",
|
| 646 |
-
" }\n",
|
| 647 |
-
" ],\n",
|
| 648 |
-
" \"command\": \"add two birds\",\n",
|
| 649 |
-
" \"timestamp\": \"2023-09-16 15:55:07.691027\",\n",
|
| 650 |
-
" \"ai-version\": \"3.8.0.2023-09-14-a\"\n",
|
| 651 |
-
"}\n",
|
| 652 |
-
"[\n",
|
| 653 |
-
" [\n",
|
| 654 |
-
" 0,\n",
|
| 655 |
-
" \"1.00000000\",\n",
|
| 656 |
-
" \"add two birds\"\n",
|
| 657 |
-
" ],\n",
|
| 658 |
-
" [\n",
|
| 659 |
-
" 1,\n",
|
| 660 |
-
" \"0.97266663\",\n",
|
| 661 |
-
" \"add 2 birds\"\n",
|
| 662 |
-
" ],\n",
|
| 663 |
-
" [\n",
|
| 664 |
-
" 2,\n",
|
| 665 |
-
" \"0.96591405\",\n",
|
| 666 |
-
" \"add two big birds\"\n",
|
| 667 |
-
" ],\n",
|
| 668 |
-
" [\n",
|
| 669 |
-
" 3,\n",
|
| 670 |
-
" \"0.94957413\",\n",
|
| 671 |
-
" \"add one bird\"\n",
|
| 672 |
-
" ],\n",
|
| 673 |
-
" [\n",
|
| 674 |
-
" 4,\n",
|
| 675 |
-
" \"0.94873926\",\n",
|
| 676 |
-
" \"add 2 big birds\"\n",
|
| 677 |
-
" ]\n",
|
| 678 |
-
"]\n",
|
| 679 |
-
"top: add two birds\n"
|
| 680 |
-
]
|
| 681 |
-
},
|
| 682 |
-
{
|
| 683 |
-
"data": {
|
| 684 |
-
"text/plain": [
|
| 685 |
-
"({'status': 'OK',\n",
|
| 686 |
-
" 'result': ['bird', 'add', {'quantity': 2}],\n",
|
| 687 |
-
" 'command': 'add two birds',\n",
|
| 688 |
-
" 'timestamp': '2023-09-16 15:55:07.691027',\n",
|
| 689 |
-
" 'ai-version': '3.8.0.2023-09-14-a'},\n",
|
| 690 |
-
" [[0, '1.00000000', 'add two birds'],\n",
|
| 691 |
-
" [1, '0.97266663', 'add 2 birds'],\n",
|
| 692 |
-
" [2, '0.96591405', 'add two big birds'],\n",
|
| 693 |
-
" [3, '0.94957413', 'add one bird'],\n",
|
| 694 |
-
" [4, '0.94873926', 'add 2 big birds']])"
|
| 695 |
-
]
|
| 696 |
-
},
|
| 697 |
-
"execution_count": 11,
|
| 698 |
-
"metadata": {},
|
| 699 |
-
"output_type": "execute_result"
|
| 700 |
-
}
|
| 701 |
-
],
|
| 702 |
-
"source": [
|
| 703 |
-
"bird.query_entry_point('add two birds')"
|
| 704 |
-
]
|
| 705 |
-
},
|
| 706 |
-
{
|
| 707 |
-
"cell_type": "code",
|
| 708 |
-
"execution_count": 32,
|
| 709 |
-
"id": "4403f4a2-bf66-479b-a70d-d0df9a1b2c1b",
|
| 710 |
-
"metadata": {},
|
| 711 |
-
"outputs": [],
|
| 712 |
-
"source": [
|
| 713 |
-
"command = 'check'"
|
| 714 |
-
]
|
| 715 |
-
},
|
| 716 |
-
{
|
| 717 |
-
"cell_type": "code",
|
| 718 |
-
"execution_count": 35,
|
| 719 |
-
"id": "97b73dd8-0bbf-498d-b992-573a2a30480a",
|
| 720 |
-
"metadata": {},
|
| 721 |
-
"outputs": [
|
| 722 |
-
{
|
| 723 |
-
"name": "stdout",
|
| 724 |
-
"output_type": "stream",
|
| 725 |
-
"text": [
|
| 726 |
-
"skip init\n",
|
| 727 |
-
"\n",
|
| 728 |
-
"--------------------\n",
|
| 729 |
-
"angrybird query count: 3\n",
|
| 730 |
-
"input: check\n",
|
| 731 |
-
"{\n",
|
| 732 |
-
" \"status\": \"Failure\",\n",
|
| 733 |
-
" \"result\": [\n",
|
| 734 |
-
" \"We don't understand your request.\",\n",
|
| 735 |
-
" \"Our best guess is: 'move birds'\"\n",
|
| 736 |
-
" ],\n",
|
| 737 |
-
" \"command\": \"check\",\n",
|
| 738 |
-
" \"timestamp\": \"2023-09-17 23:41:16.912413\",\n",
|
| 739 |
-
" \"ai-version\": \"3.8.0.2023-09-17-a\"\n",
|
| 740 |
-
"}\n",
|
| 741 |
-
"[\n",
|
| 742 |
-
" [\n",
|
| 743 |
-
" 0,\n",
|
| 744 |
-
" \"0.76896785\",\n",
|
| 745 |
-
" \"move birds\"\n",
|
| 746 |
-
" ],\n",
|
| 747 |
-
" [\n",
|
| 748 |
-
" 1,\n",
|
| 749 |
-
" \"0.76711535\",\n",
|
| 750 |
-
" \"add two birds\"\n",
|
| 751 |
-
" ],\n",
|
| 752 |
-
" [\n",
|
| 753 |
-
" 2,\n",
|
| 754 |
-
" \"0.76695086\",\n",
|
| 755 |
-
" \"list birds\"\n",
|
| 756 |
-
" ],\n",
|
| 757 |
-
" [\n",
|
| 758 |
-
" 3,\n",
|
| 759 |
-
" \"0.76688633\",\n",
|
| 760 |
-
" \"change pigs\"\n",
|
| 761 |
-
" ],\n",
|
| 762 |
-
" [\n",
|
| 763 |
-
" 4,\n",
|
| 764 |
-
" \"0.76666684\",\n",
|
| 765 |
-
" \"change volumn\"\n",
|
| 766 |
-
" ]\n",
|
| 767 |
-
"]\n",
|
| 768 |
-
"top: move birds\n"
|
| 769 |
-
]
|
| 770 |
-
},
|
| 771 |
-
{
|
| 772 |
-
"data": {
|
| 773 |
-
"text/plain": [
|
| 774 |
-
"({'status': 'Failure',\n",
|
| 775 |
-
" 'result': [\"We don't understand your request.\",\n",
|
| 776 |
-
" \"Our best guess is: 'move birds'\"],\n",
|
| 777 |
-
" 'command': 'check',\n",
|
| 778 |
-
" 'timestamp': '2023-09-17 23:41:16.912413',\n",
|
| 779 |
-
" 'ai-version': '3.8.0.2023-09-17-a'},\n",
|
| 780 |
-
" [[0, '0.76896785', 'move birds'],\n",
|
| 781 |
-
" [1, '0.76711535', 'add two birds'],\n",
|
| 782 |
-
" [2, '0.76695086', 'list birds'],\n",
|
| 783 |
-
" [3, '0.76688633', 'change pigs'],\n",
|
| 784 |
-
" [4, '0.76666684', 'change volumn']])"
|
| 785 |
-
]
|
| 786 |
-
},
|
| 787 |
-
"execution_count": 35,
|
| 788 |
-
"metadata": {},
|
| 789 |
-
"output_type": "execute_result"
|
| 790 |
-
}
|
| 791 |
-
],
|
| 792 |
-
"source": [
|
| 793 |
-
"bird.query_entry_point(command)"
|
| 794 |
-
]
|
| 795 |
-
},
|
| 796 |
-
{
|
| 797 |
-
"cell_type": "code",
|
| 798 |
-
"execution_count": 34,
|
| 799 |
-
"id": "d5d67ed9-e901-4cc4-b796-cbcf13d3a5a2",
|
| 800 |
-
"metadata": {},
|
| 801 |
-
"outputs": [
|
| 802 |
-
{
|
| 803 |
-
"name": "stdout",
|
| 804 |
-
"output_type": "stream",
|
| 805 |
-
"text": [
|
| 806 |
-
"/Users/shaojun/playgo/bbc123/games/angrybirds/notebooks\n"
|
| 807 |
-
]
|
| 808 |
-
}
|
| 809 |
-
],
|
| 810 |
-
"source": [
|
| 811 |
-
"!pwd"
|
| 812 |
-
]
|
| 813 |
-
},
|
| 814 |
-
{
|
| 815 |
-
"cell_type": "code",
|
| 816 |
-
"execution_count": null,
|
| 817 |
-
"id": "01ec8620-dc1d-4de6-88ee-d6aec794fce6",
|
| 818 |
-
"metadata": {},
|
| 819 |
-
"outputs": [],
|
| 820 |
-
"source": []
|
| 821 |
-
}
|
| 822 |
-
],
|
| 823 |
-
"metadata": {
|
| 824 |
-
"kernelspec": {
|
| 825 |
-
"display_name": "Python 3 (ipykernel)",
|
| 826 |
-
"language": "python",
|
| 827 |
-
"name": "python3"
|
| 828 |
-
},
|
| 829 |
-
"language_info": {
|
| 830 |
-
"codemirror_mode": {
|
| 831 |
-
"name": "ipython",
|
| 832 |
-
"version": 3
|
| 833 |
-
},
|
| 834 |
-
"file_extension": ".py",
|
| 835 |
-
"mimetype": "text/x-python",
|
| 836 |
-
"name": "python",
|
| 837 |
-
"nbconvert_exporter": "python",
|
| 838 |
-
"pygments_lexer": "ipython3",
|
| 839 |
-
"version": "3.11.4"
|
| 840 |
-
}
|
| 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|
|
|
|
|
|
games/angrybirds/notebooks/demo.ipynb
DELETED
|
@@ -1,502 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "code",
|
| 5 |
-
"execution_count": 18,
|
| 6 |
-
"id": "245fbc34-352d-4945-a689-d04f9365bb99",
|
| 7 |
-
"metadata": {},
|
| 8 |
-
"outputs": [
|
| 9 |
-
{
|
| 10 |
-
"name": "stdout",
|
| 11 |
-
"output_type": "stream",
|
| 12 |
-
"text": [
|
| 13 |
-
"The autoreload extension is already loaded. To reload it, use:\n",
|
| 14 |
-
" %reload_ext autoreload\n"
|
| 15 |
-
]
|
| 16 |
-
}
|
| 17 |
-
],
|
| 18 |
-
"source": [
|
| 19 |
-
"%load_ext autoreload\n",
|
| 20 |
-
"%autoreload 2"
|
| 21 |
-
]
|
| 22 |
-
},
|
| 23 |
-
{
|
| 24 |
-
"cell_type": "code",
|
| 25 |
-
"execution_count": 28,
|
| 26 |
-
"id": "eaed216c-160a-4e31-96fe-015c140ff18b",
|
| 27 |
-
"metadata": {},
|
| 28 |
-
"outputs": [],
|
| 29 |
-
"source": [
|
| 30 |
-
"from pprint import pprint"
|
| 31 |
-
]
|
| 32 |
-
},
|
| 33 |
-
{
|
| 34 |
-
"cell_type": "code",
|
| 35 |
-
"execution_count": 39,
|
| 36 |
-
"id": "f6aa8ec8-ad1f-4cd5-819a-2b5786724a5b",
|
| 37 |
-
"metadata": {},
|
| 38 |
-
"outputs": [],
|
| 39 |
-
"source": [
|
| 40 |
-
"from games.angrybirds.angrybirds import bird\n",
|
| 41 |
-
"from games.angrybirds.config import config"
|
| 42 |
-
]
|
| 43 |
-
},
|
| 44 |
-
{
|
| 45 |
-
"cell_type": "code",
|
| 46 |
-
"execution_count": 40,
|
| 47 |
-
"id": "1b0a6bee-18a3-4f50-9065-6e5e5eb4cad0",
|
| 48 |
-
"metadata": {},
|
| 49 |
-
"outputs": [],
|
| 50 |
-
"source": [
|
| 51 |
-
"game = bird()"
|
| 52 |
-
]
|
| 53 |
-
},
|
| 54 |
-
{
|
| 55 |
-
"cell_type": "code",
|
| 56 |
-
"execution_count": null,
|
| 57 |
-
"id": "a15d43e9-802f-4385-82ef-b052e46d63aa",
|
| 58 |
-
"metadata": {},
|
| 59 |
-
"outputs": [],
|
| 60 |
-
"source": []
|
| 61 |
-
},
|
| 62 |
-
{
|
| 63 |
-
"cell_type": "code",
|
| 64 |
-
"execution_count": 25,
|
| 65 |
-
"id": "bfa4c3b9-538f-43c5-ad8e-4400bbd81b8d",
|
| 66 |
-
"metadata": {},
|
| 67 |
-
"outputs": [],
|
| 68 |
-
"source": [
|
| 69 |
-
"res = bird.query(bird.input)"
|
| 70 |
-
]
|
| 71 |
-
},
|
| 72 |
-
{
|
| 73 |
-
"cell_type": "code",
|
| 74 |
-
"execution_count": 30,
|
| 75 |
-
"id": "68dccb67-3f86-4b10-9dfd-12df7357f5b4",
|
| 76 |
-
"metadata": {},
|
| 77 |
-
"outputs": [
|
| 78 |
-
{
|
| 79 |
-
"name": "stdout",
|
| 80 |
-
"output_type": "stream",
|
| 81 |
-
"text": [
|
| 82 |
-
"('The user wants to add more birds to the game because they find it too '\n",
|
| 83 |
-
" 'difficult. Therefore, the answer is (A) birds.')\n"
|
| 84 |
-
]
|
| 85 |
-
}
|
| 86 |
-
],
|
| 87 |
-
"source": [
|
| 88 |
-
"pprint(res)"
|
| 89 |
-
]
|
| 90 |
-
},
|
| 91 |
-
{
|
| 92 |
-
"cell_type": "code",
|
| 93 |
-
"execution_count": 33,
|
| 94 |
-
"id": "a93d24dd-098a-4604-bdcc-30abe098f417",
|
| 95 |
-
"metadata": {},
|
| 96 |
-
"outputs": [
|
| 97 |
-
{
|
| 98 |
-
"data": {
|
| 99 |
-
"text/plain": [
|
| 100 |
-
"str"
|
| 101 |
-
]
|
| 102 |
-
},
|
| 103 |
-
"execution_count": 33,
|
| 104 |
-
"metadata": {},
|
| 105 |
-
"output_type": "execute_result"
|
| 106 |
-
}
|
| 107 |
-
],
|
| 108 |
-
"source": [
|
| 109 |
-
"type(res)"
|
| 110 |
-
]
|
| 111 |
-
},
|
| 112 |
-
{
|
| 113 |
-
"cell_type": "code",
|
| 114 |
-
"execution_count": 49,
|
| 115 |
-
"id": "f53461f4-7718-4eb0-b047-ba4ae88c3016",
|
| 116 |
-
"metadata": {},
|
| 117 |
-
"outputs": [],
|
| 118 |
-
"source": [
|
| 119 |
-
"prompt = \"The game is too difficult. Please add more birds.\""
|
| 120 |
-
]
|
| 121 |
-
},
|
| 122 |
-
{
|
| 123 |
-
"cell_type": "code",
|
| 124 |
-
"execution_count": 92,
|
| 125 |
-
"id": "d3909a61-5bdf-4b77-89db-f41928112013",
|
| 126 |
-
"metadata": {},
|
| 127 |
-
"outputs": [],
|
| 128 |
-
"source": [
|
| 129 |
-
"prompt = \"Make the bird bigger, so it can run it over to the enemies.\""
|
| 130 |
-
]
|
| 131 |
-
},
|
| 132 |
-
{
|
| 133 |
-
"cell_type": "code",
|
| 134 |
-
"execution_count": null,
|
| 135 |
-
"id": "a79562aa-b978-474e-87e3-4eb3ac6c7316",
|
| 136 |
-
"metadata": {},
|
| 137 |
-
"outputs": [],
|
| 138 |
-
"source": []
|
| 139 |
-
},
|
| 140 |
-
{
|
| 141 |
-
"cell_type": "code",
|
| 142 |
-
"execution_count": null,
|
| 143 |
-
"id": "485e9947-c982-4d2c-a170-bd6bd79f6d02",
|
| 144 |
-
"metadata": {},
|
| 145 |
-
"outputs": [],
|
| 146 |
-
"source": []
|
| 147 |
-
},
|
| 148 |
-
{
|
| 149 |
-
"cell_type": "code",
|
| 150 |
-
"execution_count": null,
|
| 151 |
-
"id": "ae9bb6ad-cfbc-4666-adc9-3a354110f0f9",
|
| 152 |
-
"metadata": {},
|
| 153 |
-
"outputs": [],
|
| 154 |
-
"source": []
|
| 155 |
-
},
|
| 156 |
-
{
|
| 157 |
-
"cell_type": "code",
|
| 158 |
-
"execution_count": 125,
|
| 159 |
-
"id": "41cbe328-3a8b-4fca-b54a-3720a654ffbb",
|
| 160 |
-
"metadata": {},
|
| 161 |
-
"outputs": [],
|
| 162 |
-
"source": [
|
| 163 |
-
"q = [\n",
|
| 164 |
-
" {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n",
|
| 165 |
-
" {'role': 'user', 'content': f\"\"\"\n",
|
| 166 |
-
"{config.game_desc}\n",
|
| 167 |
-
"\n",
|
| 168 |
-
"In this user prompt: \\\"{prompt}\\\".\n",
|
| 169 |
-
"\n",
|
| 170 |
-
"The user is talking about \n",
|
| 171 |
-
"(A) birds (B) pigs (C) eggs (D) structures (E) none of the above.\n",
|
| 172 |
-
"\n",
|
| 173 |
-
"Please answer it in the most concise way.\n",
|
| 174 |
-
"\"\"\"}\n",
|
| 175 |
-
"]"
|
| 176 |
-
]
|
| 177 |
-
},
|
| 178 |
-
{
|
| 179 |
-
"cell_type": "code",
|
| 180 |
-
"execution_count": 143,
|
| 181 |
-
"id": "c7901c49-90d2-4837-aaf7-54055e924608",
|
| 182 |
-
"metadata": {},
|
| 183 |
-
"outputs": [],
|
| 184 |
-
"source": [
|
| 185 |
-
"q = [\n",
|
| 186 |
-
" {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n",
|
| 187 |
-
" {'role': 'user', 'content': f\"\"\"\n",
|
| 188 |
-
"{config.game_desc}\n",
|
| 189 |
-
"\n",
|
| 190 |
-
"In this user prompt: \\\"{prompt}\\\".\n",
|
| 191 |
-
"\n",
|
| 192 |
-
"The user wants to make changes to the __ of the pigs\n",
|
| 193 |
-
"(A) color (B) type (C) quantity (D) size (E) none of the above.\n",
|
| 194 |
-
"\n",
|
| 195 |
-
"Please answer it in the following format:\n",
|
| 196 |
-
"Answer: (<choice>)\n",
|
| 197 |
-
"\"\"\"}\n",
|
| 198 |
-
"]"
|
| 199 |
-
]
|
| 200 |
-
},
|
| 201 |
-
{
|
| 202 |
-
"cell_type": "code",
|
| 203 |
-
"execution_count": 144,
|
| 204 |
-
"id": "59bb772b-5cc1-47ed-87e1-fdd4f6808227",
|
| 205 |
-
"metadata": {},
|
| 206 |
-
"outputs": [],
|
| 207 |
-
"source": [
|
| 208 |
-
"res = game.query(q)"
|
| 209 |
-
]
|
| 210 |
-
},
|
| 211 |
-
{
|
| 212 |
-
"cell_type": "code",
|
| 213 |
-
"execution_count": 145,
|
| 214 |
-
"id": "afa4cd1b-4b5e-4c9d-8d58-a4e274bb66f6",
|
| 215 |
-
"metadata": {},
|
| 216 |
-
"outputs": [
|
| 217 |
-
{
|
| 218 |
-
"data": {
|
| 219 |
-
"text/plain": [
|
| 220 |
-
"'Answer: (D) size'"
|
| 221 |
-
]
|
| 222 |
-
},
|
| 223 |
-
"execution_count": 145,
|
| 224 |
-
"metadata": {},
|
| 225 |
-
"output_type": "execute_result"
|
| 226 |
-
}
|
| 227 |
-
],
|
| 228 |
-
"source": [
|
| 229 |
-
"res"
|
| 230 |
-
]
|
| 231 |
-
},
|
| 232 |
-
{
|
| 233 |
-
"cell_type": "code",
|
| 234 |
-
"execution_count": 131,
|
| 235 |
-
"id": "df30476b-3b1b-4b57-b458-5d2560422dd2",
|
| 236 |
-
"metadata": {},
|
| 237 |
-
"outputs": [
|
| 238 |
-
{
|
| 239 |
-
"data": {
|
| 240 |
-
"text/plain": [
|
| 241 |
-
"'Make the bird bigger, so it can run it over to the enemies.'"
|
| 242 |
-
]
|
| 243 |
-
},
|
| 244 |
-
"execution_count": 131,
|
| 245 |
-
"metadata": {},
|
| 246 |
-
"output_type": "execute_result"
|
| 247 |
-
}
|
| 248 |
-
],
|
| 249 |
-
"source": [
|
| 250 |
-
"prompt"
|
| 251 |
-
]
|
| 252 |
-
},
|
| 253 |
-
{
|
| 254 |
-
"cell_type": "code",
|
| 255 |
-
"execution_count": 124,
|
| 256 |
-
"id": "239aee58-c53a-4938-9f3b-aeb3749efbe7",
|
| 257 |
-
"metadata": {},
|
| 258 |
-
"outputs": [
|
| 259 |
-
{
|
| 260 |
-
"data": {
|
| 261 |
-
"text/plain": [
|
| 262 |
-
"[{'role': 'system', 'content': 'You are a helpful assistant.'},\n",
|
| 263 |
-
" {'role': 'user',\n",
|
| 264 |
-
" 'content': '\\n\\nImaging we are playing the angry birds game described as the following: \\n\\nIn Angry Birds, players take control of a group of birds who are seeking revenge on a group of green pigs that have stolen their eggs. The gameplay involves using a slingshot to launch the birds at various structures where the pigs are hiding. The objective is to eliminate all the pigs on each level and score as many points as possible.\\n\\nYou are assistant to help me figure out what is going on.\\n\\n\\nIn this user prompt: \"Make the bird bigger, so it can run it over to the enemies.\".\\n\\nDoes the user wants to make changes to the size of the pigs?\\n\\nPlease answer \"Yes\" or \"No\"\\n\\n'}]"
|
| 265 |
-
]
|
| 266 |
-
},
|
| 267 |
-
"execution_count": 124,
|
| 268 |
-
"metadata": {},
|
| 269 |
-
"output_type": "execute_result"
|
| 270 |
-
}
|
| 271 |
-
],
|
| 272 |
-
"source": [
|
| 273 |
-
"q"
|
| 274 |
-
]
|
| 275 |
-
},
|
| 276 |
-
{
|
| 277 |
-
"cell_type": "code",
|
| 278 |
-
"execution_count": 6,
|
| 279 |
-
"id": "b8b0423f-58f2-4dad-a062-a0ffba33cb16",
|
| 280 |
-
"metadata": {},
|
| 281 |
-
"outputs": [
|
| 282 |
-
{
|
| 283 |
-
"name": "stdout",
|
| 284 |
-
"output_type": "stream",
|
| 285 |
-
"text": [
|
| 286 |
-
"[usr]: \n",
|
| 287 |
-
"Make the bird red.\n",
|
| 288 |
-
"\n",
|
| 289 |
-
"[sys]: please wait...\n",
|
| 290 |
-
"[app]: bird\n",
|
| 291 |
-
"[app]: color\n",
|
| 292 |
-
"[app]: red\n"
|
| 293 |
-
]
|
| 294 |
-
}
|
| 295 |
-
],
|
| 296 |
-
"source": [
|
| 297 |
-
"msg = bird.query(\"\"\"\n",
|
| 298 |
-
"Make the bird red.\n",
|
| 299 |
-
"\"\"\")"
|
| 300 |
-
]
|
| 301 |
-
},
|
| 302 |
-
{
|
| 303 |
-
"cell_type": "code",
|
| 304 |
-
"execution_count": 23,
|
| 305 |
-
"id": "6fe2bdc8-4324-4a4a-bcce-6b1ccf1a07ea",
|
| 306 |
-
"metadata": {},
|
| 307 |
-
"outputs": [],
|
| 308 |
-
"source": [
|
| 309 |
-
"str = \"\"\"\n",
|
| 310 |
-
"color = \"red\"\n",
|
| 311 |
-
"bird.set_color(color)\n",
|
| 312 |
-
"\"\"\""
|
| 313 |
-
]
|
| 314 |
-
},
|
| 315 |
-
{
|
| 316 |
-
"cell_type": "code",
|
| 317 |
-
"execution_count": 24,
|
| 318 |
-
"id": "22ed7d59-8845-4a96-8451-90056ed96246",
|
| 319 |
-
"metadata": {},
|
| 320 |
-
"outputs": [
|
| 321 |
-
{
|
| 322 |
-
"name": "stdout",
|
| 323 |
-
"output_type": "stream",
|
| 324 |
-
"text": [
|
| 325 |
-
"\n",
|
| 326 |
-
"color = \"red\"\n",
|
| 327 |
-
"bird.set_color(color)\n",
|
| 328 |
-
"\n"
|
| 329 |
-
]
|
| 330 |
-
}
|
| 331 |
-
],
|
| 332 |
-
"source": [
|
| 333 |
-
"print(str)"
|
| 334 |
-
]
|
| 335 |
-
},
|
| 336 |
-
{
|
| 337 |
-
"cell_type": "code",
|
| 338 |
-
"execution_count": 25,
|
| 339 |
-
"id": "c3cd1824-63d4-48f3-a347-5194e1f27351",
|
| 340 |
-
"metadata": {},
|
| 341 |
-
"outputs": [],
|
| 342 |
-
"source": [
|
| 343 |
-
"# eval(str)"
|
| 344 |
-
]
|
| 345 |
-
},
|
| 346 |
-
{
|
| 347 |
-
"cell_type": "code",
|
| 348 |
-
"execution_count": 13,
|
| 349 |
-
"id": "38e842b8-ef0a-4fd9-bf6d-e2cba9721f7a",
|
| 350 |
-
"metadata": {},
|
| 351 |
-
"outputs": [
|
| 352 |
-
{
|
| 353 |
-
"name": "stdout",
|
| 354 |
-
"output_type": "stream",
|
| 355 |
-
"text": [
|
| 356 |
-
"[usr]: \n",
|
| 357 |
-
"I want to make the bird much much biger.\n",
|
| 358 |
-
"\n",
|
| 359 |
-
"[sys]: please wait...\n",
|
| 360 |
-
"[app]: bird\n",
|
| 361 |
-
"[app]: size\n",
|
| 362 |
-
"[app]: increase a lot\n"
|
| 363 |
-
]
|
| 364 |
-
}
|
| 365 |
-
],
|
| 366 |
-
"source": [
|
| 367 |
-
"msg = bird.query(\"\"\"\n",
|
| 368 |
-
"I want to make the bird much much biger.\n",
|
| 369 |
-
"\"\"\")"
|
| 370 |
-
]
|
| 371 |
-
},
|
| 372 |
-
{
|
| 373 |
-
"cell_type": "code",
|
| 374 |
-
"execution_count": null,
|
| 375 |
-
"id": "9d29a9d4-128b-46a0-bce9-13cff90de2e9",
|
| 376 |
-
"metadata": {},
|
| 377 |
-
"outputs": [],
|
| 378 |
-
"source": [
|
| 379 |
-
"bird.set_size_by(1.5)"
|
| 380 |
-
]
|
| 381 |
-
},
|
| 382 |
-
{
|
| 383 |
-
"cell_type": "code",
|
| 384 |
-
"execution_count": 15,
|
| 385 |
-
"id": "e7ee7f38-cf01-475d-82ee-454d4f65f96b",
|
| 386 |
-
"metadata": {},
|
| 387 |
-
"outputs": [
|
| 388 |
-
{
|
| 389 |
-
"name": "stdout",
|
| 390 |
-
"output_type": "stream",
|
| 391 |
-
"text": [
|
| 392 |
-
"[usr]: \n",
|
| 393 |
-
"I want to rotate the pipes faster.\n",
|
| 394 |
-
"\n",
|
| 395 |
-
"[sys]: please wait...\n",
|
| 396 |
-
"[app]: pipes\n",
|
| 397 |
-
"[app]: rotate\n"
|
| 398 |
-
]
|
| 399 |
-
}
|
| 400 |
-
],
|
| 401 |
-
"source": [
|
| 402 |
-
"msg = bird.query(\"\"\"\n",
|
| 403 |
-
"I want to rotate the pipes faster.\n",
|
| 404 |
-
"\"\"\")"
|
| 405 |
-
]
|
| 406 |
-
},
|
| 407 |
-
{
|
| 408 |
-
"cell_type": "code",
|
| 409 |
-
"execution_count": 28,
|
| 410 |
-
"id": "8eb9bb6c-8e2b-43df-8504-226700dc6adf",
|
| 411 |
-
"metadata": {},
|
| 412 |
-
"outputs": [
|
| 413 |
-
{
|
| 414 |
-
"name": "stdout",
|
| 415 |
-
"output_type": "stream",
|
| 416 |
-
"text": [
|
| 417 |
-
"[usr]: \n",
|
| 418 |
-
"I want to change the bird's color to piink.\n",
|
| 419 |
-
"\n",
|
| 420 |
-
"[sys]: please wait...\n",
|
| 421 |
-
"[app]: bird\n",
|
| 422 |
-
"[app]: color\n",
|
| 423 |
-
"[app]: pink\n"
|
| 424 |
-
]
|
| 425 |
-
}
|
| 426 |
-
],
|
| 427 |
-
"source": [
|
| 428 |
-
"msg = bird.query(\"\"\"\n",
|
| 429 |
-
"I want to change the bird's color to piink.\n",
|
| 430 |
-
"\"\"\")"
|
| 431 |
-
]
|
| 432 |
-
},
|
| 433 |
-
{
|
| 434 |
-
"cell_type": "code",
|
| 435 |
-
"execution_count": 29,
|
| 436 |
-
"id": "cc2f00d6-4e6c-478e-a409-664e87f39054",
|
| 437 |
-
"metadata": {},
|
| 438 |
-
"outputs": [
|
| 439 |
-
{
|
| 440 |
-
"name": "stdout",
|
| 441 |
-
"output_type": "stream",
|
| 442 |
-
"text": [
|
| 443 |
-
"[usr]: \n",
|
| 444 |
-
"Add new species of birds\n",
|
| 445 |
-
"\n",
|
| 446 |
-
"[sys]: please wait...\n",
|
| 447 |
-
"[app]: bird\n",
|
| 448 |
-
"[app]: none of the above\n",
|
| 449 |
-
"not implemented\n"
|
| 450 |
-
]
|
| 451 |
-
},
|
| 452 |
-
{
|
| 453 |
-
"ename": "AssertionError",
|
| 454 |
-
"evalue": "",
|
| 455 |
-
"output_type": "error",
|
| 456 |
-
"traceback": [
|
| 457 |
-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
| 458 |
-
"\u001b[0;31mAssertionError\u001b[0m Traceback (most recent call last)",
|
| 459 |
-
"Cell \u001b[0;32mIn[29], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m msg \u001b[38;5;241m=\u001b[39m \u001b[43mbird\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mquery\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\"\"\u001b[39;49m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;124;43mAdd new species of birds\u001b[39;49m\n\u001b[1;32m 3\u001b[0m \u001b[38;5;124;43m\"\"\"\u001b[39;49m\u001b[43m)\u001b[49m\n",
|
| 460 |
-
"File \u001b[0;32m~/playgo/playgo.py:149\u001b[0m, in \u001b[0;36mbird.query\u001b[0;34m(self, user_request_prompt)\u001b[0m\n\u001b[1;32m 146\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_config()\n\u001b[1;32m 148\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_query_util(user_request_prompt, quiet\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m)\n\u001b[0;32m--> 149\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_follow_up\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
|
| 461 |
-
"File \u001b[0;32m~/playgo/playgo.py:234\u001b[0m, in \u001b[0;36mbird._follow_up\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 232\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 233\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mnot implemented\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m--> 234\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28;01mFalse\u001b[39;00m\n",
|
| 462 |
-
"\u001b[0;31mAssertionError\u001b[0m: "
|
| 463 |
-
]
|
| 464 |
-
}
|
| 465 |
-
],
|
| 466 |
-
"source": [
|
| 467 |
-
"msg = bird.query(\"\"\"\n",
|
| 468 |
-
"Add new species of birds\n",
|
| 469 |
-
"\"\"\")"
|
| 470 |
-
]
|
| 471 |
-
},
|
| 472 |
-
{
|
| 473 |
-
"cell_type": "code",
|
| 474 |
-
"execution_count": null,
|
| 475 |
-
"id": "5e3ef720-7948-49ca-ba94-fa1359271f3a",
|
| 476 |
-
"metadata": {},
|
| 477 |
-
"outputs": [],
|
| 478 |
-
"source": []
|
| 479 |
-
}
|
| 480 |
-
],
|
| 481 |
-
"metadata": {
|
| 482 |
-
"kernelspec": {
|
| 483 |
-
"display_name": "Python 3 (ipykernel)",
|
| 484 |
-
"language": "python",
|
| 485 |
-
"name": "python3"
|
| 486 |
-
},
|
| 487 |
-
"language_info": {
|
| 488 |
-
"codemirror_mode": {
|
| 489 |
-
"name": "ipython",
|
| 490 |
-
"version": 3
|
| 491 |
-
},
|
| 492 |
-
"file_extension": ".py",
|
| 493 |
-
"mimetype": "text/x-python",
|
| 494 |
-
"name": "python",
|
| 495 |
-
"nbconvert_exporter": "python",
|
| 496 |
-
"pygments_lexer": "ipython3",
|
| 497 |
-
"version": "3.11.4"
|
| 498 |
-
}
|
| 499 |
-
},
|
| 500 |
-
"nbformat": 4,
|
| 501 |
-
"nbformat_minor": 5
|
| 502 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
games/angrybirds/notebooks/query.ipynb
DELETED
|
@@ -1,358 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "code",
|
| 5 |
-
"execution_count": 1,
|
| 6 |
-
"id": "245fbc34-352d-4945-a689-d04f9365bb99",
|
| 7 |
-
"metadata": {},
|
| 8 |
-
"outputs": [],
|
| 9 |
-
"source": [
|
| 10 |
-
"%load_ext autoreload\n",
|
| 11 |
-
"%autoreload 2"
|
| 12 |
-
]
|
| 13 |
-
},
|
| 14 |
-
{
|
| 15 |
-
"cell_type": "code",
|
| 16 |
-
"execution_count": 7,
|
| 17 |
-
"id": "f6aa8ec8-ad1f-4cd5-819a-2b5786724a5b",
|
| 18 |
-
"metadata": {},
|
| 19 |
-
"outputs": [],
|
| 20 |
-
"source": [
|
| 21 |
-
"import playgo"
|
| 22 |
-
]
|
| 23 |
-
},
|
| 24 |
-
{
|
| 25 |
-
"cell_type": "code",
|
| 26 |
-
"execution_count": 3,
|
| 27 |
-
"id": "1b0a6bee-18a3-4f50-9065-6e5e5eb4cad0",
|
| 28 |
-
"metadata": {},
|
| 29 |
-
"outputs": [],
|
| 30 |
-
"source": [
|
| 31 |
-
"bird = playgo.bird()"
|
| 32 |
-
]
|
| 33 |
-
},
|
| 34 |
-
{
|
| 35 |
-
"cell_type": "code",
|
| 36 |
-
"execution_count": 4,
|
| 37 |
-
"id": "ba76086b-0aef-4af7-b77a-fb9ebda928aa",
|
| 38 |
-
"metadata": {},
|
| 39 |
-
"outputs": [
|
| 40 |
-
{
|
| 41 |
-
"name": "stdout",
|
| 42 |
-
"output_type": "stream",
|
| 43 |
-
"text": [
|
| 44 |
-
"[usr]: \n",
|
| 45 |
-
"I want to make the bird look tiny.\n",
|
| 46 |
-
"\n",
|
| 47 |
-
"[sys]: please wait...\n",
|
| 48 |
-
"[app]: bird\n",
|
| 49 |
-
"[app]: size\n",
|
| 50 |
-
"[app]: decrease for an unspecified amount\n"
|
| 51 |
-
]
|
| 52 |
-
}
|
| 53 |
-
],
|
| 54 |
-
"source": [
|
| 55 |
-
"msg = bird.query(\"\"\"\n",
|
| 56 |
-
"I want to make the bird look tiny.\n",
|
| 57 |
-
"\"\"\")"
|
| 58 |
-
]
|
| 59 |
-
},
|
| 60 |
-
{
|
| 61 |
-
"cell_type": "code",
|
| 62 |
-
"execution_count": 5,
|
| 63 |
-
"id": "953e901f-ea39-4fb7-ae58-9d7de13eec3e",
|
| 64 |
-
"metadata": {},
|
| 65 |
-
"outputs": [
|
| 66 |
-
{
|
| 67 |
-
"name": "stdout",
|
| 68 |
-
"output_type": "stream",
|
| 69 |
-
"text": [
|
| 70 |
-
"[usr]: \n",
|
| 71 |
-
"I want to make the bird very very small.\n",
|
| 72 |
-
"\n",
|
| 73 |
-
"[sys]: please wait...\n",
|
| 74 |
-
"[app]: bird\n",
|
| 75 |
-
"[app]: size\n",
|
| 76 |
-
"[app]: decrease a lot\n"
|
| 77 |
-
]
|
| 78 |
-
}
|
| 79 |
-
],
|
| 80 |
-
"source": [
|
| 81 |
-
"msg = bird.query(\"\"\"\n",
|
| 82 |
-
"I want to make the bird very very small.\n",
|
| 83 |
-
"\"\"\")"
|
| 84 |
-
]
|
| 85 |
-
},
|
| 86 |
-
{
|
| 87 |
-
"cell_type": "code",
|
| 88 |
-
"execution_count": 8,
|
| 89 |
-
"id": "8dc6d4f7-3c84-4e39-9804-1d0508d6c5f1",
|
| 90 |
-
"metadata": {},
|
| 91 |
-
"outputs": [
|
| 92 |
-
{
|
| 93 |
-
"name": "stdout",
|
| 94 |
-
"output_type": "stream",
|
| 95 |
-
"text": [
|
| 96 |
-
"[usr]: \n",
|
| 97 |
-
"I want to make the bird very small.\n",
|
| 98 |
-
"\n",
|
| 99 |
-
"[sys]: please wait...\n",
|
| 100 |
-
"[app]: bird\n",
|
| 101 |
-
"[app]: size\n",
|
| 102 |
-
"[app]: decrease a little\n"
|
| 103 |
-
]
|
| 104 |
-
}
|
| 105 |
-
],
|
| 106 |
-
"source": [
|
| 107 |
-
"msg = bird.query(\"\"\"\n",
|
| 108 |
-
"I want to make the bird very small.\n",
|
| 109 |
-
"\"\"\")"
|
| 110 |
-
]
|
| 111 |
-
},
|
| 112 |
-
{
|
| 113 |
-
"cell_type": "code",
|
| 114 |
-
"execution_count": 9,
|
| 115 |
-
"id": "fe4be8ed-15f1-4293-9627-7685ea0fc886",
|
| 116 |
-
"metadata": {},
|
| 117 |
-
"outputs": [
|
| 118 |
-
{
|
| 119 |
-
"name": "stdout",
|
| 120 |
-
"output_type": "stream",
|
| 121 |
-
"text": [
|
| 122 |
-
"[usr]: \n",
|
| 123 |
-
"I want to make the bird much much smaller.\n",
|
| 124 |
-
"\n",
|
| 125 |
-
"[sys]: please wait...\n",
|
| 126 |
-
"[app]: bird\n",
|
| 127 |
-
"[app]: size\n",
|
| 128 |
-
"[app]: decrease a lot\n"
|
| 129 |
-
]
|
| 130 |
-
}
|
| 131 |
-
],
|
| 132 |
-
"source": [
|
| 133 |
-
"msg = bird.query(\"\"\"\n",
|
| 134 |
-
"I want to make the bird much much smaller.\n",
|
| 135 |
-
"\"\"\")"
|
| 136 |
-
]
|
| 137 |
-
},
|
| 138 |
-
{
|
| 139 |
-
"cell_type": "code",
|
| 140 |
-
"execution_count": 10,
|
| 141 |
-
"id": "6fc9a34b-9197-489a-92fe-ac7bf8118b88",
|
| 142 |
-
"metadata": {},
|
| 143 |
-
"outputs": [
|
| 144 |
-
{
|
| 145 |
-
"name": "stdout",
|
| 146 |
-
"output_type": "stream",
|
| 147 |
-
"text": [
|
| 148 |
-
"[usr]: \n",
|
| 149 |
-
"I want to make the bird biger.\n",
|
| 150 |
-
"\n",
|
| 151 |
-
"[sys]: please wait...\n",
|
| 152 |
-
"[app]: bird\n",
|
| 153 |
-
"[app]: size\n",
|
| 154 |
-
"[app]: increase for an unspecified amount\n"
|
| 155 |
-
]
|
| 156 |
-
}
|
| 157 |
-
],
|
| 158 |
-
"source": [
|
| 159 |
-
"msg = bird.query(\"\"\"\n",
|
| 160 |
-
"I want to make the bird biger.\n",
|
| 161 |
-
"\"\"\")"
|
| 162 |
-
]
|
| 163 |
-
},
|
| 164 |
-
{
|
| 165 |
-
"cell_type": "code",
|
| 166 |
-
"execution_count": 11,
|
| 167 |
-
"id": "73a72c28-da0b-4722-947f-1dd3d4202e07",
|
| 168 |
-
"metadata": {},
|
| 169 |
-
"outputs": [
|
| 170 |
-
{
|
| 171 |
-
"name": "stdout",
|
| 172 |
-
"output_type": "stream",
|
| 173 |
-
"text": [
|
| 174 |
-
"[usr]: \n",
|
| 175 |
-
"I want to make the bird bigger.\n",
|
| 176 |
-
"\n",
|
| 177 |
-
"[sys]: please wait...\n",
|
| 178 |
-
"[app]: bird\n",
|
| 179 |
-
"[app]: size\n",
|
| 180 |
-
"[app]: increase for an unspecified amount\n"
|
| 181 |
-
]
|
| 182 |
-
}
|
| 183 |
-
],
|
| 184 |
-
"source": [
|
| 185 |
-
"msg = bird.query(\"\"\"\n",
|
| 186 |
-
"I want to make the bird bigger.\n",
|
| 187 |
-
"\"\"\")"
|
| 188 |
-
]
|
| 189 |
-
},
|
| 190 |
-
{
|
| 191 |
-
"cell_type": "code",
|
| 192 |
-
"execution_count": 12,
|
| 193 |
-
"id": "852b49e8-f15f-4202-a20f-dd835b54e60b",
|
| 194 |
-
"metadata": {},
|
| 195 |
-
"outputs": [
|
| 196 |
-
{
|
| 197 |
-
"name": "stdout",
|
| 198 |
-
"output_type": "stream",
|
| 199 |
-
"text": [
|
| 200 |
-
"[usr]: \n",
|
| 201 |
-
"I want to change the bird's color to 13.\n",
|
| 202 |
-
"\n",
|
| 203 |
-
"[sys]: please wait...\n",
|
| 204 |
-
"[app]: Please modify your request. Reason: \n",
|
| 205 |
-
"The user's request doesn't make sense because colors are usually represented by names or codes such as \"red\", \"#FF0000\" or \"rgb(255, 0, 0)\", not by numbers. Additionally, the game in the prompt is described as a simple side-scroller in which the player controls a bird flying between green pipes, and it doesn't mention the ability to change the bird's color.\n"
|
| 206 |
-
]
|
| 207 |
-
}
|
| 208 |
-
],
|
| 209 |
-
"source": [
|
| 210 |
-
"msg = bird.query(\"\"\"\n",
|
| 211 |
-
"I want to change the bird's color to 13.\n",
|
| 212 |
-
"\"\"\")"
|
| 213 |
-
]
|
| 214 |
-
},
|
| 215 |
-
{
|
| 216 |
-
"cell_type": "code",
|
| 217 |
-
"execution_count": 13,
|
| 218 |
-
"id": "e6e3fc93-7701-475a-b412-50fe2d32e7ce",
|
| 219 |
-
"metadata": {},
|
| 220 |
-
"outputs": [
|
| 221 |
-
{
|
| 222 |
-
"name": "stdout",
|
| 223 |
-
"output_type": "stream",
|
| 224 |
-
"text": [
|
| 225 |
-
"[usr]: \n",
|
| 226 |
-
"I want to change the bird's color to pink\"\n",
|
| 227 |
-
"\n",
|
| 228 |
-
"[sys]: please wait...\n",
|
| 229 |
-
"[app]: bird\n",
|
| 230 |
-
"[app]: color\n",
|
| 231 |
-
"[app]: pink\n"
|
| 232 |
-
]
|
| 233 |
-
}
|
| 234 |
-
],
|
| 235 |
-
"source": [
|
| 236 |
-
"msg = bird.query(\"\"\"\n",
|
| 237 |
-
"I want to change the bird's color to pink\"\n",
|
| 238 |
-
"\"\"\")"
|
| 239 |
-
]
|
| 240 |
-
},
|
| 241 |
-
{
|
| 242 |
-
"cell_type": "code",
|
| 243 |
-
"execution_count": 14,
|
| 244 |
-
"id": "eaf17c3c-9014-4d4d-bfcd-2fb1c54478a8",
|
| 245 |
-
"metadata": {},
|
| 246 |
-
"outputs": [
|
| 247 |
-
{
|
| 248 |
-
"name": "stdout",
|
| 249 |
-
"output_type": "stream",
|
| 250 |
-
"text": [
|
| 251 |
-
"[usr]: \n",
|
| 252 |
-
"I want to change the bird's color to piink\"\n",
|
| 253 |
-
"\n",
|
| 254 |
-
"[sys]: please wait...\n",
|
| 255 |
-
"[app]: bird\n",
|
| 256 |
-
"[app]: color\n",
|
| 257 |
-
"[app]: pink\n"
|
| 258 |
-
]
|
| 259 |
-
}
|
| 260 |
-
],
|
| 261 |
-
"source": [
|
| 262 |
-
"msg = bird.query(\"\"\"\n",
|
| 263 |
-
"I want to change the bird's color to piink\"\n",
|
| 264 |
-
"\"\"\")"
|
| 265 |
-
]
|
| 266 |
-
},
|
| 267 |
-
{
|
| 268 |
-
"cell_type": "code",
|
| 269 |
-
"execution_count": 15,
|
| 270 |
-
"id": "479eb160-952d-48c1-a502-821fafeace1c",
|
| 271 |
-
"metadata": {},
|
| 272 |
-
"outputs": [
|
| 273 |
-
{
|
| 274 |
-
"name": "stdout",
|
| 275 |
-
"output_type": "stream",
|
| 276 |
-
"text": [
|
| 277 |
-
"[usr]: \n",
|
| 278 |
-
"I want to change the pipe's color red instead of green\"\n",
|
| 279 |
-
"\n",
|
| 280 |
-
"[sys]: please wait...\n",
|
| 281 |
-
"[app]: pipes\n",
|
| 282 |
-
"[app]: color\n",
|
| 283 |
-
"[app]: red\n"
|
| 284 |
-
]
|
| 285 |
-
}
|
| 286 |
-
],
|
| 287 |
-
"source": [
|
| 288 |
-
"msg = bird.query(\"\"\"\n",
|
| 289 |
-
"I want to change the pipe's color red instead of green\"\n",
|
| 290 |
-
"\"\"\")"
|
| 291 |
-
]
|
| 292 |
-
},
|
| 293 |
-
{
|
| 294 |
-
"cell_type": "code",
|
| 295 |
-
"execution_count": 16,
|
| 296 |
-
"id": "35c8f908-f363-40f6-8cd2-bea208b4d7a0",
|
| 297 |
-
"metadata": {},
|
| 298 |
-
"outputs": [
|
| 299 |
-
{
|
| 300 |
-
"name": "stdout",
|
| 301 |
-
"output_type": "stream",
|
| 302 |
-
"text": [
|
| 303 |
-
"[usr]: \n",
|
| 304 |
-
"I want to make the pipe rotate\"\n",
|
| 305 |
-
"\n",
|
| 306 |
-
"[sys]: please wait...\n",
|
| 307 |
-
"[app]: pipes\n",
|
| 308 |
-
"[app]: rotate\n"
|
| 309 |
-
]
|
| 310 |
-
}
|
| 311 |
-
],
|
| 312 |
-
"source": [
|
| 313 |
-
"msg = bird.query(\"\"\"\n",
|
| 314 |
-
"I want to make the pipe rotate\"\n",
|
| 315 |
-
"\"\"\")"
|
| 316 |
-
]
|
| 317 |
-
},
|
| 318 |
-
{
|
| 319 |
-
"cell_type": "code",
|
| 320 |
-
"execution_count": 17,
|
| 321 |
-
"id": "b8b0423f-58f2-4dad-a062-a0ffba33cb16",
|
| 322 |
-
"metadata": {},
|
| 323 |
-
"outputs": [],
|
| 324 |
-
"source": [
|
| 325 |
-
"# bird.messages"
|
| 326 |
-
]
|
| 327 |
-
},
|
| 328 |
-
{
|
| 329 |
-
"cell_type": "code",
|
| 330 |
-
"execution_count": null,
|
| 331 |
-
"id": "7d0822f0-5552-4739-8858-62bee4eb414f",
|
| 332 |
-
"metadata": {},
|
| 333 |
-
"outputs": [],
|
| 334 |
-
"source": []
|
| 335 |
-
}
|
| 336 |
-
],
|
| 337 |
-
"metadata": {
|
| 338 |
-
"kernelspec": {
|
| 339 |
-
"display_name": "Python 3 (ipykernel)",
|
| 340 |
-
"language": "python",
|
| 341 |
-
"name": "python3"
|
| 342 |
-
},
|
| 343 |
-
"language_info": {
|
| 344 |
-
"codemirror_mode": {
|
| 345 |
-
"name": "ipython",
|
| 346 |
-
"version": 3
|
| 347 |
-
},
|
| 348 |
-
"file_extension": ".py",
|
| 349 |
-
"mimetype": "text/x-python",
|
| 350 |
-
"name": "python",
|
| 351 |
-
"nbconvert_exporter": "python",
|
| 352 |
-
"pygments_lexer": "ipython3",
|
| 353 |
-
"version": "3.11.4"
|
| 354 |
-
}
|
| 355 |
-
},
|
| 356 |
-
"nbformat": 4,
|
| 357 |
-
"nbformat_minor": 5
|
| 358 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
games/angrybirds/notebooks/rm-pkl2.ipynb
DELETED
|
@@ -1,1008 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "code",
|
| 5 |
-
"execution_count": 1,
|
| 6 |
-
"id": "245fbc34-352d-4945-a689-d04f9365bb99",
|
| 7 |
-
"metadata": {},
|
| 8 |
-
"outputs": [],
|
| 9 |
-
"source": [
|
| 10 |
-
"%load_ext autoreload\n",
|
| 11 |
-
"%autoreload 2"
|
| 12 |
-
]
|
| 13 |
-
},
|
| 14 |
-
{
|
| 15 |
-
"cell_type": "code",
|
| 16 |
-
"execution_count": null,
|
| 17 |
-
"id": "c088c757-ef2c-43f2-baa2-1a8691174925",
|
| 18 |
-
"metadata": {},
|
| 19 |
-
"outputs": [],
|
| 20 |
-
"source": []
|
| 21 |
-
},
|
| 22 |
-
{
|
| 23 |
-
"cell_type": "code",
|
| 24 |
-
"execution_count": 2,
|
| 25 |
-
"id": "eaed216c-160a-4e31-96fe-015c140ff18b",
|
| 26 |
-
"metadata": {},
|
| 27 |
-
"outputs": [],
|
| 28 |
-
"source": [
|
| 29 |
-
"# from pprint import pprint"
|
| 30 |
-
]
|
| 31 |
-
},
|
| 32 |
-
{
|
| 33 |
-
"cell_type": "code",
|
| 34 |
-
"execution_count": 3,
|
| 35 |
-
"id": "97953551-8ef1-42c1-9317-99d5e65f535e",
|
| 36 |
-
"metadata": {},
|
| 37 |
-
"outputs": [],
|
| 38 |
-
"source": [
|
| 39 |
-
"import json\n",
|
| 40 |
-
"# import pandas as pd\n",
|
| 41 |
-
"# import pickle\n",
|
| 42 |
-
"\n",
|
| 43 |
-
"import openai\n",
|
| 44 |
-
"from openai.embeddings_utils import get_embedding, cosine_similarity\n",
|
| 45 |
-
"\n",
|
| 46 |
-
"# from games.snake.util import util\n",
|
| 47 |
-
"from games.angrybirds.config import config\n",
|
| 48 |
-
"# from games.snake.prompt import prompt\n",
|
| 49 |
-
"# from games.snake.query import query, yes_no_query\n",
|
| 50 |
-
"from games.angrybirds.angrybirds import angrybird"
|
| 51 |
-
]
|
| 52 |
-
},
|
| 53 |
-
{
|
| 54 |
-
"cell_type": "code",
|
| 55 |
-
"execution_count": null,
|
| 56 |
-
"id": "fc213f4c-cb07-468b-b15f-60e5120b3d94",
|
| 57 |
-
"metadata": {},
|
| 58 |
-
"outputs": [],
|
| 59 |
-
"source": []
|
| 60 |
-
},
|
| 61 |
-
{
|
| 62 |
-
"cell_type": "code",
|
| 63 |
-
"execution_count": 4,
|
| 64 |
-
"id": "0c876614-a9bf-4d0b-a728-07770f1ad9c5",
|
| 65 |
-
"metadata": {},
|
| 66 |
-
"outputs": [
|
| 67 |
-
{
|
| 68 |
-
"name": "stdout",
|
| 69 |
-
"output_type": "stream",
|
| 70 |
-
"text": [
|
| 71 |
-
"before add_config\n",
|
| 72 |
-
"941\n",
|
| 73 |
-
"942\n",
|
| 74 |
-
"943\n",
|
| 75 |
-
"944\n",
|
| 76 |
-
"945\n",
|
| 77 |
-
"946\n",
|
| 78 |
-
"947\n",
|
| 79 |
-
"948\n",
|
| 80 |
-
"949\n",
|
| 81 |
-
"950\n",
|
| 82 |
-
"after add_config\n",
|
| 83 |
-
"950\n",
|
| 84 |
-
"final\n",
|
| 85 |
-
"1016\n"
|
| 86 |
-
]
|
| 87 |
-
}
|
| 88 |
-
],
|
| 89 |
-
"source": [
|
| 90 |
-
"game = angrybird()"
|
| 91 |
-
]
|
| 92 |
-
},
|
| 93 |
-
{
|
| 94 |
-
"cell_type": "code",
|
| 95 |
-
"execution_count": null,
|
| 96 |
-
"id": "2f262d0d-287e-44ed-bb51-48f7e5d574fa",
|
| 97 |
-
"metadata": {},
|
| 98 |
-
"outputs": [],
|
| 99 |
-
"source": []
|
| 100 |
-
},
|
| 101 |
-
{
|
| 102 |
-
"cell_type": "code",
|
| 103 |
-
"execution_count": 5,
|
| 104 |
-
"id": "1411de96-97d5-4bac-b8ed-e279fb1edaa0",
|
| 105 |
-
"metadata": {},
|
| 106 |
-
"outputs": [
|
| 107 |
-
{
|
| 108 |
-
"data": {
|
| 109 |
-
"text/plain": [
|
| 110 |
-
"0"
|
| 111 |
-
]
|
| 112 |
-
},
|
| 113 |
-
"execution_count": 5,
|
| 114 |
-
"metadata": {},
|
| 115 |
-
"output_type": "execute_result"
|
| 116 |
-
}
|
| 117 |
-
],
|
| 118 |
-
"source": [
|
| 119 |
-
"len(game.embeddings)"
|
| 120 |
-
]
|
| 121 |
-
},
|
| 122 |
-
{
|
| 123 |
-
"cell_type": "code",
|
| 124 |
-
"execution_count": 6,
|
| 125 |
-
"id": "129403ce-69f4-4f2a-9b22-7b3e36d78f24",
|
| 126 |
-
"metadata": {},
|
| 127 |
-
"outputs": [
|
| 128 |
-
{
|
| 129 |
-
"data": {
|
| 130 |
-
"text/plain": [
|
| 131 |
-
"{}"
|
| 132 |
-
]
|
| 133 |
-
},
|
| 134 |
-
"execution_count": 6,
|
| 135 |
-
"metadata": {},
|
| 136 |
-
"output_type": "execute_result"
|
| 137 |
-
}
|
| 138 |
-
],
|
| 139 |
-
"source": [
|
| 140 |
-
"game.embeddings"
|
| 141 |
-
]
|
| 142 |
-
},
|
| 143 |
-
{
|
| 144 |
-
"cell_type": "code",
|
| 145 |
-
"execution_count": 7,
|
| 146 |
-
"id": "50e372eb-48ba-4378-b866-f2b7120bc94e",
|
| 147 |
-
"metadata": {},
|
| 148 |
-
"outputs": [
|
| 149 |
-
{
|
| 150 |
-
"data": {
|
| 151 |
-
"text/plain": [
|
| 152 |
-
"1016"
|
| 153 |
-
]
|
| 154 |
-
},
|
| 155 |
-
"execution_count": 7,
|
| 156 |
-
"metadata": {},
|
| 157 |
-
"output_type": "execute_result"
|
| 158 |
-
}
|
| 159 |
-
],
|
| 160 |
-
"source": [
|
| 161 |
-
"len(game.train)"
|
| 162 |
-
]
|
| 163 |
-
},
|
| 164 |
-
{
|
| 165 |
-
"cell_type": "code",
|
| 166 |
-
"execution_count": null,
|
| 167 |
-
"id": "f78b2c43-bfc7-478f-894d-d757b0e9927f",
|
| 168 |
-
"metadata": {},
|
| 169 |
-
"outputs": [],
|
| 170 |
-
"source": []
|
| 171 |
-
},
|
| 172 |
-
{
|
| 173 |
-
"cell_type": "code",
|
| 174 |
-
"execution_count": 8,
|
| 175 |
-
"id": "163545c6-c707-401a-93b8-fb2cb9d65136",
|
| 176 |
-
"metadata": {},
|
| 177 |
-
"outputs": [
|
| 178 |
-
{
|
| 179 |
-
"name": "stdout",
|
| 180 |
-
"output_type": "stream",
|
| 181 |
-
"text": [
|
| 182 |
-
"initializing...\n",
|
| 183 |
-
"loading embeddings from a file...\n",
|
| 184 |
-
"pkl size: 1016\n",
|
| 185 |
-
"embedding size: 1016\n",
|
| 186 |
-
"creating embeddings by query OpenAI...\n",
|
| 187 |
-
"embedding size: 1016\n",
|
| 188 |
-
"train size: 1016\n"
|
| 189 |
-
]
|
| 190 |
-
}
|
| 191 |
-
],
|
| 192 |
-
"source": [
|
| 193 |
-
"game.init_emb()"
|
| 194 |
-
]
|
| 195 |
-
},
|
| 196 |
-
{
|
| 197 |
-
"cell_type": "code",
|
| 198 |
-
"execution_count": 9,
|
| 199 |
-
"id": "31c02b28-0078-425d-87b6-702caeea02e3",
|
| 200 |
-
"metadata": {},
|
| 201 |
-
"outputs": [
|
| 202 |
-
{
|
| 203 |
-
"data": {
|
| 204 |
-
"text/plain": [
|
| 205 |
-
"1016"
|
| 206 |
-
]
|
| 207 |
-
},
|
| 208 |
-
"execution_count": 9,
|
| 209 |
-
"metadata": {},
|
| 210 |
-
"output_type": "execute_result"
|
| 211 |
-
}
|
| 212 |
-
],
|
| 213 |
-
"source": [
|
| 214 |
-
"len(game.embeddings)"
|
| 215 |
-
]
|
| 216 |
-
},
|
| 217 |
-
{
|
| 218 |
-
"cell_type": "code",
|
| 219 |
-
"execution_count": null,
|
| 220 |
-
"id": "067905b6-b030-4df1-9570-d45885f775eb",
|
| 221 |
-
"metadata": {},
|
| 222 |
-
"outputs": [],
|
| 223 |
-
"source": []
|
| 224 |
-
},
|
| 225 |
-
{
|
| 226 |
-
"cell_type": "code",
|
| 227 |
-
"execution_count": 10,
|
| 228 |
-
"id": "02478e9b-dd11-406a-b405-ea4ee56975b1",
|
| 229 |
-
"metadata": {},
|
| 230 |
-
"outputs": [],
|
| 231 |
-
"source": [
|
| 232 |
-
"import os"
|
| 233 |
-
]
|
| 234 |
-
},
|
| 235 |
-
{
|
| 236 |
-
"cell_type": "code",
|
| 237 |
-
"execution_count": 11,
|
| 238 |
-
"id": "7b506b8c-0b60-44e4-bb6e-f4af8439f04f",
|
| 239 |
-
"metadata": {},
|
| 240 |
-
"outputs": [],
|
| 241 |
-
"source": [
|
| 242 |
-
"# root = os.environ['PYTHONPATH']\n",
|
| 243 |
-
"# root"
|
| 244 |
-
]
|
| 245 |
-
},
|
| 246 |
-
{
|
| 247 |
-
"cell_type": "code",
|
| 248 |
-
"execution_count": null,
|
| 249 |
-
"id": "e977cf56-3bfc-4c87-884e-58577b3808cd",
|
| 250 |
-
"metadata": {},
|
| 251 |
-
"outputs": [],
|
| 252 |
-
"source": []
|
| 253 |
-
},
|
| 254 |
-
{
|
| 255 |
-
"cell_type": "code",
|
| 256 |
-
"execution_count": 12,
|
| 257 |
-
"id": "5662bd80-03c5-4793-94c3-4d0392c08102",
|
| 258 |
-
"metadata": {},
|
| 259 |
-
"outputs": [
|
| 260 |
-
{
|
| 261 |
-
"name": "stdout",
|
| 262 |
-
"output_type": "stream",
|
| 263 |
-
"text": [
|
| 264 |
-
"before add_config\n",
|
| 265 |
-
"1016\n",
|
| 266 |
-
"1016\n",
|
| 267 |
-
"1016\n",
|
| 268 |
-
"1016\n",
|
| 269 |
-
"1016\n",
|
| 270 |
-
"1016\n",
|
| 271 |
-
"1016\n",
|
| 272 |
-
"1016\n",
|
| 273 |
-
"1016\n",
|
| 274 |
-
"1016\n",
|
| 275 |
-
"after add_config\n",
|
| 276 |
-
"1016\n",
|
| 277 |
-
"final\n",
|
| 278 |
-
"1016\n"
|
| 279 |
-
]
|
| 280 |
-
}
|
| 281 |
-
],
|
| 282 |
-
"source": [
|
| 283 |
-
"conf = config()\n",
|
| 284 |
-
"conf.init_game_train()"
|
| 285 |
-
]
|
| 286 |
-
},
|
| 287 |
-
{
|
| 288 |
-
"cell_type": "code",
|
| 289 |
-
"execution_count": null,
|
| 290 |
-
"id": "73c89724-e5dd-4f08-b398-3ec78fcc4f82",
|
| 291 |
-
"metadata": {},
|
| 292 |
-
"outputs": [],
|
| 293 |
-
"source": []
|
| 294 |
-
},
|
| 295 |
-
{
|
| 296 |
-
"cell_type": "code",
|
| 297 |
-
"execution_count": 13,
|
| 298 |
-
"id": "30fb4dd7-35d8-442f-bd6e-29e15374e3d6",
|
| 299 |
-
"metadata": {},
|
| 300 |
-
"outputs": [],
|
| 301 |
-
"source": [
|
| 302 |
-
"with open(f'../game_train.json', 'w') as f:\n",
|
| 303 |
-
" json.dump(config.game_train, f, indent=4)"
|
| 304 |
-
]
|
| 305 |
-
},
|
| 306 |
-
{
|
| 307 |
-
"cell_type": "code",
|
| 308 |
-
"execution_count": 14,
|
| 309 |
-
"id": "3c051dbf-d547-4297-8f14-f464e58e9a64",
|
| 310 |
-
"metadata": {},
|
| 311 |
-
"outputs": [],
|
| 312 |
-
"source": [
|
| 313 |
-
"with open(f'../game_train.json', 'r') as f:\n",
|
| 314 |
-
" tmp = json.load(f)"
|
| 315 |
-
]
|
| 316 |
-
},
|
| 317 |
-
{
|
| 318 |
-
"cell_type": "code",
|
| 319 |
-
"execution_count": 15,
|
| 320 |
-
"id": "77789684-e7b1-4e28-b9b7-5fbca3b6d376",
|
| 321 |
-
"metadata": {},
|
| 322 |
-
"outputs": [
|
| 323 |
-
{
|
| 324 |
-
"data": {
|
| 325 |
-
"text/plain": [
|
| 326 |
-
"True"
|
| 327 |
-
]
|
| 328 |
-
},
|
| 329 |
-
"execution_count": 15,
|
| 330 |
-
"metadata": {},
|
| 331 |
-
"output_type": "execute_result"
|
| 332 |
-
}
|
| 333 |
-
],
|
| 334 |
-
"source": [
|
| 335 |
-
"config.game_train == tmp"
|
| 336 |
-
]
|
| 337 |
-
},
|
| 338 |
-
{
|
| 339 |
-
"cell_type": "code",
|
| 340 |
-
"execution_count": null,
|
| 341 |
-
"id": "051b4e35-c84a-4ae9-b3db-80aee6772e2d",
|
| 342 |
-
"metadata": {},
|
| 343 |
-
"outputs": [],
|
| 344 |
-
"source": []
|
| 345 |
-
},
|
| 346 |
-
{
|
| 347 |
-
"cell_type": "code",
|
| 348 |
-
"execution_count": 16,
|
| 349 |
-
"id": "02133e42-b076-4618-83ba-bf23f5112185",
|
| 350 |
-
"metadata": {},
|
| 351 |
-
"outputs": [
|
| 352 |
-
{
|
| 353 |
-
"name": "stderr",
|
| 354 |
-
"output_type": "stream",
|
| 355 |
-
"text": [
|
| 356 |
-
"100%|███████████████████████████████████████| 1016/1016 [00:13<00:00, 77.17it/s]\n"
|
| 357 |
-
]
|
| 358 |
-
}
|
| 359 |
-
],
|
| 360 |
-
"source": [
|
| 361 |
-
"game.dump()"
|
| 362 |
-
]
|
| 363 |
-
},
|
| 364 |
-
{
|
| 365 |
-
"cell_type": "code",
|
| 366 |
-
"execution_count": null,
|
| 367 |
-
"id": "c4fc4888-6084-4034-a920-a0d0372e7755",
|
| 368 |
-
"metadata": {},
|
| 369 |
-
"outputs": [],
|
| 370 |
-
"source": []
|
| 371 |
-
},
|
| 372 |
-
{
|
| 373 |
-
"cell_type": "code",
|
| 374 |
-
"execution_count": null,
|
| 375 |
-
"id": "11a50d4a-1465-4b36-bc62-d8f7592298c1",
|
| 376 |
-
"metadata": {},
|
| 377 |
-
"outputs": [],
|
| 378 |
-
"source": []
|
| 379 |
-
},
|
| 380 |
-
{
|
| 381 |
-
"cell_type": "code",
|
| 382 |
-
"execution_count": 17,
|
| 383 |
-
"id": "7c72275c-75a0-478a-b4e5-01c71f7b5c69",
|
| 384 |
-
"metadata": {},
|
| 385 |
-
"outputs": [],
|
| 386 |
-
"source": [
|
| 387 |
-
"import os"
|
| 388 |
-
]
|
| 389 |
-
},
|
| 390 |
-
{
|
| 391 |
-
"cell_type": "code",
|
| 392 |
-
"execution_count": null,
|
| 393 |
-
"id": "6aa5d783-f01d-400e-8868-55a0707457e8",
|
| 394 |
-
"metadata": {},
|
| 395 |
-
"outputs": [],
|
| 396 |
-
"source": []
|
| 397 |
-
},
|
| 398 |
-
{
|
| 399 |
-
"cell_type": "code",
|
| 400 |
-
"execution_count": 18,
|
| 401 |
-
"id": "3d66b866-237c-485d-a466-fc32fea95158",
|
| 402 |
-
"metadata": {},
|
| 403 |
-
"outputs": [
|
| 404 |
-
{
|
| 405 |
-
"name": "stdout",
|
| 406 |
-
"output_type": "stream",
|
| 407 |
-
"text": [
|
| 408 |
-
"total 79416\n",
|
| 409 |
-
"-rw-r--r-- 1 shaojun staff 34452 Sep 27 14:56 ab.json\n",
|
| 410 |
-
"-rw-r--r-- 1 shaojun staff 68893 Sep 27 14:56 ef.json\n",
|
| 411 |
-
"-rw-r--r-- 1 shaojun staff 68901 Sep 27 14:56 69.json\n",
|
| 412 |
-
"-rw-r--r-- 1 shaojun staff 34380 Sep 27 14:56 0a.json\n",
|
| 413 |
-
"-rw-r--r-- 1 shaojun staff 68823 Sep 27 14:56 11.json\n",
|
| 414 |
-
"-rw-r--r-- 1 shaojun staff 137767 Sep 27 14:56 81.json\n",
|
| 415 |
-
"-rw-r--r-- 1 shaojun staff 103298 Sep 27 14:56 5e.json\n",
|
| 416 |
-
"-rw-r--r-- 1 shaojun staff 34447 Sep 27 14:56 57.json\n",
|
| 417 |
-
"-rw-r--r-- 1 shaojun staff 103185 Sep 27 14:56 99.json\n",
|
| 418 |
-
"-rw-r--r-- 1 shaojun staff 34495 Sep 27 14:56 03.json\n",
|
| 419 |
-
"-rw-r--r-- 1 shaojun staff 68847 Sep 27 14:56 85.json\n",
|
| 420 |
-
"-rw-r--r-- 1 shaojun staff 103272 Sep 27 14:56 d6.json\n",
|
| 421 |
-
"-rw-r--r-- 1 shaojun staff 103254 Sep 27 14:56 71.json\n",
|
| 422 |
-
"-rw-r--r-- 1 shaojun staff 103356 Sep 27 14:56 a4.json\n",
|
| 423 |
-
"-rw-r--r-- 1 shaojun staff 172215 Sep 27 14:56 c0.json\n",
|
| 424 |
-
"-rw-r--r-- 1 shaojun staff 68853 Sep 27 14:56 46.json\n",
|
| 425 |
-
"-rw-r--r-- 1 shaojun staff 172146 Sep 27 14:56 5b.json\n",
|
| 426 |
-
"-rw-r--r-- 1 shaojun staff 34400 Sep 27 14:56 94.json\n",
|
| 427 |
-
"-rw-r--r-- 1 shaojun staff 68896 Sep 27 14:56 c1.json\n",
|
| 428 |
-
"-rw-r--r-- 1 shaojun staff 206481 Sep 27 14:56 bf.json\n",
|
| 429 |
-
"-rw-r--r-- 1 shaojun staff 68965 Sep 27 14:56 14.json\n",
|
| 430 |
-
"-rw-r--r-- 1 shaojun staff 68833 Sep 27 14:56 c6.json\n",
|
| 431 |
-
"-rw-r--r-- 1 shaojun staff 68869 Sep 27 14:56 cd.json\n",
|
| 432 |
-
"-rw-r--r-- 1 shaojun staff 206469 Sep 27 14:56 59.json\n",
|
| 433 |
-
"-rw-r--r-- 1 shaojun staff 68849 Sep 27 14:56 ee.json\n",
|
| 434 |
-
"-rw-r--r-- 1 shaojun staff 68925 Sep 27 14:56 20.json\n",
|
| 435 |
-
"-rw-r--r-- 1 shaojun staff 137698 Sep 27 14:56 df.json\n",
|
| 436 |
-
"-rw-r--r-- 1 shaojun staff 68883 Sep 27 14:56 fa.json\n",
|
| 437 |
-
"-rw-r--r-- 1 shaojun staff 68860 Sep 27 14:56 cb.json\n",
|
| 438 |
-
"-rw-r--r-- 1 shaojun staff 172188 Sep 27 14:56 63.json\n",
|
| 439 |
-
"-rw-r--r-- 1 shaojun staff 103252 Sep 27 14:56 e7.json\n",
|
| 440 |
-
"-rw-r--r-- 1 shaojun staff 172137 Sep 27 14:56 d1.json\n",
|
| 441 |
-
"-rw-r--r-- 1 shaojun staff 137754 Sep 27 14:56 80.json\n",
|
| 442 |
-
"-rw-r--r-- 1 shaojun staff 172119 Sep 27 14:56 0d.json\n",
|
| 443 |
-
"-rw-r--r-- 1 shaojun staff 137728 Sep 27 14:56 8d.json\n",
|
| 444 |
-
"-rw-r--r-- 1 shaojun staff 34412 Sep 27 14:56 77.json\n",
|
| 445 |
-
"-rw-r--r-- 1 shaojun staff 137524 Sep 27 14:56 89.json\n",
|
| 446 |
-
"-rw-r--r-- 1 shaojun staff 68785 Sep 27 14:56 f7.json\n",
|
| 447 |
-
"-rw-r--r-- 1 shaojun staff 103286 Sep 27 14:56 2e.json\n",
|
| 448 |
-
"-rw-r--r-- 1 shaojun staff 103284 Sep 27 14:56 cc.json\n",
|
| 449 |
-
"-rw-r--r-- 1 shaojun staff 103361 Sep 27 14:56 a5.json\n",
|
| 450 |
-
"-rw-r--r-- 1 shaojun staff 172162 Sep 27 14:56 b8.json\n",
|
| 451 |
-
"-rw-r--r-- 1 shaojun staff 206554 Sep 27 14:56 1e.json\n",
|
| 452 |
-
"-rw-r--r-- 1 shaojun staff 137706 Sep 27 14:56 52.json\n",
|
| 453 |
-
"-rw-r--r-- 1 shaojun staff 241040 Sep 27 14:56 d2.json\n",
|
| 454 |
-
"-rw-r--r-- 1 shaojun staff 137823 Sep 27 14:56 6b.json\n",
|
| 455 |
-
"-rw-r--r-- 1 shaojun staff 68845 Sep 27 14:56 50.json\n",
|
| 456 |
-
"-rw-r--r-- 1 shaojun staff 137872 Sep 27 14:56 f4.json\n",
|
| 457 |
-
"-rw-r--r-- 1 shaojun staff 103341 Sep 27 14:56 1c.json\n",
|
| 458 |
-
"-rw-r--r-- 1 shaojun staff 137725 Sep 27 14:56 b5.json\n",
|
| 459 |
-
"-rw-r--r-- 1 shaojun staff 172264 Sep 27 14:56 d8.json\n",
|
| 460 |
-
"-rw-r--r-- 1 shaojun staff 137704 Sep 27 14:56 24.json\n",
|
| 461 |
-
"-rw-r--r-- 1 shaojun staff 172163 Sep 27 14:56 37.json\n",
|
| 462 |
-
"-rw-r--r-- 1 shaojun staff 68848 Sep 27 14:56 66.json\n",
|
| 463 |
-
"-rw-r--r-- 1 shaojun staff 68844 Sep 27 14:56 01.json\n",
|
| 464 |
-
"-rw-r--r-- 1 shaojun staff 68865 Sep 27 14:56 55.json\n",
|
| 465 |
-
"-rw-r--r-- 1 shaojun staff 68792 Sep 27 14:56 35.json\n",
|
| 466 |
-
"-rw-r--r-- 1 shaojun staff 68927 Sep 27 14:56 c2.json\n",
|
| 467 |
-
"-rw-r--r-- 1 shaojun staff 68827 Sep 27 14:56 74.json\n",
|
| 468 |
-
"-rw-r--r-- 1 shaojun staff 68908 Sep 27 14:56 b3.json\n",
|
| 469 |
-
"-rw-r--r-- 1 shaojun staff 137767 Sep 27 14:56 86.json\n",
|
| 470 |
-
"-rw-r--r-- 1 shaojun staff 275521 Sep 27 14:56 b1.json\n",
|
| 471 |
-
"-rw-r--r-- 1 shaojun staff 172156 Sep 27 14:56 6c.json\n",
|
| 472 |
-
"-rw-r--r-- 1 shaojun staff 137790 Sep 27 14:56 16.json\n",
|
| 473 |
-
"-rw-r--r-- 1 shaojun staff 68860 Sep 27 14:56 5c.json\n",
|
| 474 |
-
"-rw-r--r-- 1 shaojun staff 103273 Sep 27 14:56 0c.json\n",
|
| 475 |
-
"-rw-r--r-- 1 shaojun staff 103417 Sep 27 14:56 97.json\n",
|
| 476 |
-
"-rw-r--r-- 1 shaojun staff 137817 Sep 27 14:56 fc.json\n",
|
| 477 |
-
"-rw-r--r-- 1 shaojun staff 172222 Sep 27 14:56 67.json\n",
|
| 478 |
-
"-rw-r--r-- 1 shaojun staff 206756 Sep 27 14:56 e6.json\n",
|
| 479 |
-
"-rw-r--r-- 1 shaojun staff 206553 Sep 27 14:56 8c.json\n",
|
| 480 |
-
"-rw-r--r-- 1 shaojun staff 34435 Sep 27 14:56 f1.json\n",
|
| 481 |
-
"-rw-r--r-- 1 shaojun staff 34439 Sep 27 14:56 aa.json\n",
|
| 482 |
-
"-rw-r--r-- 1 shaojun staff 137738 Sep 27 14:56 78.json\n",
|
| 483 |
-
"-rw-r--r-- 1 shaojun staff 68843 Sep 27 14:56 79.json\n",
|
| 484 |
-
"-rw-r--r-- 1 shaojun staff 68841 Sep 27 14:56 45.json\n",
|
| 485 |
-
"-rw-r--r-- 1 shaojun staff 68858 Sep 27 14:56 47.json\n",
|
| 486 |
-
"-rw-r--r-- 1 shaojun staff 206624 Sep 27 14:56 62.json\n",
|
| 487 |
-
"-rw-r--r-- 1 shaojun staff 241112 Sep 27 14:56 7a.json\n",
|
| 488 |
-
"-rw-r--r-- 1 shaojun staff 68907 Sep 27 14:56 fb.json\n",
|
| 489 |
-
"-rw-r--r-- 1 shaojun staff 137640 Sep 27 14:56 42.json\n",
|
| 490 |
-
"-rw-r--r-- 1 shaojun staff 206604 Sep 27 14:56 a6.json\n",
|
| 491 |
-
"-rw-r--r-- 1 shaojun staff 34483 Sep 27 14:56 dc.json\n",
|
| 492 |
-
"-rw-r--r-- 1 shaojun staff 103325 Sep 27 14:56 8a.json\n",
|
| 493 |
-
"-rw-r--r-- 1 shaojun staff 103302 Sep 27 14:56 5d.json\n",
|
| 494 |
-
"-rw-r--r-- 1 shaojun staff 137741 Sep 27 14:56 07.json\n",
|
| 495 |
-
"-rw-r--r-- 1 shaojun staff 68926 Sep 27 14:56 c5.json\n",
|
| 496 |
-
"-rw-r--r-- 1 shaojun staff 137689 Sep 27 14:56 dd.json\n",
|
| 497 |
-
"-rw-r--r-- 1 shaojun staff 206590 Sep 27 14:56 ac.json\n",
|
| 498 |
-
"-rw-r--r-- 1 shaojun staff 309939 Sep 27 14:56 83.json\n",
|
| 499 |
-
"-rw-r--r-- 1 shaojun staff 172106 Sep 27 14:56 f3.json\n",
|
| 500 |
-
"-rw-r--r-- 1 shaojun staff 137713 Sep 27 14:56 44.json\n",
|
| 501 |
-
"-rw-r--r-- 1 shaojun staff 137711 Sep 27 14:56 64.json\n",
|
| 502 |
-
"-rw-r--r-- 1 shaojun staff 275630 Sep 27 14:56 84.json\n",
|
| 503 |
-
"-rw-r--r-- 1 shaojun staff 241095 Sep 27 14:56 22.json\n",
|
| 504 |
-
"-rw-r--r-- 1 shaojun staff 206538 Sep 27 14:56 7f.json\n",
|
| 505 |
-
"-rw-r--r-- 1 shaojun staff 275535 Sep 27 14:56 4f.json\n",
|
| 506 |
-
"-rw-r--r-- 1 shaojun staff 34431 Sep 27 14:56 8e.json\n",
|
| 507 |
-
"-rw-r--r-- 1 shaojun staff 137644 Sep 27 14:56 5a.json\n",
|
| 508 |
-
"-rw-r--r-- 1 shaojun staff 137783 Sep 27 14:56 a9.json\n",
|
| 509 |
-
"-rw-r--r-- 1 shaojun staff 206504 Sep 27 14:56 8f.json\n",
|
| 510 |
-
"-rw-r--r-- 1 shaojun staff 137719 Sep 27 14:56 53.json\n",
|
| 511 |
-
"-rw-r--r-- 1 shaojun staff 103301 Sep 27 14:56 49.json\n",
|
| 512 |
-
"-rw-r--r-- 1 shaojun staff 103276 Sep 27 14:56 c9.json\n",
|
| 513 |
-
"-rw-r--r-- 1 shaojun staff 103283 Sep 27 14:56 7d.json\n",
|
| 514 |
-
"-rw-r--r-- 1 shaojun staff 68833 Sep 27 14:56 a1.json\n",
|
| 515 |
-
"-rw-r--r-- 1 shaojun staff 68900 Sep 27 14:56 bc.json\n",
|
| 516 |
-
"-rw-r--r-- 1 shaojun staff 103285 Sep 27 14:56 95.json\n",
|
| 517 |
-
"-rw-r--r-- 1 shaojun staff 137671 Sep 27 14:56 1f.json\n",
|
| 518 |
-
"-rw-r--r-- 1 shaojun staff 172106 Sep 27 14:56 43.json\n",
|
| 519 |
-
"-rw-r--r-- 1 shaojun staff 206653 Sep 27 14:56 91.json\n",
|
| 520 |
-
"-rw-r--r-- 1 shaojun staff 172226 Sep 27 14:56 25.json\n",
|
| 521 |
-
"-rw-r--r-- 1 shaojun staff 103391 Sep 27 14:56 ca.json\n",
|
| 522 |
-
"-rw-r--r-- 1 shaojun staff 68863 Sep 27 14:56 4b.json\n",
|
| 523 |
-
"-rw-r--r-- 1 shaojun staff 103268 Sep 27 14:56 f6.json\n",
|
| 524 |
-
"-rw-r--r-- 1 shaojun staff 137847 Sep 27 14:56 f2.json\n",
|
| 525 |
-
"-rw-r--r-- 1 shaojun staff 68883 Sep 27 14:56 88.json\n",
|
| 526 |
-
"-rw-r--r-- 1 shaojun staff 68845 Sep 27 14:56 51.json\n",
|
| 527 |
-
"-rw-r--r-- 1 shaojun staff 68806 Sep 27 14:56 61.json\n",
|
| 528 |
-
"-rw-r--r-- 1 shaojun staff 103350 Sep 27 14:56 ba.json\n",
|
| 529 |
-
"-rw-r--r-- 1 shaojun staff 103244 Sep 27 14:56 0b.json\n",
|
| 530 |
-
"-rw-r--r-- 1 shaojun staff 172225 Sep 27 14:56 a0.json\n",
|
| 531 |
-
"-rw-r--r-- 1 shaojun staff 137741 Sep 27 14:56 f9.json\n",
|
| 532 |
-
"-rw-r--r-- 1 shaojun staff 103316 Sep 27 14:56 3c.json\n",
|
| 533 |
-
"-rw-r--r-- 1 shaojun staff 68851 Sep 27 14:56 e8.json\n",
|
| 534 |
-
"-rw-r--r-- 1 shaojun staff 137642 Sep 27 14:56 0e.json\n",
|
| 535 |
-
"-rw-r--r-- 1 shaojun staff 103366 Sep 27 14:56 1d.json\n",
|
| 536 |
-
"-rw-r--r-- 1 shaojun staff 172252 Sep 27 14:56 db.json\n",
|
| 537 |
-
"-rw-r--r-- 1 shaojun staff 241013 Sep 27 14:56 06.json\n",
|
| 538 |
-
"-rw-r--r-- 1 shaojun staff 172004 Sep 27 14:56 a3.json\n",
|
| 539 |
-
"-rw-r--r-- 1 shaojun staff 137816 Sep 27 14:56 28.json\n",
|
| 540 |
-
"-rw-r--r-- 1 shaojun staff 68858 Sep 27 14:56 b7.json\n",
|
| 541 |
-
"-rw-r--r-- 1 shaojun staff 172149 Sep 27 14:56 13.json\n",
|
| 542 |
-
"-rw-r--r-- 1 shaojun staff 172254 Sep 27 14:56 58.json\n",
|
| 543 |
-
"-rw-r--r-- 1 shaojun staff 206714 Sep 27 14:57 ad.json\n",
|
| 544 |
-
"-rw-r--r-- 1 shaojun staff 103351 Sep 27 14:57 60.json\n",
|
| 545 |
-
"-rw-r--r-- 1 shaojun staff 103427 Sep 27 14:57 3a.json\n",
|
| 546 |
-
"-rw-r--r-- 1 shaojun staff 137620 Sep 27 14:57 9b.json\n",
|
| 547 |
-
"-rw-r--r-- 1 shaojun staff 137773 Sep 27 14:57 c4.json\n",
|
| 548 |
-
"-rw-r--r-- 1 shaojun staff 103339 Sep 27 14:57 9f.json\n",
|
| 549 |
-
"-rw-r--r-- 1 shaojun staff 137723 Sep 27 14:57 04.json\n",
|
| 550 |
-
"-rw-r--r-- 1 shaojun staff 103342 Sep 27 14:57 39.json\n",
|
| 551 |
-
"-rw-r--r-- 1 shaojun staff 137847 Sep 27 14:57 e4.json\n",
|
| 552 |
-
"-rw-r--r-- 1 shaojun staff 137679 Sep 27 14:57 6a.json\n",
|
| 553 |
-
"-rw-r--r-- 1 shaojun staff 172200 Sep 27 14:57 b0.json\n",
|
| 554 |
-
"-rw-r--r-- 1 shaojun staff 206547 Sep 27 14:57 6e.json\n",
|
| 555 |
-
"-rw-r--r-- 1 shaojun staff 172303 Sep 27 14:57 1b.json\n",
|
| 556 |
-
"-rw-r--r-- 1 shaojun staff 103265 Sep 27 14:57 e9.json\n",
|
| 557 |
-
"-rw-r--r-- 1 shaojun staff 68867 Sep 27 14:57 d9.json\n",
|
| 558 |
-
"-rw-r--r-- 1 shaojun staff 103318 Sep 27 14:57 21.json\n",
|
| 559 |
-
"-rw-r--r-- 1 shaojun staff 241129 Sep 27 14:57 40.json\n",
|
| 560 |
-
"-rw-r--r-- 1 shaojun staff 206637 Sep 27 14:57 d7.json\n",
|
| 561 |
-
"-rw-r--r-- 1 shaojun staff 172314 Sep 27 14:57 2a.json\n",
|
| 562 |
-
"-rw-r--r-- 1 shaojun staff 172157 Sep 27 14:57 36.json\n",
|
| 563 |
-
"-rw-r--r-- 1 shaojun staff 275522 Sep 27 14:57 73.json\n",
|
| 564 |
-
"-rw-r--r-- 1 shaojun staff 103333 Sep 27 14:57 d4.json\n",
|
| 565 |
-
"-rw-r--r-- 1 shaojun staff 68896 Sep 27 14:57 76.json\n",
|
| 566 |
-
"-rw-r--r-- 1 shaojun staff 137684 Sep 27 14:57 3e.json\n",
|
| 567 |
-
"-rw-r--r-- 1 shaojun staff 172392 Sep 27 14:57 d0.json\n",
|
| 568 |
-
"-rw-r--r-- 1 shaojun staff 172215 Sep 27 14:57 6f.json\n",
|
| 569 |
-
"-rw-r--r-- 1 shaojun staff 137757 Sep 27 14:57 33.json\n",
|
| 570 |
-
"-rw-r--r-- 1 shaojun staff 172135 Sep 27 14:57 65.json\n",
|
| 571 |
-
"-rw-r--r-- 1 shaojun staff 137740 Sep 27 14:57 54.json\n",
|
| 572 |
-
"-rw-r--r-- 1 shaojun staff 137764 Sep 27 14:57 00.json\n",
|
| 573 |
-
"-rw-r--r-- 1 shaojun staff 309961 Sep 27 14:57 7b.json\n",
|
| 574 |
-
"-rw-r--r-- 1 shaojun staff 241028 Sep 27 14:57 7c.json\n",
|
| 575 |
-
"-rw-r--r-- 1 shaojun staff 137745 Sep 27 14:57 75.json\n",
|
| 576 |
-
"-rw-r--r-- 1 shaojun staff 206498 Sep 27 14:57 10.json\n",
|
| 577 |
-
"-rw-r--r-- 1 shaojun staff 103268 Sep 27 14:57 98.json\n",
|
| 578 |
-
"-rw-r--r-- 1 shaojun staff 137722 Sep 27 14:57 23.json\n",
|
| 579 |
-
"-rw-r--r-- 1 shaojun staff 137687 Sep 27 14:57 a8.json\n",
|
| 580 |
-
"-rw-r--r-- 1 shaojun staff 68899 Sep 27 14:57 90.json\n",
|
| 581 |
-
"-rw-r--r-- 1 shaojun staff 137754 Sep 27 14:57 2b.json\n",
|
| 582 |
-
"-rw-r--r-- 1 shaojun staff 344431 Sep 27 14:57 d3.json\n",
|
| 583 |
-
"-rw-r--r-- 1 shaojun staff 137755 Sep 27 14:57 fd.json\n",
|
| 584 |
-
"-rw-r--r-- 1 shaojun staff 206556 Sep 27 14:57 4d.json\n",
|
| 585 |
-
"-rw-r--r-- 1 shaojun staff 103244 Sep 27 14:57 93.json\n",
|
| 586 |
-
"-rw-r--r-- 1 shaojun staff 68888 Sep 27 14:57 b6.json\n",
|
| 587 |
-
"-rw-r--r-- 1 shaojun staff 137709 Sep 27 14:57 3d.json\n",
|
| 588 |
-
"-rw-r--r-- 1 shaojun staff 34378 Sep 27 14:57 e3.json\n",
|
| 589 |
-
"-rw-r--r-- 1 shaojun staff 137797 Sep 27 14:57 38.json\n",
|
| 590 |
-
"-rw-r--r-- 1 shaojun staff 103484 Sep 27 14:57 bb.json\n",
|
| 591 |
-
"-rw-r--r-- 1 shaojun staff 206520 Sep 27 14:57 09.json\n",
|
| 592 |
-
"-rw-r--r-- 1 shaojun staff 137697 Sep 27 14:57 f0.json\n",
|
| 593 |
-
"-rw-r--r-- 1 shaojun staff 206502 Sep 27 14:57 48.json\n",
|
| 594 |
-
"-rw-r--r-- 1 shaojun staff 172162 Sep 27 14:57 2c.json\n",
|
| 595 |
-
"-rw-r--r-- 1 shaojun staff 172015 Sep 27 14:57 12.json\n",
|
| 596 |
-
"-rw-r--r-- 1 shaojun staff 206671 Sep 27 14:57 fe.json\n",
|
| 597 |
-
"-rw-r--r-- 1 shaojun staff 137729 Sep 27 14:57 da.json\n",
|
| 598 |
-
"-rw-r--r-- 1 shaojun staff 241042 Sep 27 14:57 34.json\n",
|
| 599 |
-
"-rw-r--r-- 1 shaojun staff 68847 Sep 27 14:57 d5.json\n",
|
| 600 |
-
"-rw-r--r-- 1 shaojun staff 206597 Sep 27 14:57 4c.json\n",
|
| 601 |
-
"-rw-r--r-- 1 shaojun staff 206774 Sep 27 14:57 72.json\n",
|
| 602 |
-
"-rw-r--r-- 1 shaojun staff 137697 Sep 27 14:57 9a.json\n",
|
| 603 |
-
"-rw-r--r-- 1 shaojun staff 206642 Sep 27 14:57 e2.json\n",
|
| 604 |
-
"-rw-r--r-- 1 shaojun staff 137795 Sep 27 14:57 bd.json\n",
|
| 605 |
-
"-rw-r--r-- 1 shaojun staff 103371 Sep 27 14:57 6d.json\n",
|
| 606 |
-
"-rw-r--r-- 1 shaojun staff 137769 Sep 27 14:57 e5.json\n",
|
| 607 |
-
"-rw-r--r-- 1 shaojun staff 172314 Sep 27 14:57 5f.json\n",
|
| 608 |
-
"-rw-r--r-- 1 shaojun staff 309865 Sep 27 14:57 be.json\n",
|
| 609 |
-
"-rw-r--r-- 1 shaojun staff 240982 Sep 27 14:57 ce.json\n",
|
| 610 |
-
"-rw-r--r-- 1 shaojun staff 68896 Sep 27 14:57 ea.json\n",
|
| 611 |
-
"-rw-r--r-- 1 shaojun staff 103251 Sep 27 14:57 92.json\n",
|
| 612 |
-
"-rw-r--r-- 1 shaojun staff 275642 Sep 27 14:57 68.json\n",
|
| 613 |
-
"-rw-r--r-- 1 shaojun staff 68858 Sep 27 14:57 2f.json\n",
|
| 614 |
-
"-rw-r--r-- 1 shaojun staff 241160 Sep 27 14:57 96.json\n",
|
| 615 |
-
"-rw-r--r-- 1 shaojun staff 137795 Sep 27 14:57 18.json\n",
|
| 616 |
-
"-rw-r--r-- 1 shaojun staff 137675 Sep 27 14:57 4a.json\n",
|
| 617 |
-
"-rw-r--r-- 1 shaojun staff 241006 Sep 27 14:57 af.json\n",
|
| 618 |
-
"-rw-r--r-- 1 shaojun staff 103422 Sep 27 14:57 e1.json\n",
|
| 619 |
-
"-rw-r--r-- 1 shaojun staff 137731 Sep 27 14:57 a7.json\n",
|
| 620 |
-
"-rw-r--r-- 1 shaojun staff 34446 Sep 27 14:57 c3.json\n",
|
| 621 |
-
"-rw-r--r-- 1 shaojun staff 68885 Sep 27 14:57 ec.json\n",
|
| 622 |
-
"-rw-r--r-- 1 shaojun staff 206571 Sep 27 14:57 e0.json\n",
|
| 623 |
-
"-rw-r--r-- 1 shaojun staff 172188 Sep 27 14:57 30.json\n",
|
| 624 |
-
"-rw-r--r-- 1 shaojun staff 206663 Sep 27 14:57 7e.json\n",
|
| 625 |
-
"-rw-r--r-- 1 shaojun staff 137848 Sep 27 14:57 f5.json\n",
|
| 626 |
-
"-rw-r--r-- 1 shaojun staff 172141 Sep 27 14:57 41.json\n",
|
| 627 |
-
"-rw-r--r-- 1 shaojun staff 137610 Sep 27 14:57 8b.json\n",
|
| 628 |
-
"-rw-r--r-- 1 shaojun staff 103309 Sep 27 14:57 c8.json\n",
|
| 629 |
-
"-rw-r--r-- 1 shaojun staff 206630 Sep 27 14:57 c7.json\n",
|
| 630 |
-
"-rw-r--r-- 1 shaojun staff 103359 Sep 27 14:57 32.json\n",
|
| 631 |
-
"-rw-r--r-- 1 shaojun staff 68889 Sep 27 14:57 19.json\n",
|
| 632 |
-
"-rw-r--r-- 1 shaojun staff 137774 Sep 27 14:57 17.json\n",
|
| 633 |
-
"-rw-r--r-- 1 shaojun staff 172198 Sep 27 14:57 4e.json\n",
|
| 634 |
-
"-rw-r--r-- 1 shaojun staff 172161 Sep 27 14:57 02.json\n",
|
| 635 |
-
"-rw-r--r-- 1 shaojun staff 275562 Sep 27 14:57 15.json\n",
|
| 636 |
-
"-rw-r--r-- 1 shaojun staff 137797 Sep 27 14:57 ff.json\n",
|
| 637 |
-
"-rw-r--r-- 1 shaojun staff 137735 Sep 27 14:57 9d.json\n",
|
| 638 |
-
"-rw-r--r-- 1 shaojun staff 68871 Sep 27 14:57 2d.json\n",
|
| 639 |
-
"-rw-r--r-- 1 shaojun staff 206515 Sep 27 14:57 de.json\n",
|
| 640 |
-
"-rw-r--r-- 1 shaojun staff 137603 Sep 27 14:57 f8.json\n",
|
| 641 |
-
"-rw-r--r-- 1 shaojun staff 68836 Sep 27 14:57 b2.json\n",
|
| 642 |
-
"-rw-r--r-- 1 shaojun staff 172220 Sep 27 14:57 9e.json\n",
|
| 643 |
-
"-rw-r--r-- 1 shaojun staff 172181 Sep 27 14:57 56.json\n",
|
| 644 |
-
"-rw-r--r-- 1 shaojun staff 413179 Sep 27 14:57 87.json\n",
|
| 645 |
-
"-rw-r--r-- 1 shaojun staff 206617 Sep 27 14:57 a2.json\n",
|
| 646 |
-
"-rw-r--r-- 1 shaojun staff 241003 Sep 27 14:57 ed.json\n",
|
| 647 |
-
"-rw-r--r-- 1 shaojun staff 68848 Sep 27 14:57 b4.json\n",
|
| 648 |
-
"-rw-r--r-- 1 shaojun staff 137642 Sep 27 14:57 3f.json\n",
|
| 649 |
-
"-rw-r--r-- 1 shaojun staff 68898 Sep 27 14:57 08.json\n",
|
| 650 |
-
"-rw-r--r-- 1 shaojun staff 206596 Sep 27 14:57 0f.json\n",
|
| 651 |
-
"-rw-r--r-- 1 shaojun staff 206643 Sep 27 14:57 ae.json\n",
|
| 652 |
-
"-rw-r--r-- 1 shaojun staff 275430 Sep 27 14:57 eb.json\n",
|
| 653 |
-
"-rw-r--r-- 1 shaojun staff 172207 Sep 27 14:57 1a.json\n",
|
| 654 |
-
"-rw-r--r-- 1 shaojun staff 206596 Sep 27 14:57 3b.json\n",
|
| 655 |
-
"-rw-r--r-- 1 shaojun staff 103198 Sep 27 14:57 31.json\n",
|
| 656 |
-
"-rw-r--r-- 1 shaojun staff 241067 Sep 27 14:57 b9.json\n",
|
| 657 |
-
"-rw-r--r-- 1 shaojun staff 172223 Sep 27 14:57 70.json\n",
|
| 658 |
-
"-rw-r--r-- 1 shaojun staff 172276 Sep 27 14:57 26.json\n"
|
| 659 |
-
]
|
| 660 |
-
}
|
| 661 |
-
],
|
| 662 |
-
"source": [
|
| 663 |
-
"!ls -lrt ../../../data/{game.PATH}/emb/"
|
| 664 |
-
]
|
| 665 |
-
},
|
| 666 |
-
{
|
| 667 |
-
"cell_type": "code",
|
| 668 |
-
"execution_count": 19,
|
| 669 |
-
"id": "ef4e291e-d228-4eb0-8c0e-1d0fefc53ba2",
|
| 670 |
-
"metadata": {},
|
| 671 |
-
"outputs": [],
|
| 672 |
-
"source": [
|
| 673 |
-
"!rm -rf ../../../data/{game.PATH}/emb/"
|
| 674 |
-
]
|
| 675 |
-
},
|
| 676 |
-
{
|
| 677 |
-
"cell_type": "code",
|
| 678 |
-
"execution_count": null,
|
| 679 |
-
"id": "a99ec58e-8d08-4fc4-b1bb-c6bfa4392dbc",
|
| 680 |
-
"metadata": {},
|
| 681 |
-
"outputs": [],
|
| 682 |
-
"source": []
|
| 683 |
-
},
|
| 684 |
-
{
|
| 685 |
-
"cell_type": "code",
|
| 686 |
-
"execution_count": 20,
|
| 687 |
-
"id": "84d3897c-235d-4c23-b6d1-3064efde1aa1",
|
| 688 |
-
"metadata": {},
|
| 689 |
-
"outputs": [
|
| 690 |
-
{
|
| 691 |
-
"name": "stderr",
|
| 692 |
-
"output_type": "stream",
|
| 693 |
-
"text": [
|
| 694 |
-
"100%|██████████████████████████████████████| 1016/1016 [00:08<00:00, 125.41it/s]\n"
|
| 695 |
-
]
|
| 696 |
-
}
|
| 697 |
-
],
|
| 698 |
-
"source": [
|
| 699 |
-
"game.dump()"
|
| 700 |
-
]
|
| 701 |
-
},
|
| 702 |
-
{
|
| 703 |
-
"cell_type": "code",
|
| 704 |
-
"execution_count": null,
|
| 705 |
-
"id": "47cba7a0-9492-46b2-b596-7dda56045ee0",
|
| 706 |
-
"metadata": {},
|
| 707 |
-
"outputs": [],
|
| 708 |
-
"source": []
|
| 709 |
-
},
|
| 710 |
-
{
|
| 711 |
-
"cell_type": "code",
|
| 712 |
-
"execution_count": 21,
|
| 713 |
-
"id": "0ab453f0-f04d-4a40-97fb-d6aba6275757",
|
| 714 |
-
"metadata": {},
|
| 715 |
-
"outputs": [
|
| 716 |
-
{
|
| 717 |
-
"data": {
|
| 718 |
-
"text/plain": [
|
| 719 |
-
"PosixPath('/Users/shaojun/playgo/bbc123')"
|
| 720 |
-
]
|
| 721 |
-
},
|
| 722 |
-
"execution_count": 21,
|
| 723 |
-
"metadata": {},
|
| 724 |
-
"output_type": "execute_result"
|
| 725 |
-
}
|
| 726 |
-
],
|
| 727 |
-
"source": [
|
| 728 |
-
"game.ROOT"
|
| 729 |
-
]
|
| 730 |
-
},
|
| 731 |
-
{
|
| 732 |
-
"cell_type": "code",
|
| 733 |
-
"execution_count": 22,
|
| 734 |
-
"id": "42e1eaad-b66f-4bd3-85a6-f352d4296ab0",
|
| 735 |
-
"metadata": {},
|
| 736 |
-
"outputs": [
|
| 737 |
-
{
|
| 738 |
-
"data": {
|
| 739 |
-
"text/plain": [
|
| 740 |
-
"'angrybird'"
|
| 741 |
-
]
|
| 742 |
-
},
|
| 743 |
-
"execution_count": 22,
|
| 744 |
-
"metadata": {},
|
| 745 |
-
"output_type": "execute_result"
|
| 746 |
-
}
|
| 747 |
-
],
|
| 748 |
-
"source": [
|
| 749 |
-
"game.PATH"
|
| 750 |
-
]
|
| 751 |
-
},
|
| 752 |
-
{
|
| 753 |
-
"cell_type": "code",
|
| 754 |
-
"execution_count": 23,
|
| 755 |
-
"id": "6f4dd0dd-927d-4b99-84b5-5a30b11f064d",
|
| 756 |
-
"metadata": {},
|
| 757 |
-
"outputs": [],
|
| 758 |
-
"source": [
|
| 759 |
-
"import glob\n",
|
| 760 |
-
"files = glob.glob(f\"{game.ROOT}/data/{game.PATH}/emb/*.json\")"
|
| 761 |
-
]
|
| 762 |
-
},
|
| 763 |
-
{
|
| 764 |
-
"cell_type": "code",
|
| 765 |
-
"execution_count": 24,
|
| 766 |
-
"id": "e5f485ca-d901-485b-adff-d348d0c2168b",
|
| 767 |
-
"metadata": {},
|
| 768 |
-
"outputs": [
|
| 769 |
-
{
|
| 770 |
-
"data": {
|
| 771 |
-
"text/plain": [
|
| 772 |
-
"250"
|
| 773 |
-
]
|
| 774 |
-
},
|
| 775 |
-
"execution_count": 24,
|
| 776 |
-
"metadata": {},
|
| 777 |
-
"output_type": "execute_result"
|
| 778 |
-
}
|
| 779 |
-
],
|
| 780 |
-
"source": [
|
| 781 |
-
"len(files)"
|
| 782 |
-
]
|
| 783 |
-
},
|
| 784 |
-
{
|
| 785 |
-
"cell_type": "code",
|
| 786 |
-
"execution_count": 25,
|
| 787 |
-
"id": "7f0dd810-f8d0-4c9e-b04b-c2ae7a010d19",
|
| 788 |
-
"metadata": {},
|
| 789 |
-
"outputs": [],
|
| 790 |
-
"source": [
|
| 791 |
-
"import glob\n",
|
| 792 |
-
"files = glob.glob(f\"{game.ROOT}/data/{game.PATH}/emb/*.json\")\n",
|
| 793 |
-
"tmp = {}\n",
|
| 794 |
-
"for f in files:\n",
|
| 795 |
-
" with open(f, \"r\") as f:\n",
|
| 796 |
-
" tmp |= json.load(f)"
|
| 797 |
-
]
|
| 798 |
-
},
|
| 799 |
-
{
|
| 800 |
-
"cell_type": "code",
|
| 801 |
-
"execution_count": 26,
|
| 802 |
-
"id": "17078c2d-6455-433a-b03d-e23fdbb5755d",
|
| 803 |
-
"metadata": {},
|
| 804 |
-
"outputs": [
|
| 805 |
-
{
|
| 806 |
-
"data": {
|
| 807 |
-
"text/plain": [
|
| 808 |
-
"1016"
|
| 809 |
-
]
|
| 810 |
-
},
|
| 811 |
-
"execution_count": 26,
|
| 812 |
-
"metadata": {},
|
| 813 |
-
"output_type": "execute_result"
|
| 814 |
-
}
|
| 815 |
-
],
|
| 816 |
-
"source": [
|
| 817 |
-
"len(tmp)"
|
| 818 |
-
]
|
| 819 |
-
},
|
| 820 |
-
{
|
| 821 |
-
"cell_type": "code",
|
| 822 |
-
"execution_count": null,
|
| 823 |
-
"id": "4e57785e-a841-4a43-b324-a4d07493e333",
|
| 824 |
-
"metadata": {},
|
| 825 |
-
"outputs": [],
|
| 826 |
-
"source": []
|
| 827 |
-
},
|
| 828 |
-
{
|
| 829 |
-
"cell_type": "code",
|
| 830 |
-
"execution_count": 27,
|
| 831 |
-
"id": "18888a7b-d32d-45b4-a9b3-3ce29b18a7f7",
|
| 832 |
-
"metadata": {},
|
| 833 |
-
"outputs": [],
|
| 834 |
-
"source": [
|
| 835 |
-
"# sim query"
|
| 836 |
-
]
|
| 837 |
-
},
|
| 838 |
-
{
|
| 839 |
-
"cell_type": "code",
|
| 840 |
-
"execution_count": 28,
|
| 841 |
-
"id": "4703a269-a1c0-48e4-8848-6b5cdb9b814b",
|
| 842 |
-
"metadata": {},
|
| 843 |
-
"outputs": [
|
| 844 |
-
{
|
| 845 |
-
"data": {
|
| 846 |
-
"text/plain": [
|
| 847 |
-
"1016"
|
| 848 |
-
]
|
| 849 |
-
},
|
| 850 |
-
"execution_count": 28,
|
| 851 |
-
"metadata": {},
|
| 852 |
-
"output_type": "execute_result"
|
| 853 |
-
}
|
| 854 |
-
],
|
| 855 |
-
"source": [
|
| 856 |
-
"len(game.embeddings)"
|
| 857 |
-
]
|
| 858 |
-
},
|
| 859 |
-
{
|
| 860 |
-
"cell_type": "code",
|
| 861 |
-
"execution_count": null,
|
| 862 |
-
"id": "c885da07-e53d-4586-b340-8f9de0515fc2",
|
| 863 |
-
"metadata": {},
|
| 864 |
-
"outputs": [],
|
| 865 |
-
"source": []
|
| 866 |
-
},
|
| 867 |
-
{
|
| 868 |
-
"cell_type": "code",
|
| 869 |
-
"execution_count": 29,
|
| 870 |
-
"id": "37ba9cb2-83a7-45af-972c-6802ce48a57b",
|
| 871 |
-
"metadata": {},
|
| 872 |
-
"outputs": [
|
| 873 |
-
{
|
| 874 |
-
"data": {
|
| 875 |
-
"text/plain": [
|
| 876 |
-
"True"
|
| 877 |
-
]
|
| 878 |
-
},
|
| 879 |
-
"execution_count": 29,
|
| 880 |
-
"metadata": {},
|
| 881 |
-
"output_type": "execute_result"
|
| 882 |
-
}
|
| 883 |
-
],
|
| 884 |
-
"source": [
|
| 885 |
-
"game.embeddings == tmp"
|
| 886 |
-
]
|
| 887 |
-
},
|
| 888 |
-
{
|
| 889 |
-
"cell_type": "code",
|
| 890 |
-
"execution_count": null,
|
| 891 |
-
"id": "63827499-7b11-4c3f-8527-38d3cc5066d6",
|
| 892 |
-
"metadata": {},
|
| 893 |
-
"outputs": [],
|
| 894 |
-
"source": []
|
| 895 |
-
},
|
| 896 |
-
{
|
| 897 |
-
"cell_type": "code",
|
| 898 |
-
"execution_count": null,
|
| 899 |
-
"id": "8b06eff9-5382-4c28-aa7c-cb262793dd6f",
|
| 900 |
-
"metadata": {},
|
| 901 |
-
"outputs": [],
|
| 902 |
-
"source": []
|
| 903 |
-
},
|
| 904 |
-
{
|
| 905 |
-
"cell_type": "code",
|
| 906 |
-
"execution_count": 30,
|
| 907 |
-
"id": "4ff48663-e767-4936-807d-07fb8c42ce92",
|
| 908 |
-
"metadata": {},
|
| 909 |
-
"outputs": [
|
| 910 |
-
{
|
| 911 |
-
"name": "stdout",
|
| 912 |
-
"output_type": "stream",
|
| 913 |
-
"text": [
|
| 914 |
-
"{\n",
|
| 915 |
-
" \"version\": \"3.8.0.2023-09-18-a\",\n",
|
| 916 |
-
" \"data\": [\n",
|
| 917 |
-
" \"(1) [unified] add/delete one or more (special) birds/pigs\",\n",
|
| 918 |
-
" \"(2) add one or more houses\",\n",
|
| 919 |
-
" \"(3) change HP\",\n",
|
| 920 |
-
" \"(4) change background\",\n",
|
| 921 |
-
" \"(5) change positions\",\n",
|
| 922 |
-
" \"(6) change size\",\n",
|
| 923 |
-
" \"(7) change skin\",\n",
|
| 924 |
-
" \"(8) list birds or pigs\"\n",
|
| 925 |
-
" ]\n",
|
| 926 |
-
"}\n"
|
| 927 |
-
]
|
| 928 |
-
}
|
| 929 |
-
],
|
| 930 |
-
"source": [
|
| 931 |
-
"print(json.dumps(game.list_functionality(), indent=4))"
|
| 932 |
-
]
|
| 933 |
-
},
|
| 934 |
-
{
|
| 935 |
-
"cell_type": "code",
|
| 936 |
-
"execution_count": 31,
|
| 937 |
-
"id": "982c3666-7b6a-4300-a2ac-b1a42c216c09",
|
| 938 |
-
"metadata": {},
|
| 939 |
-
"outputs": [
|
| 940 |
-
{
|
| 941 |
-
"name": "stdout",
|
| 942 |
-
"output_type": "stream",
|
| 943 |
-
"text": [
|
| 944 |
-
"0 (1) [unified] add/delete one or more (special) birds/pigs\n",
|
| 945 |
-
"1 (2) add one or more houses\n",
|
| 946 |
-
"2 (3) change HP\n",
|
| 947 |
-
"3 (4) change background\n",
|
| 948 |
-
"4 (5) change positions\n",
|
| 949 |
-
"5 (6) change size\n",
|
| 950 |
-
"6 (7) change skin\n",
|
| 951 |
-
"7 (8) list birds or pigs\n"
|
| 952 |
-
]
|
| 953 |
-
}
|
| 954 |
-
],
|
| 955 |
-
"source": [
|
| 956 |
-
"for i, x in enumerate(game.list_functionality()['data']):\n",
|
| 957 |
-
" print(i,x)"
|
| 958 |
-
]
|
| 959 |
-
},
|
| 960 |
-
{
|
| 961 |
-
"cell_type": "code",
|
| 962 |
-
"execution_count": null,
|
| 963 |
-
"id": "73820ce5-bade-4e08-9fc8-b60d8cdb4ba4",
|
| 964 |
-
"metadata": {},
|
| 965 |
-
"outputs": [],
|
| 966 |
-
"source": []
|
| 967 |
-
},
|
| 968 |
-
{
|
| 969 |
-
"cell_type": "code",
|
| 970 |
-
"execution_count": 32,
|
| 971 |
-
"id": "75cf385f-ba62-452d-a98a-fd3d0bd36031",
|
| 972 |
-
"metadata": {},
|
| 973 |
-
"outputs": [],
|
| 974 |
-
"source": [
|
| 975 |
-
"# print(json.dumps(game.show_json(),indent=4))"
|
| 976 |
-
]
|
| 977 |
-
},
|
| 978 |
-
{
|
| 979 |
-
"cell_type": "code",
|
| 980 |
-
"execution_count": null,
|
| 981 |
-
"id": "b3db3bf1-1b0d-443c-a1cd-cd8c10038b31",
|
| 982 |
-
"metadata": {},
|
| 983 |
-
"outputs": [],
|
| 984 |
-
"source": []
|
| 985 |
-
}
|
| 986 |
-
],
|
| 987 |
-
"metadata": {
|
| 988 |
-
"kernelspec": {
|
| 989 |
-
"display_name": "Python 3 (ipykernel)",
|
| 990 |
-
"language": "python",
|
| 991 |
-
"name": "python3"
|
| 992 |
-
},
|
| 993 |
-
"language_info": {
|
| 994 |
-
"codemirror_mode": {
|
| 995 |
-
"name": "ipython",
|
| 996 |
-
"version": 3
|
| 997 |
-
},
|
| 998 |
-
"file_extension": ".py",
|
| 999 |
-
"mimetype": "text/x-python",
|
| 1000 |
-
"name": "python",
|
| 1001 |
-
"nbconvert_exporter": "python",
|
| 1002 |
-
"pygments_lexer": "ipython3",
|
| 1003 |
-
"version": "3.11.4"
|
| 1004 |
-
}
|
| 1005 |
-
},
|
| 1006 |
-
"nbformat": 4,
|
| 1007 |
-
"nbformat_minor": 5
|
| 1008 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
games/angrybirds/notebooks/sim.ipynb
DELETED
|
@@ -1,730 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "code",
|
| 5 |
-
"execution_count": 64,
|
| 6 |
-
"id": "245fbc34-352d-4945-a689-d04f9365bb99",
|
| 7 |
-
"metadata": {},
|
| 8 |
-
"outputs": [
|
| 9 |
-
{
|
| 10 |
-
"name": "stdout",
|
| 11 |
-
"output_type": "stream",
|
| 12 |
-
"text": [
|
| 13 |
-
"The autoreload extension is already loaded. To reload it, use:\n",
|
| 14 |
-
" %reload_ext autoreload\n"
|
| 15 |
-
]
|
| 16 |
-
}
|
| 17 |
-
],
|
| 18 |
-
"source": [
|
| 19 |
-
"%load_ext autoreload\n",
|
| 20 |
-
"%autoreload 2"
|
| 21 |
-
]
|
| 22 |
-
},
|
| 23 |
-
{
|
| 24 |
-
"cell_type": "code",
|
| 25 |
-
"execution_count": 65,
|
| 26 |
-
"id": "eaed216c-160a-4e31-96fe-015c140ff18b",
|
| 27 |
-
"metadata": {},
|
| 28 |
-
"outputs": [],
|
| 29 |
-
"source": [
|
| 30 |
-
"# from pprint import pprint"
|
| 31 |
-
]
|
| 32 |
-
},
|
| 33 |
-
{
|
| 34 |
-
"cell_type": "code",
|
| 35 |
-
"execution_count": 66,
|
| 36 |
-
"id": "97953551-8ef1-42c1-9317-99d5e65f535e",
|
| 37 |
-
"metadata": {},
|
| 38 |
-
"outputs": [],
|
| 39 |
-
"source": [
|
| 40 |
-
"import json\n",
|
| 41 |
-
"import pandas as pd\n",
|
| 42 |
-
"import pickle\n",
|
| 43 |
-
"\n",
|
| 44 |
-
"import openai\n",
|
| 45 |
-
"from openai.embeddings_utils import get_embedding, cosine_similarity\n",
|
| 46 |
-
"\n",
|
| 47 |
-
"# from games.angrybirds.util import util\n",
|
| 48 |
-
"from games.angrybirds.config import config\n",
|
| 49 |
-
"# from games.angrybirds.prompt import prompt\n",
|
| 50 |
-
"# from games.angrybirds.query import query, yes_no_query\n",
|
| 51 |
-
"from games.angrybirds.angrybirds import angrybird"
|
| 52 |
-
]
|
| 53 |
-
},
|
| 54 |
-
{
|
| 55 |
-
"cell_type": "code",
|
| 56 |
-
"execution_count": null,
|
| 57 |
-
"id": "fc213f4c-cb07-468b-b15f-60e5120b3d94",
|
| 58 |
-
"metadata": {},
|
| 59 |
-
"outputs": [],
|
| 60 |
-
"source": []
|
| 61 |
-
},
|
| 62 |
-
{
|
| 63 |
-
"cell_type": "code",
|
| 64 |
-
"execution_count": 67,
|
| 65 |
-
"id": "0c876614-a9bf-4d0b-a728-07770f1ad9c5",
|
| 66 |
-
"metadata": {},
|
| 67 |
-
"outputs": [
|
| 68 |
-
{
|
| 69 |
-
"name": "stdout",
|
| 70 |
-
"output_type": "stream",
|
| 71 |
-
"text": [
|
| 72 |
-
"before add_config\n",
|
| 73 |
-
"773\n",
|
| 74 |
-
"773\n",
|
| 75 |
-
"773\n",
|
| 76 |
-
"773\n",
|
| 77 |
-
"774\n",
|
| 78 |
-
"after add_config\n",
|
| 79 |
-
"774\n",
|
| 80 |
-
"final\n",
|
| 81 |
-
"774\n"
|
| 82 |
-
]
|
| 83 |
-
}
|
| 84 |
-
],
|
| 85 |
-
"source": [
|
| 86 |
-
"bird = angrybird()"
|
| 87 |
-
]
|
| 88 |
-
},
|
| 89 |
-
{
|
| 90 |
-
"cell_type": "code",
|
| 91 |
-
"execution_count": 68,
|
| 92 |
-
"id": "1411de96-97d5-4bac-b8ed-e279fb1edaa0",
|
| 93 |
-
"metadata": {},
|
| 94 |
-
"outputs": [
|
| 95 |
-
{
|
| 96 |
-
"data": {
|
| 97 |
-
"text/plain": [
|
| 98 |
-
"0"
|
| 99 |
-
]
|
| 100 |
-
},
|
| 101 |
-
"execution_count": 68,
|
| 102 |
-
"metadata": {},
|
| 103 |
-
"output_type": "execute_result"
|
| 104 |
-
}
|
| 105 |
-
],
|
| 106 |
-
"source": [
|
| 107 |
-
"len(bird.embeddings)"
|
| 108 |
-
]
|
| 109 |
-
},
|
| 110 |
-
{
|
| 111 |
-
"cell_type": "code",
|
| 112 |
-
"execution_count": 69,
|
| 113 |
-
"id": "129403ce-69f4-4f2a-9b22-7b3e36d78f24",
|
| 114 |
-
"metadata": {},
|
| 115 |
-
"outputs": [
|
| 116 |
-
{
|
| 117 |
-
"data": {
|
| 118 |
-
"text/plain": [
|
| 119 |
-
"{}"
|
| 120 |
-
]
|
| 121 |
-
},
|
| 122 |
-
"execution_count": 69,
|
| 123 |
-
"metadata": {},
|
| 124 |
-
"output_type": "execute_result"
|
| 125 |
-
}
|
| 126 |
-
],
|
| 127 |
-
"source": [
|
| 128 |
-
"bird.embeddings"
|
| 129 |
-
]
|
| 130 |
-
},
|
| 131 |
-
{
|
| 132 |
-
"cell_type": "code",
|
| 133 |
-
"execution_count": 70,
|
| 134 |
-
"id": "50e372eb-48ba-4378-b866-f2b7120bc94e",
|
| 135 |
-
"metadata": {},
|
| 136 |
-
"outputs": [
|
| 137 |
-
{
|
| 138 |
-
"data": {
|
| 139 |
-
"text/plain": [
|
| 140 |
-
"774"
|
| 141 |
-
]
|
| 142 |
-
},
|
| 143 |
-
"execution_count": 70,
|
| 144 |
-
"metadata": {},
|
| 145 |
-
"output_type": "execute_result"
|
| 146 |
-
}
|
| 147 |
-
],
|
| 148 |
-
"source": [
|
| 149 |
-
"len(bird.train)"
|
| 150 |
-
]
|
| 151 |
-
},
|
| 152 |
-
{
|
| 153 |
-
"cell_type": "code",
|
| 154 |
-
"execution_count": null,
|
| 155 |
-
"id": "f78b2c43-bfc7-478f-894d-d757b0e9927f",
|
| 156 |
-
"metadata": {},
|
| 157 |
-
"outputs": [],
|
| 158 |
-
"source": []
|
| 159 |
-
},
|
| 160 |
-
{
|
| 161 |
-
"cell_type": "code",
|
| 162 |
-
"execution_count": 71,
|
| 163 |
-
"id": "163545c6-c707-401a-93b8-fb2cb9d65136",
|
| 164 |
-
"metadata": {},
|
| 165 |
-
"outputs": [
|
| 166 |
-
{
|
| 167 |
-
"name": "stdout",
|
| 168 |
-
"output_type": "stream",
|
| 169 |
-
"text": [
|
| 170 |
-
"initializing...\n",
|
| 171 |
-
"loading embeddings from a file...\n",
|
| 172 |
-
"/Users/shaojun/playgo/abc123/embeddings.pkl\n",
|
| 173 |
-
"pkl size: 773\n",
|
| 174 |
-
"embedding size: 773\n",
|
| 175 |
-
"creating embeddings by query OpenAI...\n",
|
| 176 |
-
"query 'i don't like antigravity birds. delete all of them'...\n",
|
| 177 |
-
"embedding size: 774\n",
|
| 178 |
-
"train size: 774\n"
|
| 179 |
-
]
|
| 180 |
-
}
|
| 181 |
-
],
|
| 182 |
-
"source": [
|
| 183 |
-
"bird.init_emb()"
|
| 184 |
-
]
|
| 185 |
-
},
|
| 186 |
-
{
|
| 187 |
-
"cell_type": "code",
|
| 188 |
-
"execution_count": 9,
|
| 189 |
-
"id": "31c02b28-0078-425d-87b6-702caeea02e3",
|
| 190 |
-
"metadata": {},
|
| 191 |
-
"outputs": [
|
| 192 |
-
{
|
| 193 |
-
"data": {
|
| 194 |
-
"text/plain": [
|
| 195 |
-
"773"
|
| 196 |
-
]
|
| 197 |
-
},
|
| 198 |
-
"execution_count": 9,
|
| 199 |
-
"metadata": {},
|
| 200 |
-
"output_type": "execute_result"
|
| 201 |
-
}
|
| 202 |
-
],
|
| 203 |
-
"source": [
|
| 204 |
-
"len(bird.embeddings)"
|
| 205 |
-
]
|
| 206 |
-
},
|
| 207 |
-
{
|
| 208 |
-
"cell_type": "code",
|
| 209 |
-
"execution_count": null,
|
| 210 |
-
"id": "067905b6-b030-4df1-9570-d45885f775eb",
|
| 211 |
-
"metadata": {},
|
| 212 |
-
"outputs": [],
|
| 213 |
-
"source": []
|
| 214 |
-
},
|
| 215 |
-
{
|
| 216 |
-
"cell_type": "code",
|
| 217 |
-
"execution_count": 10,
|
| 218 |
-
"id": "4703a269-a1c0-48e4-8848-6b5cdb9b814b",
|
| 219 |
-
"metadata": {},
|
| 220 |
-
"outputs": [
|
| 221 |
-
{
|
| 222 |
-
"data": {
|
| 223 |
-
"text/plain": [
|
| 224 |
-
"773"
|
| 225 |
-
]
|
| 226 |
-
},
|
| 227 |
-
"execution_count": 10,
|
| 228 |
-
"metadata": {},
|
| 229 |
-
"output_type": "execute_result"
|
| 230 |
-
}
|
| 231 |
-
],
|
| 232 |
-
"source": [
|
| 233 |
-
"len(bird.embeddings)"
|
| 234 |
-
]
|
| 235 |
-
},
|
| 236 |
-
{
|
| 237 |
-
"cell_type": "code",
|
| 238 |
-
"execution_count": null,
|
| 239 |
-
"id": "75cf385f-ba62-452d-a98a-fd3d0bd36031",
|
| 240 |
-
"metadata": {},
|
| 241 |
-
"outputs": [],
|
| 242 |
-
"source": []
|
| 243 |
-
},
|
| 244 |
-
{
|
| 245 |
-
"cell_type": "code",
|
| 246 |
-
"execution_count": 39,
|
| 247 |
-
"id": "d659ff93-eb35-4ef9-bf50-30e0c2206961",
|
| 248 |
-
"metadata": {},
|
| 249 |
-
"outputs": [],
|
| 250 |
-
"source": [
|
| 251 |
-
"s = \"I don't like antigravity birds. Delete all of them\""
|
| 252 |
-
]
|
| 253 |
-
},
|
| 254 |
-
{
|
| 255 |
-
"cell_type": "code",
|
| 256 |
-
"execution_count": 40,
|
| 257 |
-
"id": "c90b7510-09e0-4814-8327-26b56b9f9da5",
|
| 258 |
-
"metadata": {},
|
| 259 |
-
"outputs": [],
|
| 260 |
-
"source": [
|
| 261 |
-
"# s = 'delete antigravity birds'"
|
| 262 |
-
]
|
| 263 |
-
},
|
| 264 |
-
{
|
| 265 |
-
"cell_type": "code",
|
| 266 |
-
"execution_count": 44,
|
| 267 |
-
"id": "2a0ddee9-883c-4e97-b62c-7a7c58b9fa42",
|
| 268 |
-
"metadata": {},
|
| 269 |
-
"outputs": [
|
| 270 |
-
{
|
| 271 |
-
"name": "stdout",
|
| 272 |
-
"output_type": "stream",
|
| 273 |
-
"text": [
|
| 274 |
-
"skip init\n"
|
| 275 |
-
]
|
| 276 |
-
},
|
| 277 |
-
{
|
| 278 |
-
"ename": "RetryError",
|
| 279 |
-
"evalue": "RetryError[<Future at 0x12a3decd0 state=finished raised APIConnectionError>]",
|
| 280 |
-
"output_type": "error",
|
| 281 |
-
"traceback": [
|
| 282 |
-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
| 283 |
-
"\u001b[0;31mConnectionRefusedError\u001b[0m Traceback (most recent call last)",
|
| 284 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/connection.py:200\u001b[0m, in \u001b[0;36mHTTPConnection._new_conn\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 199\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 200\u001b[0m sock \u001b[38;5;241m=\u001b[39m \u001b[43mconnection\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcreate_connection\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 201\u001b[0m \u001b[43m \u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_dns_host\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mport\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 202\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtimeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 203\u001b[0m \u001b[43m \u001b[49m\u001b[43msource_address\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msource_address\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 204\u001b[0m \u001b[43m \u001b[49m\u001b[43msocket_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msocket_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 205\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 206\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m socket\u001b[38;5;241m.\u001b[39mgaierror \u001b[38;5;28;01mas\u001b[39;00m e:\n",
|
| 285 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/util/connection.py:85\u001b[0m, in \u001b[0;36mcreate_connection\u001b[0;34m(address, timeout, source_address, socket_options)\u001b[0m\n\u001b[1;32m 84\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m---> 85\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m err\n\u001b[1;32m 86\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[1;32m 87\u001b[0m \u001b[38;5;66;03m# Break explicitly a reference cycle\u001b[39;00m\n",
|
| 286 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/util/connection.py:73\u001b[0m, in \u001b[0;36mcreate_connection\u001b[0;34m(address, timeout, source_address, socket_options)\u001b[0m\n\u001b[1;32m 72\u001b[0m sock\u001b[38;5;241m.\u001b[39mbind(source_address)\n\u001b[0;32m---> 73\u001b[0m \u001b[43msock\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconnect\u001b[49m\u001b[43m(\u001b[49m\u001b[43msa\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 74\u001b[0m \u001b[38;5;66;03m# Break explicitly a reference cycle\u001b[39;00m\n",
|
| 287 |
-
"\u001b[0;31mConnectionRefusedError\u001b[0m: [Errno 61] Connection refused",
|
| 288 |
-
"\nThe above exception was the direct cause of the following exception:\n",
|
| 289 |
-
"\u001b[0;31mNewConnectionError\u001b[0m Traceback (most recent call last)",
|
| 290 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py:776\u001b[0m, in \u001b[0;36mHTTPConnectionPool.urlopen\u001b[0;34m(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)\u001b[0m\n\u001b[1;32m 775\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 776\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_prepare_proxy\u001b[49m\u001b[43m(\u001b[49m\u001b[43mconn\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 777\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m (BaseSSLError, \u001b[38;5;167;01mOSError\u001b[39;00m, SocketTimeout) \u001b[38;5;28;01mas\u001b[39;00m e:\n",
|
| 291 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py:1041\u001b[0m, in \u001b[0;36mHTTPSConnectionPool._prepare_proxy\u001b[0;34m(self, conn)\u001b[0m\n\u001b[1;32m 1035\u001b[0m conn\u001b[38;5;241m.\u001b[39mset_tunnel(\n\u001b[1;32m 1036\u001b[0m scheme\u001b[38;5;241m=\u001b[39mtunnel_scheme,\n\u001b[1;32m 1037\u001b[0m host\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_tunnel_host,\n\u001b[1;32m 1038\u001b[0m port\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mport,\n\u001b[1;32m 1039\u001b[0m headers\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mproxy_headers,\n\u001b[1;32m 1040\u001b[0m )\n\u001b[0;32m-> 1041\u001b[0m \u001b[43mconn\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconnect\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
|
| 292 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/connection.py:604\u001b[0m, in \u001b[0;36mHTTPSConnection.connect\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 603\u001b[0m sock: socket\u001b[38;5;241m.\u001b[39msocket \u001b[38;5;241m|\u001b[39m ssl\u001b[38;5;241m.\u001b[39mSSLSocket\n\u001b[0;32m--> 604\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msock \u001b[38;5;241m=\u001b[39m sock \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_new_conn\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 605\u001b[0m server_hostname: \u001b[38;5;28mstr\u001b[39m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhost\n",
|
| 293 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/connection.py:215\u001b[0m, in \u001b[0;36mHTTPConnection._new_conn\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 214\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mOSError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m--> 215\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m NewConnectionError(\n\u001b[1;32m 216\u001b[0m \u001b[38;5;28mself\u001b[39m, \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mFailed to establish a new connection: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00me\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 217\u001b[0m ) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01me\u001b[39;00m\n\u001b[1;32m 219\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m sock\n",
|
| 294 |
-
"\u001b[0;31mNewConnectionError\u001b[0m: <urllib3.connection.HTTPSConnection object at 0x12a3dd350>: Failed to establish a new connection: [Errno 61] Connection refused",
|
| 295 |
-
"\nThe above exception was the direct cause of the following exception:\n",
|
| 296 |
-
"\u001b[0;31mProxyError\u001b[0m Traceback (most recent call last)",
|
| 297 |
-
"\u001b[0;31mProxyError\u001b[0m: ('Unable to connect to proxy', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x12a3dd350>: Failed to establish a new connection: [Errno 61] Connection refused'))",
|
| 298 |
-
"\nThe above exception was the direct cause of the following exception:\n",
|
| 299 |
-
"\u001b[0;31mMaxRetryError\u001b[0m Traceback (most recent call last)",
|
| 300 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/requests/adapters.py:486\u001b[0m, in \u001b[0;36mHTTPAdapter.send\u001b[0;34m(self, request, stream, timeout, verify, cert, proxies)\u001b[0m\n\u001b[1;32m 485\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 486\u001b[0m resp \u001b[38;5;241m=\u001b[39m \u001b[43mconn\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43murlopen\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 487\u001b[0m \u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequest\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 488\u001b[0m \u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 489\u001b[0m \u001b[43m \u001b[49m\u001b[43mbody\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequest\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mbody\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 490\u001b[0m \u001b[43m \u001b[49m\u001b[43mheaders\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequest\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 491\u001b[0m \u001b[43m \u001b[49m\u001b[43mredirect\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[1;32m 492\u001b[0m \u001b[43m \u001b[49m\u001b[43massert_same_host\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[1;32m 493\u001b[0m \u001b[43m \u001b[49m\u001b[43mpreload_content\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[1;32m 494\u001b[0m \u001b[43m \u001b[49m\u001b[43mdecode_content\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[1;32m 495\u001b[0m \u001b[43m \u001b[49m\u001b[43mretries\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmax_retries\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 496\u001b[0m \u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtimeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 497\u001b[0m \u001b[43m \u001b[49m\u001b[43mchunked\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mchunked\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 498\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 500\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m (ProtocolError, \u001b[38;5;167;01mOSError\u001b[39;00m) \u001b[38;5;28;01mas\u001b[39;00m err:\n",
|
| 301 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py:874\u001b[0m, in \u001b[0;36mHTTPConnectionPool.urlopen\u001b[0;34m(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)\u001b[0m\n\u001b[1;32m 871\u001b[0m log\u001b[38;5;241m.\u001b[39mwarning(\n\u001b[1;32m 872\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mRetrying (\u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m) after connection broken by \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m: \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m\"\u001b[39m, retries, err, url\n\u001b[1;32m 873\u001b[0m )\n\u001b[0;32m--> 874\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43murlopen\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 875\u001b[0m \u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 876\u001b[0m \u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 877\u001b[0m \u001b[43m \u001b[49m\u001b[43mbody\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 878\u001b[0m \u001b[43m \u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 879\u001b[0m \u001b[43m \u001b[49m\u001b[43mretries\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 880\u001b[0m \u001b[43m \u001b[49m\u001b[43mredirect\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 881\u001b[0m \u001b[43m \u001b[49m\u001b[43massert_same_host\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 882\u001b[0m \u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtimeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 883\u001b[0m \u001b[43m \u001b[49m\u001b[43mpool_timeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mpool_timeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 884\u001b[0m \u001b[43m \u001b[49m\u001b[43mrelease_conn\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrelease_conn\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 885\u001b[0m \u001b[43m \u001b[49m\u001b[43mchunked\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mchunked\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 886\u001b[0m \u001b[43m \u001b[49m\u001b[43mbody_pos\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbody_pos\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 887\u001b[0m \u001b[43m \u001b[49m\u001b[43mpreload_content\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mpreload_content\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 888\u001b[0m \u001b[43m \u001b[49m\u001b[43mdecode_content\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdecode_content\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 889\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mresponse_kw\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 890\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 892\u001b[0m \u001b[38;5;66;03m# Handle redirect?\u001b[39;00m\n",
|
| 302 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py:874\u001b[0m, in \u001b[0;36mHTTPConnectionPool.urlopen\u001b[0;34m(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)\u001b[0m\n\u001b[1;32m 871\u001b[0m log\u001b[38;5;241m.\u001b[39mwarning(\n\u001b[1;32m 872\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mRetrying (\u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m) after connection broken by \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m: \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m\"\u001b[39m, retries, err, url\n\u001b[1;32m 873\u001b[0m )\n\u001b[0;32m--> 874\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43murlopen\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 875\u001b[0m \u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 876\u001b[0m \u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 877\u001b[0m \u001b[43m \u001b[49m\u001b[43mbody\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 878\u001b[0m \u001b[43m \u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 879\u001b[0m \u001b[43m \u001b[49m\u001b[43mretries\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 880\u001b[0m \u001b[43m \u001b[49m\u001b[43mredirect\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 881\u001b[0m \u001b[43m \u001b[49m\u001b[43massert_same_host\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 882\u001b[0m \u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtimeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 883\u001b[0m \u001b[43m \u001b[49m\u001b[43mpool_timeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mpool_timeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 884\u001b[0m \u001b[43m \u001b[49m\u001b[43mrelease_conn\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrelease_conn\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 885\u001b[0m \u001b[43m \u001b[49m\u001b[43mchunked\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mchunked\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 886\u001b[0m \u001b[43m \u001b[49m\u001b[43mbody_pos\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbody_pos\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 887\u001b[0m \u001b[43m \u001b[49m\u001b[43mpreload_content\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mpreload_content\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 888\u001b[0m \u001b[43m \u001b[49m\u001b[43mdecode_content\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdecode_content\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 889\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mresponse_kw\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 890\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 892\u001b[0m \u001b[38;5;66;03m# Handle redirect?\u001b[39;00m\n",
|
| 303 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py:844\u001b[0m, in \u001b[0;36mHTTPConnectionPool.urlopen\u001b[0;34m(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)\u001b[0m\n\u001b[1;32m 842\u001b[0m new_e \u001b[38;5;241m=\u001b[39m ProtocolError(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mConnection aborted.\u001b[39m\u001b[38;5;124m\"\u001b[39m, new_e)\n\u001b[0;32m--> 844\u001b[0m retries \u001b[38;5;241m=\u001b[39m \u001b[43mretries\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mincrement\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 845\u001b[0m \u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43merror\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mnew_e\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m_pool\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m_stacktrace\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msys\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mexc_info\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m2\u001b[39;49m\u001b[43m]\u001b[49m\n\u001b[1;32m 846\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 847\u001b[0m retries\u001b[38;5;241m.\u001b[39msleep()\n",
|
| 304 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/util/retry.py:515\u001b[0m, in \u001b[0;36mRetry.increment\u001b[0;34m(self, method, url, response, error, _pool, _stacktrace)\u001b[0m\n\u001b[1;32m 514\u001b[0m reason \u001b[38;5;241m=\u001b[39m error \u001b[38;5;129;01mor\u001b[39;00m ResponseError(cause)\n\u001b[0;32m--> 515\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m MaxRetryError(_pool, url, reason) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mreason\u001b[39;00m \u001b[38;5;66;03m# type: ignore[arg-type]\u001b[39;00m\n\u001b[1;32m 517\u001b[0m log\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mIncremented Retry for (url=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m): \u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m\"\u001b[39m, url, new_retry)\n",
|
| 305 |
-
"\u001b[0;31mMaxRetryError\u001b[0m: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/engines/text-embedding-ada-002/embeddings (Caused by ProxyError('Unable to connect to proxy', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x12a3dd350>: Failed to establish a new connection: [Errno 61] Connection refused')))",
|
| 306 |
-
"\nDuring handling of the above exception, another exception occurred:\n",
|
| 307 |
-
"\u001b[0;31mProxyError\u001b[0m Traceback (most recent call last)",
|
| 308 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/openai/api_requestor.py:596\u001b[0m, in \u001b[0;36mAPIRequestor.request_raw\u001b[0;34m(self, method, url, params, supplied_headers, files, stream, request_id, request_timeout)\u001b[0m\n\u001b[1;32m 595\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 596\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43m_thread_context\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msession\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrequest\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 597\u001b[0m \u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 598\u001b[0m \u001b[43m \u001b[49m\u001b[43mabs_url\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 599\u001b[0m \u001b[43m \u001b[49m\u001b[43mheaders\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 600\u001b[0m \u001b[43m \u001b[49m\u001b[43mdata\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdata\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 601\u001b[0m \u001b[43m \u001b[49m\u001b[43mfiles\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mfiles\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 602\u001b[0m \u001b[43m \u001b[49m\u001b[43mstream\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstream\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 603\u001b[0m \u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequest_timeout\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mif\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mrequest_timeout\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01melse\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mTIMEOUT_SECS\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 604\u001b[0m \u001b[43m \u001b[49m\u001b[43mproxies\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m_thread_context\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msession\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mproxies\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 605\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 606\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m requests\u001b[38;5;241m.\u001b[39mexceptions\u001b[38;5;241m.\u001b[39mTimeout \u001b[38;5;28;01mas\u001b[39;00m e:\n",
|
| 309 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/requests/sessions.py:589\u001b[0m, in \u001b[0;36mSession.request\u001b[0;34m(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)\u001b[0m\n\u001b[1;32m 588\u001b[0m send_kwargs\u001b[38;5;241m.\u001b[39mupdate(settings)\n\u001b[0;32m--> 589\u001b[0m resp \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msend\u001b[49m\u001b[43m(\u001b[49m\u001b[43mprep\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43msend_kwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 591\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m resp\n",
|
| 310 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/requests/sessions.py:703\u001b[0m, in \u001b[0;36mSession.send\u001b[0;34m(self, request, **kwargs)\u001b[0m\n\u001b[1;32m 702\u001b[0m \u001b[38;5;66;03m# Send the request\u001b[39;00m\n\u001b[0;32m--> 703\u001b[0m r \u001b[38;5;241m=\u001b[39m \u001b[43madapter\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msend\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 705\u001b[0m \u001b[38;5;66;03m# Total elapsed time of the request (approximately)\u001b[39;00m\n",
|
| 311 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/requests/adapters.py:513\u001b[0m, in \u001b[0;36mHTTPAdapter.send\u001b[0;34m(self, request, stream, timeout, verify, cert, proxies)\u001b[0m\n\u001b[1;32m 512\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(e\u001b[38;5;241m.\u001b[39mreason, _ProxyError):\n\u001b[0;32m--> 513\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m ProxyError(e, request\u001b[38;5;241m=\u001b[39mrequest)\n\u001b[1;32m 515\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(e\u001b[38;5;241m.\u001b[39mreason, _SSLError):\n\u001b[1;32m 516\u001b[0m \u001b[38;5;66;03m# This branch is for urllib3 v1.22 and later.\u001b[39;00m\n",
|
| 312 |
-
"\u001b[0;31mProxyError\u001b[0m: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/engines/text-embedding-ada-002/embeddings (Caused by ProxyError('Unable to connect to proxy', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x12a3dd350>: Failed to establish a new connection: [Errno 61] Connection refused')))",
|
| 313 |
-
"\nThe above exception was the direct cause of the following exception:\n",
|
| 314 |
-
"\u001b[0;31mAPIConnectionError\u001b[0m Traceback (most recent call last)",
|
| 315 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/tenacity/__init__.py:382\u001b[0m, in \u001b[0;36mRetrying.__call__\u001b[0;34m(self, fn, *args, **kwargs)\u001b[0m\n\u001b[1;32m 381\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 382\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mfn\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 383\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBaseException\u001b[39;00m: \u001b[38;5;66;03m# noqa: B902\u001b[39;00m\n",
|
| 316 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/openai/embeddings_utils.py:23\u001b[0m, in \u001b[0;36mget_embedding\u001b[0;34m(text, engine, **kwargs)\u001b[0m\n\u001b[1;32m 21\u001b[0m text \u001b[38;5;241m=\u001b[39m text\u001b[38;5;241m.\u001b[39mreplace(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m \u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m---> 23\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mopenai\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mEmbedding\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcreate\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43minput\u001b[39;49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m[\u001b[49m\u001b[43mtext\u001b[49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mengine\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mengine\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdata\u001b[39m\u001b[38;5;124m\"\u001b[39m][\u001b[38;5;241m0\u001b[39m][\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124membedding\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n",
|
| 317 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/openai/api_resources/embedding.py:33\u001b[0m, in \u001b[0;36mEmbedding.create\u001b[0;34m(cls, *args, **kwargs)\u001b[0m\n\u001b[1;32m 32\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m---> 33\u001b[0m response \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcreate\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 35\u001b[0m \u001b[38;5;66;03m# If a user specifies base64, we'll just return the encoded string.\u001b[39;00m\n\u001b[1;32m 36\u001b[0m \u001b[38;5;66;03m# This is only for the default case.\u001b[39;00m\n",
|
| 318 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/openai/api_resources/abstract/engine_api_resource.py:153\u001b[0m, in \u001b[0;36mEngineAPIResource.create\u001b[0;34m(cls, api_key, api_base, api_type, request_id, api_version, organization, **params)\u001b[0m\n\u001b[1;32m 138\u001b[0m (\n\u001b[1;32m 139\u001b[0m deployment_id,\n\u001b[1;32m 140\u001b[0m engine,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 150\u001b[0m api_key, api_base, api_type, api_version, organization, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mparams\n\u001b[1;32m 151\u001b[0m )\n\u001b[0;32m--> 153\u001b[0m response, _, api_key \u001b[38;5;241m=\u001b[39m \u001b[43mrequestor\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrequest\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 154\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mpost\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 155\u001b[0m \u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 156\u001b[0m \u001b[43m \u001b[49m\u001b[43mparams\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mparams\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 157\u001b[0m \u001b[43m \u001b[49m\u001b[43mheaders\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 158\u001b[0m \u001b[43m \u001b[49m\u001b[43mstream\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstream\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 159\u001b[0m \u001b[43m \u001b[49m\u001b[43mrequest_id\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequest_id\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 160\u001b[0m \u001b[43m \u001b[49m\u001b[43mrequest_timeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequest_timeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 161\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 163\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m stream:\n\u001b[1;32m 164\u001b[0m \u001b[38;5;66;03m# must be an iterator\u001b[39;00m\n",
|
| 319 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/openai/api_requestor.py:288\u001b[0m, in \u001b[0;36mAPIRequestor.request\u001b[0;34m(self, method, url, params, headers, files, stream, request_id, request_timeout)\u001b[0m\n\u001b[1;32m 277\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mrequest\u001b[39m(\n\u001b[1;32m 278\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m 279\u001b[0m method,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 286\u001b[0m request_timeout: Optional[Union[\u001b[38;5;28mfloat\u001b[39m, Tuple[\u001b[38;5;28mfloat\u001b[39m, \u001b[38;5;28mfloat\u001b[39m]]] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[1;32m 287\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Tuple[Union[OpenAIResponse, Iterator[OpenAIResponse]], \u001b[38;5;28mbool\u001b[39m, \u001b[38;5;28mstr\u001b[39m]:\n\u001b[0;32m--> 288\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrequest_raw\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 289\u001b[0m \u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mlower\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 290\u001b[0m \u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 291\u001b[0m \u001b[43m \u001b[49m\u001b[43mparams\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mparams\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 292\u001b[0m \u001b[43m \u001b[49m\u001b[43msupplied_headers\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 293\u001b[0m \u001b[43m \u001b[49m\u001b[43mfiles\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mfiles\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 294\u001b[0m \u001b[43m \u001b[49m\u001b[43mstream\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstream\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 295\u001b[0m \u001b[43m \u001b[49m\u001b[43mrequest_id\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequest_id\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 296\u001b[0m \u001b[43m \u001b[49m\u001b[43mrequest_timeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequest_timeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 297\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 298\u001b[0m resp, got_stream \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_interpret_response(result, stream)\n",
|
| 320 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/openai/api_requestor.py:609\u001b[0m, in \u001b[0;36mAPIRequestor.request_raw\u001b[0;34m(self, method, url, params, supplied_headers, files, stream, request_id, request_timeout)\u001b[0m\n\u001b[1;32m 608\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m requests\u001b[38;5;241m.\u001b[39mexceptions\u001b[38;5;241m.\u001b[39mRequestException \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m--> 609\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m error\u001b[38;5;241m.\u001b[39mAPIConnectionError(\n\u001b[1;32m 610\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mError communicating with OpenAI: \u001b[39m\u001b[38;5;132;01m{}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(e)\n\u001b[1;32m 611\u001b[0m ) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01me\u001b[39;00m\n\u001b[1;32m 612\u001b[0m util\u001b[38;5;241m.\u001b[39mlog_debug(\n\u001b[1;32m 613\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mOpenAI API response\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 614\u001b[0m path\u001b[38;5;241m=\u001b[39mabs_url,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 617\u001b[0m request_id\u001b[38;5;241m=\u001b[39mresult\u001b[38;5;241m.\u001b[39mheaders\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mX-Request-Id\u001b[39m\u001b[38;5;124m\"\u001b[39m),\n\u001b[1;32m 618\u001b[0m )\n",
|
| 321 |
-
"\u001b[0;31mAPIConnectionError\u001b[0m: Error communicating with OpenAI: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/engines/text-embedding-ada-002/embeddings (Caused by ProxyError('Unable to connect to proxy', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x12a3dd350>: Failed to establish a new connection: [Errno 61] Connection refused')))",
|
| 322 |
-
"\nThe above exception was the direct cause of the following exception:\n",
|
| 323 |
-
"\u001b[0;31mRetryError\u001b[0m Traceback (most recent call last)",
|
| 324 |
-
"Cell \u001b[0;32mIn[44], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m xx \u001b[38;5;241m=\u001b[39m \u001b[43mbird\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mquery_emb\u001b[49m\u001b[43m(\u001b[49m\u001b[43ms\u001b[49m\u001b[43m)\u001b[49m\n",
|
| 325 |
-
"File \u001b[0;32m~/playgo/abc123/games/angrybirds/angrybirds.py:197\u001b[0m, in \u001b[0;36mangrybird.query_emb\u001b[0;34m(self, command)\u001b[0m\n\u001b[1;32m 194\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m command\u001b[38;5;241m.\u001b[39mstrip() \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m'\u001b[39m:\n\u001b[1;32m 195\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m status_failure, [\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mYour input is empty.\u001b[39m\u001b[38;5;124m\"\u001b[39m], \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;241m0\u001b[39m\n\u001b[0;32m--> 197\u001b[0m imput_emb \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_compute_emb\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcommand\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 198\u001b[0m top_cmd \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 199\u001b[0m top_sim \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m0\u001b[39m\n",
|
| 326 |
-
"File \u001b[0;32m~/playgo/abc123/games/angrybirds/angrybirds.py:121\u001b[0m, in \u001b[0;36mangrybird._compute_emb\u001b[0;34m(self, command)\u001b[0m\n\u001b[1;32m 118\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_compute_emb\u001b[39m(\u001b[38;5;28mself\u001b[39m, command: \u001b[38;5;28mstr\u001b[39m):\n\u001b[1;32m 119\u001b[0m \u001b[38;5;66;03m# always normalize text when query OpenAI embedding service\u001b[39;00m\n\u001b[1;32m 120\u001b[0m command \u001b[38;5;241m=\u001b[39m command\u001b[38;5;241m.\u001b[39mstrip()\u001b[38;5;241m.\u001b[39mlower()\n\u001b[0;32m--> 121\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mopenai_get_embedding\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 122\u001b[0m \u001b[43m \u001b[49m\u001b[43mcommand\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 123\u001b[0m \u001b[43m \u001b[49m\u001b[43mengine\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mtext-embedding-ada-002\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\n\u001b[1;32m 124\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n",
|
| 327 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/tenacity/__init__.py:289\u001b[0m, in \u001b[0;36mBaseRetrying.wraps.<locals>.wrapped_f\u001b[0;34m(*args, **kw)\u001b[0m\n\u001b[1;32m 287\u001b[0m \u001b[38;5;129m@functools\u001b[39m\u001b[38;5;241m.\u001b[39mwraps(f)\n\u001b[1;32m 288\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mwrapped_f\u001b[39m(\u001b[38;5;241m*\u001b[39margs: t\u001b[38;5;241m.\u001b[39mAny, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkw: t\u001b[38;5;241m.\u001b[39mAny) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m t\u001b[38;5;241m.\u001b[39mAny:\n\u001b[0;32m--> 289\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkw\u001b[49m\u001b[43m)\u001b[49m\n",
|
| 328 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/tenacity/__init__.py:379\u001b[0m, in \u001b[0;36mRetrying.__call__\u001b[0;34m(self, fn, *args, **kwargs)\u001b[0m\n\u001b[1;32m 377\u001b[0m retry_state \u001b[38;5;241m=\u001b[39m RetryCallState(retry_object\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m, fn\u001b[38;5;241m=\u001b[39mfn, args\u001b[38;5;241m=\u001b[39margs, kwargs\u001b[38;5;241m=\u001b[39mkwargs)\n\u001b[1;32m 378\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[0;32m--> 379\u001b[0m do \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43miter\u001b[49m\u001b[43m(\u001b[49m\u001b[43mretry_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mretry_state\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 380\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(do, DoAttempt):\n\u001b[1;32m 381\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n",
|
| 329 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/tenacity/__init__.py:326\u001b[0m, in \u001b[0;36mBaseRetrying.iter\u001b[0;34m(self, retry_state)\u001b[0m\n\u001b[1;32m 324\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mreraise:\n\u001b[1;32m 325\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m retry_exc\u001b[38;5;241m.\u001b[39mreraise()\n\u001b[0;32m--> 326\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m retry_exc \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfut\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mexception\u001b[39;00m()\n\u001b[1;32m 328\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mwait:\n\u001b[1;32m 329\u001b[0m sleep \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mwait(retry_state)\n",
|
| 330 |
-
"\u001b[0;31mRetryError\u001b[0m: RetryError[<Future at 0x12a3decd0 state=finished raised APIConnectionError>]"
|
| 331 |
-
]
|
| 332 |
-
}
|
| 333 |
-
],
|
| 334 |
-
"source": [
|
| 335 |
-
"xx = bird.query_emb(s)"
|
| 336 |
-
]
|
| 337 |
-
},
|
| 338 |
-
{
|
| 339 |
-
"cell_type": "code",
|
| 340 |
-
"execution_count": 45,
|
| 341 |
-
"id": "06e53c7e-9c4b-4529-8e2f-ab90d29b0404",
|
| 342 |
-
"metadata": {},
|
| 343 |
-
"outputs": [
|
| 344 |
-
{
|
| 345 |
-
"data": {
|
| 346 |
-
"text/plain": [
|
| 347 |
-
"list"
|
| 348 |
-
]
|
| 349 |
-
},
|
| 350 |
-
"execution_count": 45,
|
| 351 |
-
"metadata": {},
|
| 352 |
-
"output_type": "execute_result"
|
| 353 |
-
}
|
| 354 |
-
],
|
| 355 |
-
"source": [
|
| 356 |
-
"type(xx)"
|
| 357 |
-
]
|
| 358 |
-
},
|
| 359 |
-
{
|
| 360 |
-
"cell_type": "code",
|
| 361 |
-
"execution_count": 46,
|
| 362 |
-
"id": "8ca3cf57-469d-4632-a5b5-6da4ad4c0e2f",
|
| 363 |
-
"metadata": {},
|
| 364 |
-
"outputs": [
|
| 365 |
-
{
|
| 366 |
-
"data": {
|
| 367 |
-
"text/plain": [
|
| 368 |
-
"['OK',\n",
|
| 369 |
-
" ['bird', 'delete', {'quantity': 'some', 'type': 'antigravity'}],\n",
|
| 370 |
-
" 'delete some antigravity birds',\n",
|
| 371 |
-
" 0.9348558221466966]"
|
| 372 |
-
]
|
| 373 |
-
},
|
| 374 |
-
"execution_count": 46,
|
| 375 |
-
"metadata": {},
|
| 376 |
-
"output_type": "execute_result"
|
| 377 |
-
}
|
| 378 |
-
],
|
| 379 |
-
"source": [
|
| 380 |
-
"xx"
|
| 381 |
-
]
|
| 382 |
-
},
|
| 383 |
-
{
|
| 384 |
-
"cell_type": "code",
|
| 385 |
-
"execution_count": 47,
|
| 386 |
-
"id": "622ffa96-98c1-432c-8cba-76facb4a9ddd",
|
| 387 |
-
"metadata": {},
|
| 388 |
-
"outputs": [],
|
| 389 |
-
"source": [
|
| 390 |
-
"command = s"
|
| 391 |
-
]
|
| 392 |
-
},
|
| 393 |
-
{
|
| 394 |
-
"cell_type": "code",
|
| 395 |
-
"execution_count": 49,
|
| 396 |
-
"id": "0fe0cf9c-f395-4b17-bb11-121a326635dd",
|
| 397 |
-
"metadata": {},
|
| 398 |
-
"outputs": [],
|
| 399 |
-
"source": [
|
| 400 |
-
"imput_emb = bird._compute_emb(command)"
|
| 401 |
-
]
|
| 402 |
-
},
|
| 403 |
-
{
|
| 404 |
-
"cell_type": "code",
|
| 405 |
-
"execution_count": 50,
|
| 406 |
-
"id": "cbfdc092-88a6-4f57-b50a-a8929fc79b33",
|
| 407 |
-
"metadata": {},
|
| 408 |
-
"outputs": [],
|
| 409 |
-
"source": [
|
| 410 |
-
"import openai\n",
|
| 411 |
-
"from openai.embeddings_utils import get_embedding as openai_get_embedding\n",
|
| 412 |
-
"from openai.embeddings_utils import cosine_similarity as openai_cosine_similarity"
|
| 413 |
-
]
|
| 414 |
-
},
|
| 415 |
-
{
|
| 416 |
-
"cell_type": "code",
|
| 417 |
-
"execution_count": 51,
|
| 418 |
-
"id": "a2dff84a-9d48-4f7b-a053-0b73b57da9ad",
|
| 419 |
-
"metadata": {},
|
| 420 |
-
"outputs": [],
|
| 421 |
-
"source": [
|
| 422 |
-
"top_cmd = None\n",
|
| 423 |
-
"top_sim = 0\n",
|
| 424 |
-
"for cmd in bird.embeddings:\n",
|
| 425 |
-
" sim = openai_cosine_similarity(\n",
|
| 426 |
-
" imput_emb, \n",
|
| 427 |
-
" bird.embeddings[cmd],\n",
|
| 428 |
-
" )\n",
|
| 429 |
-
" if sim > top_sim:\n",
|
| 430 |
-
" top_cmd = cmd\n",
|
| 431 |
-
" top_sim = sim"
|
| 432 |
-
]
|
| 433 |
-
},
|
| 434 |
-
{
|
| 435 |
-
"cell_type": "code",
|
| 436 |
-
"execution_count": 52,
|
| 437 |
-
"id": "f3ed3ed1-98ee-4e42-82eb-4a6445edff3d",
|
| 438 |
-
"metadata": {},
|
| 439 |
-
"outputs": [
|
| 440 |
-
{
|
| 441 |
-
"data": {
|
| 442 |
-
"text/plain": [
|
| 443 |
-
"'delete some antigravity birds'"
|
| 444 |
-
]
|
| 445 |
-
},
|
| 446 |
-
"execution_count": 52,
|
| 447 |
-
"metadata": {},
|
| 448 |
-
"output_type": "execute_result"
|
| 449 |
-
}
|
| 450 |
-
],
|
| 451 |
-
"source": [
|
| 452 |
-
"top_cmd"
|
| 453 |
-
]
|
| 454 |
-
},
|
| 455 |
-
{
|
| 456 |
-
"cell_type": "code",
|
| 457 |
-
"execution_count": 53,
|
| 458 |
-
"id": "7ffbc3e4-4933-4bac-89c1-ec00a9e6eb0a",
|
| 459 |
-
"metadata": {},
|
| 460 |
-
"outputs": [
|
| 461 |
-
{
|
| 462 |
-
"data": {
|
| 463 |
-
"text/plain": [
|
| 464 |
-
"0.9319764923699465"
|
| 465 |
-
]
|
| 466 |
-
},
|
| 467 |
-
"execution_count": 53,
|
| 468 |
-
"metadata": {},
|
| 469 |
-
"output_type": "execute_result"
|
| 470 |
-
}
|
| 471 |
-
],
|
| 472 |
-
"source": [
|
| 473 |
-
"top_sim"
|
| 474 |
-
]
|
| 475 |
-
},
|
| 476 |
-
{
|
| 477 |
-
"cell_type": "code",
|
| 478 |
-
"execution_count": 54,
|
| 479 |
-
"id": "0bc21e4a-e81c-4ab8-af45-f53eba709ab5",
|
| 480 |
-
"metadata": {},
|
| 481 |
-
"outputs": [],
|
| 482 |
-
"source": [
|
| 483 |
-
"results = []\n",
|
| 484 |
-
"for cmd in bird.embeddings:\n",
|
| 485 |
-
" sim = openai_cosine_similarity(\n",
|
| 486 |
-
" imput_emb, \n",
|
| 487 |
-
" bird.embeddings[cmd],\n",
|
| 488 |
-
" )\n",
|
| 489 |
-
" results.append([cmd, sim])"
|
| 490 |
-
]
|
| 491 |
-
},
|
| 492 |
-
{
|
| 493 |
-
"cell_type": "code",
|
| 494 |
-
"execution_count": 57,
|
| 495 |
-
"id": "973ae4ca-1eba-42c3-ba2b-ccf06d0ddbbe",
|
| 496 |
-
"metadata": {},
|
| 497 |
-
"outputs": [],
|
| 498 |
-
"source": [
|
| 499 |
-
"results.sort(key = lambda x: x[1], reverse=True)"
|
| 500 |
-
]
|
| 501 |
-
},
|
| 502 |
-
{
|
| 503 |
-
"cell_type": "code",
|
| 504 |
-
"execution_count": 59,
|
| 505 |
-
"id": "89523b8d-59f8-48da-a492-8659ccde3138",
|
| 506 |
-
"metadata": {},
|
| 507 |
-
"outputs": [
|
| 508 |
-
{
|
| 509 |
-
"data": {
|
| 510 |
-
"text/plain": [
|
| 511 |
-
"\"I don't like antigravity birds. Delete all of them\""
|
| 512 |
-
]
|
| 513 |
-
},
|
| 514 |
-
"execution_count": 59,
|
| 515 |
-
"metadata": {},
|
| 516 |
-
"output_type": "execute_result"
|
| 517 |
-
}
|
| 518 |
-
],
|
| 519 |
-
"source": [
|
| 520 |
-
"command"
|
| 521 |
-
]
|
| 522 |
-
},
|
| 523 |
-
{
|
| 524 |
-
"cell_type": "code",
|
| 525 |
-
"execution_count": 58,
|
| 526 |
-
"id": "2bba1891-5c0a-40c6-9b06-736553b55a3e",
|
| 527 |
-
"metadata": {},
|
| 528 |
-
"outputs": [
|
| 529 |
-
{
|
| 530 |
-
"data": {
|
| 531 |
-
"text/plain": [
|
| 532 |
-
"[['delete some antigravity birds', 0.9319764923699465],\n",
|
| 533 |
-
" ['delete all antigravity birds', 0.926993589547008],\n",
|
| 534 |
-
" ['delete antigravity birds', 0.924798267679007],\n",
|
| 535 |
-
" ['delete more antigravity birds', 0.9231406436854316],\n",
|
| 536 |
-
" ['delete one antigravity bird', 0.9145274787932756]]"
|
| 537 |
-
]
|
| 538 |
-
},
|
| 539 |
-
"execution_count": 58,
|
| 540 |
-
"metadata": {},
|
| 541 |
-
"output_type": "execute_result"
|
| 542 |
-
}
|
| 543 |
-
],
|
| 544 |
-
"source": [
|
| 545 |
-
"results[:5]"
|
| 546 |
-
]
|
| 547 |
-
},
|
| 548 |
-
{
|
| 549 |
-
"cell_type": "code",
|
| 550 |
-
"execution_count": 86,
|
| 551 |
-
"id": "3636b75c-de9c-4953-b3b2-61fc15ae0a6f",
|
| 552 |
-
"metadata": {},
|
| 553 |
-
"outputs": [],
|
| 554 |
-
"source": [
|
| 555 |
-
"res2 = {}\n",
|
| 556 |
-
"for i, e in enumerate(results[:5]):\n",
|
| 557 |
-
" tmp = {i: [f\"{e[1]:.8f}\", e[0]]}\n",
|
| 558 |
-
" res2 |= tmp"
|
| 559 |
-
]
|
| 560 |
-
},
|
| 561 |
-
{
|
| 562 |
-
"cell_type": "code",
|
| 563 |
-
"execution_count": 87,
|
| 564 |
-
"id": "1470d109-edff-48b9-b81b-9c88bba842e3",
|
| 565 |
-
"metadata": {},
|
| 566 |
-
"outputs": [
|
| 567 |
-
{
|
| 568 |
-
"data": {
|
| 569 |
-
"text/plain": [
|
| 570 |
-
"{0: ['0.93197649', 'delete some antigravity birds'],\n",
|
| 571 |
-
" 1: ['0.92699359', 'delete all antigravity birds'],\n",
|
| 572 |
-
" 2: ['0.92479827', 'delete antigravity birds'],\n",
|
| 573 |
-
" 3: ['0.92314064', 'delete more antigravity birds'],\n",
|
| 574 |
-
" 4: ['0.91452748', 'delete one antigravity bird']}"
|
| 575 |
-
]
|
| 576 |
-
},
|
| 577 |
-
"execution_count": 87,
|
| 578 |
-
"metadata": {},
|
| 579 |
-
"output_type": "execute_result"
|
| 580 |
-
}
|
| 581 |
-
],
|
| 582 |
-
"source": [
|
| 583 |
-
"res2"
|
| 584 |
-
]
|
| 585 |
-
},
|
| 586 |
-
{
|
| 587 |
-
"cell_type": "code",
|
| 588 |
-
"execution_count": null,
|
| 589 |
-
"id": "d4da3a5f-a0c8-4728-8bbb-9a21b9776cf8",
|
| 590 |
-
"metadata": {},
|
| 591 |
-
"outputs": [],
|
| 592 |
-
"source": []
|
| 593 |
-
},
|
| 594 |
-
{
|
| 595 |
-
"cell_type": "code",
|
| 596 |
-
"execution_count": 90,
|
| 597 |
-
"id": "e14c27fc-881b-4c48-ae93-87cc7860d9c9",
|
| 598 |
-
"metadata": {},
|
| 599 |
-
"outputs": [],
|
| 600 |
-
"source": [
|
| 601 |
-
"res2 = []\n",
|
| 602 |
-
"for i, e in enumerate(results[:5]):\n",
|
| 603 |
-
" tmp = [i, f\"{e[1]:.8f}\", e[0]]\n",
|
| 604 |
-
" res2.append(tmp)\n"
|
| 605 |
-
]
|
| 606 |
-
},
|
| 607 |
-
{
|
| 608 |
-
"cell_type": "code",
|
| 609 |
-
"execution_count": 91,
|
| 610 |
-
"id": "c80ff104-54d6-4a72-a9f7-ed980f4c4422",
|
| 611 |
-
"metadata": {},
|
| 612 |
-
"outputs": [
|
| 613 |
-
{
|
| 614 |
-
"data": {
|
| 615 |
-
"text/plain": [
|
| 616 |
-
"[[0, '0.93197649', 'delete some antigravity birds'],\n",
|
| 617 |
-
" [1, '0.92699359', 'delete all antigravity birds'],\n",
|
| 618 |
-
" [2, '0.92479827', 'delete antigravity birds'],\n",
|
| 619 |
-
" [3, '0.92314064', 'delete more antigravity birds'],\n",
|
| 620 |
-
" [4, '0.91452748', 'delete one antigravity bird']]"
|
| 621 |
-
]
|
| 622 |
-
},
|
| 623 |
-
"execution_count": 91,
|
| 624 |
-
"metadata": {},
|
| 625 |
-
"output_type": "execute_result"
|
| 626 |
-
}
|
| 627 |
-
],
|
| 628 |
-
"source": [
|
| 629 |
-
"res2"
|
| 630 |
-
]
|
| 631 |
-
},
|
| 632 |
-
{
|
| 633 |
-
"cell_type": "code",
|
| 634 |
-
"execution_count": null,
|
| 635 |
-
"id": "eec6fc8a-e129-4383-bd7a-c4f9364c496c",
|
| 636 |
-
"metadata": {},
|
| 637 |
-
"outputs": [],
|
| 638 |
-
"source": []
|
| 639 |
-
},
|
| 640 |
-
{
|
| 641 |
-
"cell_type": "code",
|
| 642 |
-
"execution_count": null,
|
| 643 |
-
"id": "e5de835b-9b8e-4f53-af05-d17581b6f46f",
|
| 644 |
-
"metadata": {},
|
| 645 |
-
"outputs": [],
|
| 646 |
-
"source": []
|
| 647 |
-
},
|
| 648 |
-
{
|
| 649 |
-
"cell_type": "code",
|
| 650 |
-
"execution_count": 38,
|
| 651 |
-
"id": "8eb9449e-f0d0-40b9-b0f2-b51f5b5470c7",
|
| 652 |
-
"metadata": {},
|
| 653 |
-
"outputs": [
|
| 654 |
-
{
|
| 655 |
-
"data": {
|
| 656 |
-
"text/plain": [
|
| 657 |
-
"\"I don't like antigravity birds. Delete them\""
|
| 658 |
-
]
|
| 659 |
-
},
|
| 660 |
-
"execution_count": 38,
|
| 661 |
-
"metadata": {},
|
| 662 |
-
"output_type": "execute_result"
|
| 663 |
-
}
|
| 664 |
-
],
|
| 665 |
-
"source": [
|
| 666 |
-
"command"
|
| 667 |
-
]
|
| 668 |
-
},
|
| 669 |
-
{
|
| 670 |
-
"cell_type": "code",
|
| 671 |
-
"execution_count": 62,
|
| 672 |
-
"id": "77eb1df7-7640-43cb-a14b-1559611de854",
|
| 673 |
-
"metadata": {},
|
| 674 |
-
"outputs": [],
|
| 675 |
-
"source": [
|
| 676 |
-
"example = 'Delete antigravity birds'"
|
| 677 |
-
]
|
| 678 |
-
},
|
| 679 |
-
{
|
| 680 |
-
"cell_type": "code",
|
| 681 |
-
"execution_count": 63,
|
| 682 |
-
"id": "7018cf77-fbbc-471d-98ea-e550b2a59259",
|
| 683 |
-
"metadata": {},
|
| 684 |
-
"outputs": [
|
| 685 |
-
{
|
| 686 |
-
"data": {
|
| 687 |
-
"text/plain": [
|
| 688 |
-
"False"
|
| 689 |
-
]
|
| 690 |
-
},
|
| 691 |
-
"execution_count": 63,
|
| 692 |
-
"metadata": {},
|
| 693 |
-
"output_type": "execute_result"
|
| 694 |
-
}
|
| 695 |
-
],
|
| 696 |
-
"source": [
|
| 697 |
-
"example in bird.train"
|
| 698 |
-
]
|
| 699 |
-
},
|
| 700 |
-
{
|
| 701 |
-
"cell_type": "code",
|
| 702 |
-
"execution_count": null,
|
| 703 |
-
"id": "561ae08b-ccca-4dac-8154-bcd2f35babd6",
|
| 704 |
-
"metadata": {},
|
| 705 |
-
"outputs": [],
|
| 706 |
-
"source": []
|
| 707 |
-
}
|
| 708 |
-
],
|
| 709 |
-
"metadata": {
|
| 710 |
-
"kernelspec": {
|
| 711 |
-
"display_name": "Python 3 (ipykernel)",
|
| 712 |
-
"language": "python",
|
| 713 |
-
"name": "python3"
|
| 714 |
-
},
|
| 715 |
-
"language_info": {
|
| 716 |
-
"codemirror_mode": {
|
| 717 |
-
"name": "ipython",
|
| 718 |
-
"version": 3
|
| 719 |
-
},
|
| 720 |
-
"file_extension": ".py",
|
| 721 |
-
"mimetype": "text/x-python",
|
| 722 |
-
"name": "python",
|
| 723 |
-
"nbconvert_exporter": "python",
|
| 724 |
-
"pygments_lexer": "ipython3",
|
| 725 |
-
"version": "3.11.4"
|
| 726 |
-
}
|
| 727 |
-
},
|
| 728 |
-
"nbformat": 4,
|
| 729 |
-
"nbformat_minor": 5
|
| 730 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
games/angrybirds/notebooks/test-json.ipynb
DELETED
|
@@ -1,1158 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "code",
|
| 5 |
-
"execution_count": 1,
|
| 6 |
-
"id": "245fbc34-352d-4945-a689-d04f9365bb99",
|
| 7 |
-
"metadata": {},
|
| 8 |
-
"outputs": [],
|
| 9 |
-
"source": [
|
| 10 |
-
"%load_ext autoreload\n",
|
| 11 |
-
"%autoreload 2"
|
| 12 |
-
]
|
| 13 |
-
},
|
| 14 |
-
{
|
| 15 |
-
"cell_type": "code",
|
| 16 |
-
"execution_count": 2,
|
| 17 |
-
"id": "eaed216c-160a-4e31-96fe-015c140ff18b",
|
| 18 |
-
"metadata": {},
|
| 19 |
-
"outputs": [],
|
| 20 |
-
"source": [
|
| 21 |
-
"# from pprint import pprint"
|
| 22 |
-
]
|
| 23 |
-
},
|
| 24 |
-
{
|
| 25 |
-
"cell_type": "code",
|
| 26 |
-
"execution_count": 3,
|
| 27 |
-
"id": "97953551-8ef1-42c1-9317-99d5e65f535e",
|
| 28 |
-
"metadata": {},
|
| 29 |
-
"outputs": [
|
| 30 |
-
{
|
| 31 |
-
"name": "stdout",
|
| 32 |
-
"output_type": "stream",
|
| 33 |
-
"text": [
|
| 34 |
-
"before add_config\n",
|
| 35 |
-
"723\n",
|
| 36 |
-
"724\n",
|
| 37 |
-
"725\n",
|
| 38 |
-
"726\n",
|
| 39 |
-
"after add_config\n",
|
| 40 |
-
"726\n",
|
| 41 |
-
"final\n",
|
| 42 |
-
"773\n"
|
| 43 |
-
]
|
| 44 |
-
}
|
| 45 |
-
],
|
| 46 |
-
"source": [
|
| 47 |
-
"import json\n",
|
| 48 |
-
"import pandas as pd\n",
|
| 49 |
-
"import pickle\n",
|
| 50 |
-
"\n",
|
| 51 |
-
"import openai\n",
|
| 52 |
-
"from openai.embeddings_utils import get_embedding, cosine_similarity\n",
|
| 53 |
-
"\n",
|
| 54 |
-
"# from games.angrybirds.util import util\n",
|
| 55 |
-
"from games.angrybirds.config import config\n",
|
| 56 |
-
"# from games.angrybirds.prompt import prompt\n",
|
| 57 |
-
"# from games.angrybirds.query import query, yes_no_query\n",
|
| 58 |
-
"from games.angrybirds.angrybirds import angrybird"
|
| 59 |
-
]
|
| 60 |
-
},
|
| 61 |
-
{
|
| 62 |
-
"cell_type": "code",
|
| 63 |
-
"execution_count": null,
|
| 64 |
-
"id": "d536db48-2ddf-476c-8e54-21263ccc1dde",
|
| 65 |
-
"metadata": {},
|
| 66 |
-
"outputs": [],
|
| 67 |
-
"source": []
|
| 68 |
-
},
|
| 69 |
-
{
|
| 70 |
-
"cell_type": "code",
|
| 71 |
-
"execution_count": 4,
|
| 72 |
-
"id": "43318d58-8b5e-4544-89d2-81273ce39d82",
|
| 73 |
-
"metadata": {},
|
| 74 |
-
"outputs": [],
|
| 75 |
-
"source": [
|
| 76 |
-
"import os"
|
| 77 |
-
]
|
| 78 |
-
},
|
| 79 |
-
{
|
| 80 |
-
"cell_type": "code",
|
| 81 |
-
"execution_count": 7,
|
| 82 |
-
"id": "3f537173-a3c5-4f6d-8793-2904a20e46bd",
|
| 83 |
-
"metadata": {},
|
| 84 |
-
"outputs": [
|
| 85 |
-
{
|
| 86 |
-
"data": {
|
| 87 |
-
"text/plain": [
|
| 88 |
-
"'/Users/shaojun/playgo/abc123'"
|
| 89 |
-
]
|
| 90 |
-
},
|
| 91 |
-
"execution_count": 7,
|
| 92 |
-
"metadata": {},
|
| 93 |
-
"output_type": "execute_result"
|
| 94 |
-
}
|
| 95 |
-
],
|
| 96 |
-
"source": [
|
| 97 |
-
"root = os.getenv('PYTHONPATH')\n",
|
| 98 |
-
"root"
|
| 99 |
-
]
|
| 100 |
-
},
|
| 101 |
-
{
|
| 102 |
-
"cell_type": "code",
|
| 103 |
-
"execution_count": 10,
|
| 104 |
-
"id": "d0a0a794-c6e8-48f7-859e-af9cc98c4806",
|
| 105 |
-
"metadata": {},
|
| 106 |
-
"outputs": [],
|
| 107 |
-
"source": [
|
| 108 |
-
"with open(f'{root}/embeddings.pkl', 'rb') as f:\n",
|
| 109 |
-
" x = pickle.load(f)"
|
| 110 |
-
]
|
| 111 |
-
},
|
| 112 |
-
{
|
| 113 |
-
"cell_type": "code",
|
| 114 |
-
"execution_count": 13,
|
| 115 |
-
"id": "885b8328-0812-419a-915a-aa952030aa54",
|
| 116 |
-
"metadata": {},
|
| 117 |
-
"outputs": [],
|
| 118 |
-
"source": [
|
| 119 |
-
"keys = [s for s in x.keys()]"
|
| 120 |
-
]
|
| 121 |
-
},
|
| 122 |
-
{
|
| 123 |
-
"cell_type": "code",
|
| 124 |
-
"execution_count": 15,
|
| 125 |
-
"id": "641d8409-8551-414a-abfa-d74292dfea76",
|
| 126 |
-
"metadata": {},
|
| 127 |
-
"outputs": [
|
| 128 |
-
{
|
| 129 |
-
"data": {
|
| 130 |
-
"text/plain": [
|
| 131 |
-
"772"
|
| 132 |
-
]
|
| 133 |
-
},
|
| 134 |
-
"execution_count": 15,
|
| 135 |
-
"metadata": {},
|
| 136 |
-
"output_type": "execute_result"
|
| 137 |
-
}
|
| 138 |
-
],
|
| 139 |
-
"source": [
|
| 140 |
-
"len(keys)"
|
| 141 |
-
]
|
| 142 |
-
},
|
| 143 |
-
{
|
| 144 |
-
"cell_type": "code",
|
| 145 |
-
"execution_count": 16,
|
| 146 |
-
"id": "8edc26d9-d423-4108-9f17-8f732cec9acf",
|
| 147 |
-
"metadata": {},
|
| 148 |
-
"outputs": [
|
| 149 |
-
{
|
| 150 |
-
"data": {
|
| 151 |
-
"text/plain": [
|
| 152 |
-
"773"
|
| 153 |
-
]
|
| 154 |
-
},
|
| 155 |
-
"execution_count": 16,
|
| 156 |
-
"metadata": {},
|
| 157 |
-
"output_type": "execute_result"
|
| 158 |
-
}
|
| 159 |
-
],
|
| 160 |
-
"source": [
|
| 161 |
-
"len(config.game_train)"
|
| 162 |
-
]
|
| 163 |
-
},
|
| 164 |
-
{
|
| 165 |
-
"cell_type": "code",
|
| 166 |
-
"execution_count": 18,
|
| 167 |
-
"id": "3665cd61-1e92-467e-86c4-bed67bfd8d27",
|
| 168 |
-
"metadata": {},
|
| 169 |
-
"outputs": [
|
| 170 |
-
{
|
| 171 |
-
"name": "stdout",
|
| 172 |
-
"output_type": "stream",
|
| 173 |
-
"text": [
|
| 174 |
-
"Change background photo\n"
|
| 175 |
-
]
|
| 176 |
-
}
|
| 177 |
-
],
|
| 178 |
-
"source": [
|
| 179 |
-
"for x in config.game_train:\n",
|
| 180 |
-
" if x.lower() not in keys:\n",
|
| 181 |
-
" print(x)"
|
| 182 |
-
]
|
| 183 |
-
},
|
| 184 |
-
{
|
| 185 |
-
"cell_type": "code",
|
| 186 |
-
"execution_count": 20,
|
| 187 |
-
"id": "51fa6e2f-685c-494f-b269-b9a3ba7c4590",
|
| 188 |
-
"metadata": {},
|
| 189 |
-
"outputs": [
|
| 190 |
-
{
|
| 191 |
-
"data": {
|
| 192 |
-
"text/plain": [
|
| 193 |
-
"['add 10 antigravity birds',\n",
|
| 194 |
-
" 'add 10 big birds',\n",
|
| 195 |
-
" 'add 10 birds',\n",
|
| 196 |
-
" 'add 10 catapult birds',\n",
|
| 197 |
-
" 'add 10 elderly pigs',\n",
|
| 198 |
-
" 'add 10 flash birds',\n",
|
| 199 |
-
" 'add 10 magnet birds',\n",
|
| 200 |
-
" 'add 10 pigs',\n",
|
| 201 |
-
" 'add 10 sport pigs',\n",
|
| 202 |
-
" 'add 10 superheavy birds',\n",
|
| 203 |
-
" 'add 2 antigravity birds',\n",
|
| 204 |
-
" 'add 2 big birds',\n",
|
| 205 |
-
" 'add 2 birds',\n",
|
| 206 |
-
" 'add 2 catapult birds',\n",
|
| 207 |
-
" 'add 2 elderly pigs',\n",
|
| 208 |
-
" 'add 2 flash birds',\n",
|
| 209 |
-
" 'add 2 magnet birds',\n",
|
| 210 |
-
" 'add 2 pigs',\n",
|
| 211 |
-
" 'add 2 sport pigs',\n",
|
| 212 |
-
" 'add 2 superheavy birds',\n",
|
| 213 |
-
" 'add 3 antigravity birds',\n",
|
| 214 |
-
" 'add 3 big birds',\n",
|
| 215 |
-
" 'add 3 birds',\n",
|
| 216 |
-
" 'add 3 catapult birds',\n",
|
| 217 |
-
" 'add 3 elderly pigs',\n",
|
| 218 |
-
" 'add 3 flash birds',\n",
|
| 219 |
-
" 'add 3 magnet birds',\n",
|
| 220 |
-
" 'add 3 pigs',\n",
|
| 221 |
-
" 'add 3 sport pigs',\n",
|
| 222 |
-
" 'add 3 superheavy birds',\n",
|
| 223 |
-
" 'add 4 antigravity birds',\n",
|
| 224 |
-
" 'add 4 big birds',\n",
|
| 225 |
-
" 'add 4 birds',\n",
|
| 226 |
-
" 'add 4 catapult birds',\n",
|
| 227 |
-
" 'add 4 elderly pigs',\n",
|
| 228 |
-
" 'add 4 flash birds',\n",
|
| 229 |
-
" 'add 4 magnet birds',\n",
|
| 230 |
-
" 'add 4 pigs',\n",
|
| 231 |
-
" 'add 4 sport pigs',\n",
|
| 232 |
-
" 'add 4 superheavy birds',\n",
|
| 233 |
-
" 'add 5 antigravity birds',\n",
|
| 234 |
-
" 'add 5 big birds',\n",
|
| 235 |
-
" 'add 5 birds',\n",
|
| 236 |
-
" 'add 5 catapult birds',\n",
|
| 237 |
-
" 'add 5 elderly pigs',\n",
|
| 238 |
-
" 'add 5 flash birds',\n",
|
| 239 |
-
" 'add 5 magnet birds',\n",
|
| 240 |
-
" 'add 5 pigs',\n",
|
| 241 |
-
" 'add 5 sport pigs',\n",
|
| 242 |
-
" 'add 5 superheavy birds',\n",
|
| 243 |
-
" 'add 6 antigravity birds',\n",
|
| 244 |
-
" 'add 6 big birds',\n",
|
| 245 |
-
" 'add 6 birds',\n",
|
| 246 |
-
" 'add 6 catapult birds',\n",
|
| 247 |
-
" 'add 6 elderly pigs',\n",
|
| 248 |
-
" 'add 6 flash birds',\n",
|
| 249 |
-
" 'add 6 magnet birds',\n",
|
| 250 |
-
" 'add 6 pigs',\n",
|
| 251 |
-
" 'add 6 sport pigs',\n",
|
| 252 |
-
" 'add 6 superheavy birds',\n",
|
| 253 |
-
" 'add 7 antigravity birds',\n",
|
| 254 |
-
" 'add 7 big birds',\n",
|
| 255 |
-
" 'add 7 birds',\n",
|
| 256 |
-
" 'add 7 catapult birds',\n",
|
| 257 |
-
" 'add 7 elderly pigs',\n",
|
| 258 |
-
" 'add 7 flash birds',\n",
|
| 259 |
-
" 'add 7 magnet birds',\n",
|
| 260 |
-
" 'add 7 pigs',\n",
|
| 261 |
-
" 'add 7 sport pigs',\n",
|
| 262 |
-
" 'add 7 superheavy birds',\n",
|
| 263 |
-
" 'add 8 antigravity birds',\n",
|
| 264 |
-
" 'add 8 big birds',\n",
|
| 265 |
-
" 'add 8 birds',\n",
|
| 266 |
-
" 'add 8 catapult birds',\n",
|
| 267 |
-
" 'add 8 elderly pigs',\n",
|
| 268 |
-
" 'add 8 flash birds',\n",
|
| 269 |
-
" 'add 8 magnet birds',\n",
|
| 270 |
-
" 'add 8 pigs',\n",
|
| 271 |
-
" 'add 8 sport pigs',\n",
|
| 272 |
-
" 'add 8 superheavy birds',\n",
|
| 273 |
-
" 'add 9 antigravity birds',\n",
|
| 274 |
-
" 'add 9 big birds',\n",
|
| 275 |
-
" 'add 9 birds',\n",
|
| 276 |
-
" 'add 9 catapult birds',\n",
|
| 277 |
-
" 'add 9 elderly pigs',\n",
|
| 278 |
-
" 'add 9 flash birds',\n",
|
| 279 |
-
" 'add 9 magnet birds',\n",
|
| 280 |
-
" 'add 9 pigs',\n",
|
| 281 |
-
" 'add 9 sport pigs',\n",
|
| 282 |
-
" 'add 9 superheavy birds',\n",
|
| 283 |
-
" 'add a big bird',\n",
|
| 284 |
-
" 'add a bird',\n",
|
| 285 |
-
" 'add a catapult bird',\n",
|
| 286 |
-
" 'add a flash bird',\n",
|
| 287 |
-
" 'add a magnet bird',\n",
|
| 288 |
-
" 'add a pig',\n",
|
| 289 |
-
" 'add a sport pig',\n",
|
| 290 |
-
" 'add a superheavy bird',\n",
|
| 291 |
-
" 'add all antigravity birds',\n",
|
| 292 |
-
" 'add all big birds',\n",
|
| 293 |
-
" 'add all birds',\n",
|
| 294 |
-
" 'add all catapult birds',\n",
|
| 295 |
-
" 'add all elderly pigs',\n",
|
| 296 |
-
" 'add all flash birds',\n",
|
| 297 |
-
" 'add all magnet birds',\n",
|
| 298 |
-
" 'add all pigs',\n",
|
| 299 |
-
" 'add all sport pigs',\n",
|
| 300 |
-
" 'add all superheavy birds',\n",
|
| 301 |
-
" 'add an antigravity bird',\n",
|
| 302 |
-
" 'add an elderly pig',\n",
|
| 303 |
-
" 'add antigravity birds',\n",
|
| 304 |
-
" 'add big birds',\n",
|
| 305 |
-
" 'add birds',\n",
|
| 306 |
-
" 'add catapult birds',\n",
|
| 307 |
-
" 'add eight antigravity birds',\n",
|
| 308 |
-
" 'add eight big birds',\n",
|
| 309 |
-
" 'add eight birds',\n",
|
| 310 |
-
" 'add eight catapult birds',\n",
|
| 311 |
-
" 'add eight elderly pigs',\n",
|
| 312 |
-
" 'add eight flash birds',\n",
|
| 313 |
-
" 'add eight magnet birds',\n",
|
| 314 |
-
" 'add eight pigs',\n",
|
| 315 |
-
" 'add eight sport pigs',\n",
|
| 316 |
-
" 'add eight superheavy birds',\n",
|
| 317 |
-
" 'add elderly pigs',\n",
|
| 318 |
-
" 'add five antigravity birds',\n",
|
| 319 |
-
" 'add five big birds',\n",
|
| 320 |
-
" 'add five birds',\n",
|
| 321 |
-
" 'add five catapult birds',\n",
|
| 322 |
-
" 'add five elderly pigs',\n",
|
| 323 |
-
" 'add five flash birds',\n",
|
| 324 |
-
" 'add five magnet birds',\n",
|
| 325 |
-
" 'add five pigs',\n",
|
| 326 |
-
" 'add five sport pigs',\n",
|
| 327 |
-
" 'add five superheavy birds',\n",
|
| 328 |
-
" 'add flash birds',\n",
|
| 329 |
-
" 'add four antigravity birds',\n",
|
| 330 |
-
" 'add four big birds',\n",
|
| 331 |
-
" 'add four birds',\n",
|
| 332 |
-
" 'add four catapult birds',\n",
|
| 333 |
-
" 'add four elderly pigs',\n",
|
| 334 |
-
" 'add four flash birds',\n",
|
| 335 |
-
" 'add four magnet birds',\n",
|
| 336 |
-
" 'add four pigs',\n",
|
| 337 |
-
" 'add four sport pigs',\n",
|
| 338 |
-
" 'add four superheavy birds',\n",
|
| 339 |
-
" 'add magnet birds',\n",
|
| 340 |
-
" 'add more antigravity birds',\n",
|
| 341 |
-
" 'add more big birds',\n",
|
| 342 |
-
" 'add more birds',\n",
|
| 343 |
-
" 'add more catapult birds',\n",
|
| 344 |
-
" 'add more elderly pigs',\n",
|
| 345 |
-
" 'add more flash birds',\n",
|
| 346 |
-
" 'add more magnet birds',\n",
|
| 347 |
-
" 'add more pigs',\n",
|
| 348 |
-
" 'add more sport pigs',\n",
|
| 349 |
-
" 'add more superheavy birds',\n",
|
| 350 |
-
" 'add nine antigravity birds',\n",
|
| 351 |
-
" 'add nine big birds',\n",
|
| 352 |
-
" 'add nine birds',\n",
|
| 353 |
-
" 'add nine catapult birds',\n",
|
| 354 |
-
" 'add nine elderly pigs',\n",
|
| 355 |
-
" 'add nine flash birds',\n",
|
| 356 |
-
" 'add nine magnet birds',\n",
|
| 357 |
-
" 'add nine pigs',\n",
|
| 358 |
-
" 'add nine sport pigs',\n",
|
| 359 |
-
" 'add nine superheavy birds',\n",
|
| 360 |
-
" 'add one antigravity bird',\n",
|
| 361 |
-
" 'add one big bird',\n",
|
| 362 |
-
" 'add one bird',\n",
|
| 363 |
-
" 'add one catapult bird',\n",
|
| 364 |
-
" 'add one elderly pig',\n",
|
| 365 |
-
" 'add one flash bird',\n",
|
| 366 |
-
" 'add one magnet bird',\n",
|
| 367 |
-
" 'add one pig',\n",
|
| 368 |
-
" 'add one sport pig',\n",
|
| 369 |
-
" 'add one superheavy bird',\n",
|
| 370 |
-
" 'add pigs',\n",
|
| 371 |
-
" 'add seven antigravity birds',\n",
|
| 372 |
-
" 'add seven big birds',\n",
|
| 373 |
-
" 'add seven birds',\n",
|
| 374 |
-
" 'add seven catapult birds',\n",
|
| 375 |
-
" 'add seven elderly pigs',\n",
|
| 376 |
-
" 'add seven flash birds',\n",
|
| 377 |
-
" 'add seven magnet birds',\n",
|
| 378 |
-
" 'add seven pigs',\n",
|
| 379 |
-
" 'add seven sport pigs',\n",
|
| 380 |
-
" 'add seven superheavy birds',\n",
|
| 381 |
-
" 'add six antigravity birds',\n",
|
| 382 |
-
" 'add six big birds',\n",
|
| 383 |
-
" 'add six birds',\n",
|
| 384 |
-
" 'add six catapult birds',\n",
|
| 385 |
-
" 'add six elderly pigs',\n",
|
| 386 |
-
" 'add six flash birds',\n",
|
| 387 |
-
" 'add six magnet birds',\n",
|
| 388 |
-
" 'add six pigs',\n",
|
| 389 |
-
" 'add six sport pigs',\n",
|
| 390 |
-
" 'add six superheavy birds',\n",
|
| 391 |
-
" 'add some antigravity birds',\n",
|
| 392 |
-
" 'add some big birds',\n",
|
| 393 |
-
" 'add some birds',\n",
|
| 394 |
-
" 'add some catapult birds',\n",
|
| 395 |
-
" 'add some elderly pigs',\n",
|
| 396 |
-
" 'add some flash birds',\n",
|
| 397 |
-
" 'add some magnet birds',\n",
|
| 398 |
-
" 'add some pigs',\n",
|
| 399 |
-
" 'add some sport pigs',\n",
|
| 400 |
-
" 'add some superheavy birds',\n",
|
| 401 |
-
" 'add sport pigs',\n",
|
| 402 |
-
" 'add superheavy birds',\n",
|
| 403 |
-
" 'add ten antigravity birds',\n",
|
| 404 |
-
" 'add ten big birds',\n",
|
| 405 |
-
" 'add ten birds',\n",
|
| 406 |
-
" 'add ten catapult birds',\n",
|
| 407 |
-
" 'add ten elderly pigs',\n",
|
| 408 |
-
" 'add ten flash birds',\n",
|
| 409 |
-
" 'add ten magnet birds',\n",
|
| 410 |
-
" 'add ten pigs',\n",
|
| 411 |
-
" 'add ten sport pigs',\n",
|
| 412 |
-
" 'add ten superheavy birds',\n",
|
| 413 |
-
" 'add three antigravity birds',\n",
|
| 414 |
-
" 'add three big birds',\n",
|
| 415 |
-
" 'add three birds',\n",
|
| 416 |
-
" 'add three catapult birds',\n",
|
| 417 |
-
" 'add three elderly pigs',\n",
|
| 418 |
-
" 'add three flash birds',\n",
|
| 419 |
-
" 'add three magnet birds',\n",
|
| 420 |
-
" 'add three pigs',\n",
|
| 421 |
-
" 'add three sport pigs',\n",
|
| 422 |
-
" 'add three superheavy birds',\n",
|
| 423 |
-
" 'add two antigravity birds',\n",
|
| 424 |
-
" 'add two big birds',\n",
|
| 425 |
-
" 'add two birds',\n",
|
| 426 |
-
" 'add two catapult birds',\n",
|
| 427 |
-
" 'add two elderly pigs',\n",
|
| 428 |
-
" 'add two flash birds',\n",
|
| 429 |
-
" 'add two magnet birds',\n",
|
| 430 |
-
" 'add two pigs',\n",
|
| 431 |
-
" 'add two sport pigs',\n",
|
| 432 |
-
" 'add two superheavy birds',\n",
|
| 433 |
-
" 'are there new kinds of birds?',\n",
|
| 434 |
-
" 'are there new kinds of pigs?',\n",
|
| 435 |
-
" 'bird list',\n",
|
| 436 |
-
" 'bird picture',\n",
|
| 437 |
-
" 'build a house',\n",
|
| 438 |
-
" 'build houses',\n",
|
| 439 |
-
" 'build houses, so i can protect my pigs',\n",
|
| 440 |
-
" 'change background',\n",
|
| 441 |
-
" 'change background color',\n",
|
| 442 |
-
" 'change background music',\n",
|
| 443 |
-
" 'change background picture',\n",
|
| 444 |
-
" 'change background sound',\n",
|
| 445 |
-
" 'change background text',\n",
|
| 446 |
-
" 'change background volumn',\n",
|
| 447 |
-
" \"change bird's picture\",\n",
|
| 448 |
-
" \"change bird's skin\",\n",
|
| 449 |
-
" 'change birds',\n",
|
| 450 |
-
" \"change pig's picture\",\n",
|
| 451 |
-
" \"change pig's skin\",\n",
|
| 452 |
-
" 'change pigs',\n",
|
| 453 |
-
" 'change the position of birds',\n",
|
| 454 |
-
" 'change the position of houses',\n",
|
| 455 |
-
" 'change the position of obstacles',\n",
|
| 456 |
-
" 'change the position of pigs',\n",
|
| 457 |
-
" 'change volumn',\n",
|
| 458 |
-
" 'delete 10 antigravity birds',\n",
|
| 459 |
-
" 'delete 10 big birds',\n",
|
| 460 |
-
" 'delete 10 birds',\n",
|
| 461 |
-
" 'delete 10 catapult birds',\n",
|
| 462 |
-
" 'delete 10 elderly pigs',\n",
|
| 463 |
-
" 'delete 10 flash birds',\n",
|
| 464 |
-
" 'delete 10 magnet birds',\n",
|
| 465 |
-
" 'delete 10 pigs',\n",
|
| 466 |
-
" 'delete 10 sport pigs',\n",
|
| 467 |
-
" 'delete 10 superheavy birds',\n",
|
| 468 |
-
" 'delete 2 antigravity birds',\n",
|
| 469 |
-
" 'delete 2 big birds',\n",
|
| 470 |
-
" 'delete 2 birds',\n",
|
| 471 |
-
" 'delete 2 catapult birds',\n",
|
| 472 |
-
" 'delete 2 elderly pigs',\n",
|
| 473 |
-
" 'delete 2 flash birds',\n",
|
| 474 |
-
" 'delete 2 magnet birds',\n",
|
| 475 |
-
" 'delete 2 pigs',\n",
|
| 476 |
-
" 'delete 2 sport pigs',\n",
|
| 477 |
-
" 'delete 2 superheavy birds',\n",
|
| 478 |
-
" 'delete 3 antigravity birds',\n",
|
| 479 |
-
" 'delete 3 big birds',\n",
|
| 480 |
-
" 'delete 3 birds',\n",
|
| 481 |
-
" 'delete 3 catapult birds',\n",
|
| 482 |
-
" 'delete 3 elderly pigs',\n",
|
| 483 |
-
" 'delete 3 flash birds',\n",
|
| 484 |
-
" 'delete 3 magnet birds',\n",
|
| 485 |
-
" 'delete 3 pigs',\n",
|
| 486 |
-
" 'delete 3 sport pigs',\n",
|
| 487 |
-
" 'delete 3 superheavy birds',\n",
|
| 488 |
-
" 'delete 4 antigravity birds',\n",
|
| 489 |
-
" 'delete 4 big birds',\n",
|
| 490 |
-
" 'delete 4 birds',\n",
|
| 491 |
-
" 'delete 4 catapult birds',\n",
|
| 492 |
-
" 'delete 4 elderly pigs',\n",
|
| 493 |
-
" 'delete 4 flash birds',\n",
|
| 494 |
-
" 'delete 4 magnet birds',\n",
|
| 495 |
-
" 'delete 4 pigs',\n",
|
| 496 |
-
" 'delete 4 sport pigs',\n",
|
| 497 |
-
" 'delete 4 superheavy birds',\n",
|
| 498 |
-
" 'delete 5 antigravity birds',\n",
|
| 499 |
-
" 'delete 5 big birds',\n",
|
| 500 |
-
" 'delete 5 birds',\n",
|
| 501 |
-
" 'delete 5 catapult birds',\n",
|
| 502 |
-
" 'delete 5 elderly pigs',\n",
|
| 503 |
-
" 'delete 5 flash birds',\n",
|
| 504 |
-
" 'delete 5 magnet birds',\n",
|
| 505 |
-
" 'delete 5 pigs',\n",
|
| 506 |
-
" 'delete 5 sport pigs',\n",
|
| 507 |
-
" 'delete 5 superheavy birds',\n",
|
| 508 |
-
" 'delete 6 antigravity birds',\n",
|
| 509 |
-
" 'delete 6 big birds',\n",
|
| 510 |
-
" 'delete 6 birds',\n",
|
| 511 |
-
" 'delete 6 catapult birds',\n",
|
| 512 |
-
" 'delete 6 elderly pigs',\n",
|
| 513 |
-
" 'delete 6 flash birds',\n",
|
| 514 |
-
" 'delete 6 magnet birds',\n",
|
| 515 |
-
" 'delete 6 pigs',\n",
|
| 516 |
-
" 'delete 6 sport pigs',\n",
|
| 517 |
-
" 'delete 6 superheavy birds',\n",
|
| 518 |
-
" 'delete 7 antigravity birds',\n",
|
| 519 |
-
" 'delete 7 big birds',\n",
|
| 520 |
-
" 'delete 7 birds',\n",
|
| 521 |
-
" 'delete 7 catapult birds',\n",
|
| 522 |
-
" 'delete 7 elderly pigs',\n",
|
| 523 |
-
" 'delete 7 flash birds',\n",
|
| 524 |
-
" 'delete 7 magnet birds',\n",
|
| 525 |
-
" 'delete 7 pigs',\n",
|
| 526 |
-
" 'delete 7 sport pigs',\n",
|
| 527 |
-
" 'delete 7 superheavy birds',\n",
|
| 528 |
-
" 'delete 8 antigravity birds',\n",
|
| 529 |
-
" 'delete 8 big birds',\n",
|
| 530 |
-
" 'delete 8 birds',\n",
|
| 531 |
-
" 'delete 8 catapult birds',\n",
|
| 532 |
-
" 'delete 8 elderly pigs',\n",
|
| 533 |
-
" 'delete 8 flash birds',\n",
|
| 534 |
-
" 'delete 8 magnet birds',\n",
|
| 535 |
-
" 'delete 8 pigs',\n",
|
| 536 |
-
" 'delete 8 sport pigs',\n",
|
| 537 |
-
" 'delete 8 superheavy birds',\n",
|
| 538 |
-
" 'delete 9 antigravity birds',\n",
|
| 539 |
-
" 'delete 9 big birds',\n",
|
| 540 |
-
" 'delete 9 birds',\n",
|
| 541 |
-
" 'delete 9 catapult birds',\n",
|
| 542 |
-
" 'delete 9 elderly pigs',\n",
|
| 543 |
-
" 'delete 9 flash birds',\n",
|
| 544 |
-
" 'delete 9 magnet birds',\n",
|
| 545 |
-
" 'delete 9 pigs',\n",
|
| 546 |
-
" 'delete 9 sport pigs',\n",
|
| 547 |
-
" 'delete 9 superheavy birds',\n",
|
| 548 |
-
" 'delete a big bird',\n",
|
| 549 |
-
" 'delete a bird',\n",
|
| 550 |
-
" 'delete a catapult bird',\n",
|
| 551 |
-
" 'delete a flash bird',\n",
|
| 552 |
-
" 'delete a magnet bird',\n",
|
| 553 |
-
" 'delete a pig',\n",
|
| 554 |
-
" 'delete a sport pig',\n",
|
| 555 |
-
" 'delete a superheavy bird',\n",
|
| 556 |
-
" 'delete all antigravity birds',\n",
|
| 557 |
-
" 'delete all big birds',\n",
|
| 558 |
-
" 'delete all birds',\n",
|
| 559 |
-
" 'delete all catapult birds',\n",
|
| 560 |
-
" 'delete all elderly pigs',\n",
|
| 561 |
-
" 'delete all flash birds',\n",
|
| 562 |
-
" 'delete all magnet birds',\n",
|
| 563 |
-
" 'delete all pigs',\n",
|
| 564 |
-
" 'delete all sport pigs',\n",
|
| 565 |
-
" 'delete all superheavy birds',\n",
|
| 566 |
-
" 'delete an antigravity bird',\n",
|
| 567 |
-
" 'delete an elderly pig',\n",
|
| 568 |
-
" 'delete antigravity birds',\n",
|
| 569 |
-
" 'delete big birds',\n",
|
| 570 |
-
" 'delete birds',\n",
|
| 571 |
-
" 'delete catapult birds',\n",
|
| 572 |
-
" 'delete eight antigravity birds',\n",
|
| 573 |
-
" 'delete eight big birds',\n",
|
| 574 |
-
" 'delete eight birds',\n",
|
| 575 |
-
" 'delete eight catapult birds',\n",
|
| 576 |
-
" 'delete eight elderly pigs',\n",
|
| 577 |
-
" 'delete eight flash birds',\n",
|
| 578 |
-
" 'delete eight magnet birds',\n",
|
| 579 |
-
" 'delete eight pigs',\n",
|
| 580 |
-
" 'delete eight sport pigs',\n",
|
| 581 |
-
" 'delete eight superheavy birds',\n",
|
| 582 |
-
" 'delete elderly pigs',\n",
|
| 583 |
-
" 'delete five antigravity birds',\n",
|
| 584 |
-
" 'delete five big birds',\n",
|
| 585 |
-
" 'delete five birds',\n",
|
| 586 |
-
" 'delete five catapult birds',\n",
|
| 587 |
-
" 'delete five elderly pigs',\n",
|
| 588 |
-
" 'delete five flash birds',\n",
|
| 589 |
-
" 'delete five magnet birds',\n",
|
| 590 |
-
" 'delete five pigs',\n",
|
| 591 |
-
" 'delete five sport pigs',\n",
|
| 592 |
-
" 'delete five superheavy birds',\n",
|
| 593 |
-
" 'delete flash birds',\n",
|
| 594 |
-
" 'delete four antigravity birds',\n",
|
| 595 |
-
" 'delete four big birds',\n",
|
| 596 |
-
" 'delete four birds',\n",
|
| 597 |
-
" 'delete four catapult birds',\n",
|
| 598 |
-
" 'delete four elderly pigs',\n",
|
| 599 |
-
" 'delete four flash birds',\n",
|
| 600 |
-
" 'delete four magnet birds',\n",
|
| 601 |
-
" 'delete four pigs',\n",
|
| 602 |
-
" 'delete four sport pigs',\n",
|
| 603 |
-
" 'delete four superheavy birds',\n",
|
| 604 |
-
" 'delete magnet birds',\n",
|
| 605 |
-
" 'delete more antigravity birds',\n",
|
| 606 |
-
" 'delete more big birds',\n",
|
| 607 |
-
" 'delete more birds',\n",
|
| 608 |
-
" 'delete more catapult birds',\n",
|
| 609 |
-
" 'delete more elderly pigs',\n",
|
| 610 |
-
" 'delete more flash birds',\n",
|
| 611 |
-
" 'delete more magnet birds',\n",
|
| 612 |
-
" 'delete more pigs',\n",
|
| 613 |
-
" 'delete more sport pigs',\n",
|
| 614 |
-
" 'delete more superheavy birds',\n",
|
| 615 |
-
" 'delete nine antigravity birds',\n",
|
| 616 |
-
" 'delete nine big birds',\n",
|
| 617 |
-
" 'delete nine birds',\n",
|
| 618 |
-
" 'delete nine catapult birds',\n",
|
| 619 |
-
" 'delete nine elderly pigs',\n",
|
| 620 |
-
" 'delete nine flash birds',\n",
|
| 621 |
-
" 'delete nine magnet birds',\n",
|
| 622 |
-
" 'delete nine pigs',\n",
|
| 623 |
-
" 'delete nine sport pigs',\n",
|
| 624 |
-
" 'delete nine superheavy birds',\n",
|
| 625 |
-
" 'delete one antigravity bird',\n",
|
| 626 |
-
" 'delete one big bird',\n",
|
| 627 |
-
" 'delete one bird',\n",
|
| 628 |
-
" 'delete one catapult bird',\n",
|
| 629 |
-
" 'delete one elderly pig',\n",
|
| 630 |
-
" 'delete one flash bird',\n",
|
| 631 |
-
" 'delete one magnet bird',\n",
|
| 632 |
-
" 'delete one pig',\n",
|
| 633 |
-
" 'delete one sport pig',\n",
|
| 634 |
-
" 'delete one superheavy bird',\n",
|
| 635 |
-
" 'delete pigs',\n",
|
| 636 |
-
" 'delete seven antigravity birds',\n",
|
| 637 |
-
" 'delete seven big birds',\n",
|
| 638 |
-
" 'delete seven birds',\n",
|
| 639 |
-
" 'delete seven catapult birds',\n",
|
| 640 |
-
" 'delete seven elderly pigs',\n",
|
| 641 |
-
" 'delete seven flash birds',\n",
|
| 642 |
-
" 'delete seven magnet birds',\n",
|
| 643 |
-
" 'delete seven pigs',\n",
|
| 644 |
-
" 'delete seven sport pigs',\n",
|
| 645 |
-
" 'delete seven superheavy birds',\n",
|
| 646 |
-
" 'delete six antigravity birds',\n",
|
| 647 |
-
" 'delete six big birds',\n",
|
| 648 |
-
" 'delete six birds',\n",
|
| 649 |
-
" 'delete six catapult birds',\n",
|
| 650 |
-
" 'delete six elderly pigs',\n",
|
| 651 |
-
" 'delete six flash birds',\n",
|
| 652 |
-
" 'delete six magnet birds',\n",
|
| 653 |
-
" 'delete six pigs',\n",
|
| 654 |
-
" 'delete six sport pigs',\n",
|
| 655 |
-
" 'delete six superheavy birds',\n",
|
| 656 |
-
" 'delete some antigravity birds',\n",
|
| 657 |
-
" 'delete some big birds',\n",
|
| 658 |
-
" 'delete some birds',\n",
|
| 659 |
-
" 'delete some catapult birds',\n",
|
| 660 |
-
" 'delete some elderly pigs',\n",
|
| 661 |
-
" 'delete some flash birds',\n",
|
| 662 |
-
" 'delete some magnet birds',\n",
|
| 663 |
-
" 'delete some pigs',\n",
|
| 664 |
-
" 'delete some sport pigs',\n",
|
| 665 |
-
" 'delete some superheavy birds',\n",
|
| 666 |
-
" 'delete sport pigs',\n",
|
| 667 |
-
" 'delete superheavy birds',\n",
|
| 668 |
-
" 'delete ten antigravity birds',\n",
|
| 669 |
-
" 'delete ten big birds',\n",
|
| 670 |
-
" 'delete ten birds',\n",
|
| 671 |
-
" 'delete ten catapult birds',\n",
|
| 672 |
-
" 'delete ten elderly pigs',\n",
|
| 673 |
-
" 'delete ten flash birds',\n",
|
| 674 |
-
" 'delete ten magnet birds',\n",
|
| 675 |
-
" 'delete ten pigs',\n",
|
| 676 |
-
" 'delete ten sport pigs',\n",
|
| 677 |
-
" 'delete ten superheavy birds',\n",
|
| 678 |
-
" 'delete three antigravity birds',\n",
|
| 679 |
-
" 'delete three big birds',\n",
|
| 680 |
-
" 'delete three birds',\n",
|
| 681 |
-
" 'delete three catapult birds',\n",
|
| 682 |
-
" 'delete three elderly pigs',\n",
|
| 683 |
-
" 'delete three flash birds',\n",
|
| 684 |
-
" 'delete three magnet birds',\n",
|
| 685 |
-
" 'delete three pigs',\n",
|
| 686 |
-
" 'delete three sport pigs',\n",
|
| 687 |
-
" 'delete three superheavy birds',\n",
|
| 688 |
-
" 'delete two antigravity birds',\n",
|
| 689 |
-
" 'delete two big birds',\n",
|
| 690 |
-
" 'delete two birds',\n",
|
| 691 |
-
" 'delete two catapult birds',\n",
|
| 692 |
-
" 'delete two elderly pigs',\n",
|
| 693 |
-
" 'delete two flash birds',\n",
|
| 694 |
-
" 'delete two magnet birds',\n",
|
| 695 |
-
" 'delete two pigs',\n",
|
| 696 |
-
" 'delete two sport pigs',\n",
|
| 697 |
-
" 'delete two superheavy birds',\n",
|
| 698 |
-
" 'list birds',\n",
|
| 699 |
-
" 'list pigs',\n",
|
| 700 |
-
" 'make pigs everywehre',\n",
|
| 701 |
-
" 'make the bird bigger',\n",
|
| 702 |
-
" 'make the bird bigger, so it can run over the enemies',\n",
|
| 703 |
-
" 'make the bird smaller',\n",
|
| 704 |
-
" 'make the pig bigger',\n",
|
| 705 |
-
" 'make the pig smaller',\n",
|
| 706 |
-
" 'make the pig weaker',\n",
|
| 707 |
-
" 'move birds',\n",
|
| 708 |
-
" 'move houses',\n",
|
| 709 |
-
" 'move obstacles',\n",
|
| 710 |
-
" 'move pigs',\n",
|
| 711 |
-
" 'our pigs are losing. add more pigs',\n",
|
| 712 |
-
" 'pig list',\n",
|
| 713 |
-
" 'pig picture',\n",
|
| 714 |
-
" 'protect the pigs by build houses for them',\n",
|
| 715 |
-
" 'reduce 10 antigravity birds',\n",
|
| 716 |
-
" 'reduce 10 big birds',\n",
|
| 717 |
-
" 'reduce 10 birds',\n",
|
| 718 |
-
" 'reduce 10 catapult birds',\n",
|
| 719 |
-
" 'reduce 10 elderly pigs',\n",
|
| 720 |
-
" 'reduce 10 flash birds',\n",
|
| 721 |
-
" 'reduce 10 magnet birds',\n",
|
| 722 |
-
" 'reduce 10 pigs',\n",
|
| 723 |
-
" 'reduce 10 sport pigs',\n",
|
| 724 |
-
" 'reduce 10 superheavy birds',\n",
|
| 725 |
-
" 'reduce 2 antigravity birds',\n",
|
| 726 |
-
" 'reduce 2 big birds',\n",
|
| 727 |
-
" 'reduce 2 birds',\n",
|
| 728 |
-
" 'reduce 2 catapult birds',\n",
|
| 729 |
-
" 'reduce 2 elderly pigs',\n",
|
| 730 |
-
" 'reduce 2 flash birds',\n",
|
| 731 |
-
" 'reduce 2 magnet birds',\n",
|
| 732 |
-
" 'reduce 2 pigs',\n",
|
| 733 |
-
" 'reduce 2 sport pigs',\n",
|
| 734 |
-
" 'reduce 2 superheavy birds',\n",
|
| 735 |
-
" 'reduce 3 antigravity birds',\n",
|
| 736 |
-
" 'reduce 3 big birds',\n",
|
| 737 |
-
" 'reduce 3 birds',\n",
|
| 738 |
-
" 'reduce 3 catapult birds',\n",
|
| 739 |
-
" 'reduce 3 elderly pigs',\n",
|
| 740 |
-
" 'reduce 3 flash birds',\n",
|
| 741 |
-
" 'reduce 3 magnet birds',\n",
|
| 742 |
-
" 'reduce 3 pigs',\n",
|
| 743 |
-
" 'reduce 3 sport pigs',\n",
|
| 744 |
-
" 'reduce 3 superheavy birds',\n",
|
| 745 |
-
" 'reduce 4 antigravity birds',\n",
|
| 746 |
-
" 'reduce 4 big birds',\n",
|
| 747 |
-
" 'reduce 4 birds',\n",
|
| 748 |
-
" 'reduce 4 catapult birds',\n",
|
| 749 |
-
" 'reduce 4 elderly pigs',\n",
|
| 750 |
-
" 'reduce 4 flash birds',\n",
|
| 751 |
-
" 'reduce 4 magnet birds',\n",
|
| 752 |
-
" 'reduce 4 pigs',\n",
|
| 753 |
-
" 'reduce 4 sport pigs',\n",
|
| 754 |
-
" 'reduce 4 superheavy birds',\n",
|
| 755 |
-
" 'reduce 5 antigravity birds',\n",
|
| 756 |
-
" 'reduce 5 big birds',\n",
|
| 757 |
-
" 'reduce 5 birds',\n",
|
| 758 |
-
" 'reduce 5 catapult birds',\n",
|
| 759 |
-
" 'reduce 5 elderly pigs',\n",
|
| 760 |
-
" 'reduce 5 flash birds',\n",
|
| 761 |
-
" 'reduce 5 magnet birds',\n",
|
| 762 |
-
" 'reduce 5 pigs',\n",
|
| 763 |
-
" 'reduce 5 sport pigs',\n",
|
| 764 |
-
" 'reduce 5 superheavy birds',\n",
|
| 765 |
-
" 'reduce 6 antigravity birds',\n",
|
| 766 |
-
" 'reduce 6 big birds',\n",
|
| 767 |
-
" 'reduce 6 birds',\n",
|
| 768 |
-
" 'reduce 6 catapult birds',\n",
|
| 769 |
-
" 'reduce 6 elderly pigs',\n",
|
| 770 |
-
" 'reduce 6 flash birds',\n",
|
| 771 |
-
" 'reduce 6 magnet birds',\n",
|
| 772 |
-
" 'reduce 6 pigs',\n",
|
| 773 |
-
" 'reduce 6 sport pigs',\n",
|
| 774 |
-
" 'reduce 6 superheavy birds',\n",
|
| 775 |
-
" 'reduce 7 antigravity birds',\n",
|
| 776 |
-
" 'reduce 7 big birds',\n",
|
| 777 |
-
" 'reduce 7 birds',\n",
|
| 778 |
-
" 'reduce 7 catapult birds',\n",
|
| 779 |
-
" 'reduce 7 elderly pigs',\n",
|
| 780 |
-
" 'reduce 7 flash birds',\n",
|
| 781 |
-
" 'reduce 7 magnet birds',\n",
|
| 782 |
-
" 'reduce 7 pigs',\n",
|
| 783 |
-
" 'reduce 7 sport pigs',\n",
|
| 784 |
-
" 'reduce 7 superheavy birds',\n",
|
| 785 |
-
" 'reduce 8 antigravity birds',\n",
|
| 786 |
-
" 'reduce 8 big birds',\n",
|
| 787 |
-
" 'reduce 8 birds',\n",
|
| 788 |
-
" 'reduce 8 catapult birds',\n",
|
| 789 |
-
" 'reduce 8 elderly pigs',\n",
|
| 790 |
-
" 'reduce 8 flash birds',\n",
|
| 791 |
-
" 'reduce 8 magnet birds',\n",
|
| 792 |
-
" 'reduce 8 pigs',\n",
|
| 793 |
-
" 'reduce 8 sport pigs',\n",
|
| 794 |
-
" 'reduce 8 superheavy birds',\n",
|
| 795 |
-
" 'reduce 9 antigravity birds',\n",
|
| 796 |
-
" 'reduce 9 big birds',\n",
|
| 797 |
-
" 'reduce 9 birds',\n",
|
| 798 |
-
" 'reduce 9 catapult birds',\n",
|
| 799 |
-
" 'reduce 9 elderly pigs',\n",
|
| 800 |
-
" 'reduce 9 flash birds',\n",
|
| 801 |
-
" 'reduce 9 magnet birds',\n",
|
| 802 |
-
" 'reduce 9 pigs',\n",
|
| 803 |
-
" 'reduce 9 sport pigs',\n",
|
| 804 |
-
" 'reduce 9 superheavy birds',\n",
|
| 805 |
-
" 'reduce a big bird',\n",
|
| 806 |
-
" 'reduce a bird',\n",
|
| 807 |
-
" 'reduce a catapult bird',\n",
|
| 808 |
-
" 'reduce a flash bird',\n",
|
| 809 |
-
" 'reduce a magnet bird',\n",
|
| 810 |
-
" 'reduce a pig',\n",
|
| 811 |
-
" 'reduce a sport pig',\n",
|
| 812 |
-
" 'reduce a superheavy bird',\n",
|
| 813 |
-
" 'reduce all antigravity birds',\n",
|
| 814 |
-
" 'reduce all big birds',\n",
|
| 815 |
-
" 'reduce all birds',\n",
|
| 816 |
-
" 'reduce all catapult birds',\n",
|
| 817 |
-
" 'reduce all elderly pigs',\n",
|
| 818 |
-
" 'reduce all flash birds',\n",
|
| 819 |
-
" 'reduce all magnet birds',\n",
|
| 820 |
-
" 'reduce all pigs',\n",
|
| 821 |
-
" 'reduce all sport pigs',\n",
|
| 822 |
-
" 'reduce all superheavy birds',\n",
|
| 823 |
-
" 'reduce an antigravity bird',\n",
|
| 824 |
-
" 'reduce an elderly pig',\n",
|
| 825 |
-
" 'reduce antigravity birds',\n",
|
| 826 |
-
" 'reduce big birds',\n",
|
| 827 |
-
" 'reduce birds',\n",
|
| 828 |
-
" 'reduce catapult birds',\n",
|
| 829 |
-
" 'reduce eight antigravity birds',\n",
|
| 830 |
-
" 'reduce eight big birds',\n",
|
| 831 |
-
" 'reduce eight birds',\n",
|
| 832 |
-
" 'reduce eight catapult birds',\n",
|
| 833 |
-
" 'reduce eight elderly pigs',\n",
|
| 834 |
-
" 'reduce eight flash birds',\n",
|
| 835 |
-
" 'reduce eight magnet birds',\n",
|
| 836 |
-
" 'reduce eight pigs',\n",
|
| 837 |
-
" 'reduce eight sport pigs',\n",
|
| 838 |
-
" 'reduce eight superheavy birds',\n",
|
| 839 |
-
" 'reduce elderly pigs',\n",
|
| 840 |
-
" 'reduce five antigravity birds',\n",
|
| 841 |
-
" 'reduce five big birds',\n",
|
| 842 |
-
" 'reduce five birds',\n",
|
| 843 |
-
" 'reduce five catapult birds',\n",
|
| 844 |
-
" 'reduce five elderly pigs',\n",
|
| 845 |
-
" 'reduce five flash birds',\n",
|
| 846 |
-
" 'reduce five magnet birds',\n",
|
| 847 |
-
" 'reduce five pigs',\n",
|
| 848 |
-
" 'reduce five sport pigs',\n",
|
| 849 |
-
" 'reduce five superheavy birds',\n",
|
| 850 |
-
" 'reduce flash birds',\n",
|
| 851 |
-
" 'reduce four antigravity birds',\n",
|
| 852 |
-
" 'reduce four big birds',\n",
|
| 853 |
-
" 'reduce four birds',\n",
|
| 854 |
-
" 'reduce four catapult birds',\n",
|
| 855 |
-
" 'reduce four elderly pigs',\n",
|
| 856 |
-
" 'reduce four flash birds',\n",
|
| 857 |
-
" 'reduce four magnet birds',\n",
|
| 858 |
-
" 'reduce four pigs',\n",
|
| 859 |
-
" 'reduce four sport pigs',\n",
|
| 860 |
-
" 'reduce four superheavy birds',\n",
|
| 861 |
-
" 'reduce magnet birds',\n",
|
| 862 |
-
" 'reduce more antigravity birds',\n",
|
| 863 |
-
" 'reduce more big birds',\n",
|
| 864 |
-
" 'reduce more birds',\n",
|
| 865 |
-
" 'reduce more catapult birds',\n",
|
| 866 |
-
" 'reduce more elderly pigs',\n",
|
| 867 |
-
" 'reduce more flash birds',\n",
|
| 868 |
-
" 'reduce more magnet birds',\n",
|
| 869 |
-
" 'reduce more pigs',\n",
|
| 870 |
-
" 'reduce more sport pigs',\n",
|
| 871 |
-
" 'reduce more superheavy birds',\n",
|
| 872 |
-
" 'reduce nine antigravity birds',\n",
|
| 873 |
-
" 'reduce nine big birds',\n",
|
| 874 |
-
" 'reduce nine birds',\n",
|
| 875 |
-
" 'reduce nine catapult birds',\n",
|
| 876 |
-
" 'reduce nine elderly pigs',\n",
|
| 877 |
-
" 'reduce nine flash birds',\n",
|
| 878 |
-
" 'reduce nine magnet birds',\n",
|
| 879 |
-
" 'reduce nine pigs',\n",
|
| 880 |
-
" 'reduce nine sport pigs',\n",
|
| 881 |
-
" 'reduce nine superheavy birds',\n",
|
| 882 |
-
" 'reduce one antigravity bird',\n",
|
| 883 |
-
" 'reduce one big bird',\n",
|
| 884 |
-
" 'reduce one bird',\n",
|
| 885 |
-
" 'reduce one catapult bird',\n",
|
| 886 |
-
" 'reduce one elderly pig',\n",
|
| 887 |
-
" 'reduce one flash bird',\n",
|
| 888 |
-
" 'reduce one magnet bird',\n",
|
| 889 |
-
" 'reduce one pig',\n",
|
| 890 |
-
" 'reduce one sport pig',\n",
|
| 891 |
-
" 'reduce one superheavy bird',\n",
|
| 892 |
-
" 'reduce pigs',\n",
|
| 893 |
-
" 'reduce seven antigravity birds',\n",
|
| 894 |
-
" 'reduce seven big birds',\n",
|
| 895 |
-
" 'reduce seven birds',\n",
|
| 896 |
-
" 'reduce seven catapult birds',\n",
|
| 897 |
-
" 'reduce seven elderly pigs',\n",
|
| 898 |
-
" 'reduce seven flash birds',\n",
|
| 899 |
-
" 'reduce seven magnet birds',\n",
|
| 900 |
-
" 'reduce seven pigs',\n",
|
| 901 |
-
" 'reduce seven sport pigs',\n",
|
| 902 |
-
" 'reduce seven superheavy birds',\n",
|
| 903 |
-
" 'reduce six antigravity birds',\n",
|
| 904 |
-
" 'reduce six big birds',\n",
|
| 905 |
-
" 'reduce six birds',\n",
|
| 906 |
-
" 'reduce six catapult birds',\n",
|
| 907 |
-
" 'reduce six elderly pigs',\n",
|
| 908 |
-
" 'reduce six flash birds',\n",
|
| 909 |
-
" 'reduce six magnet birds',\n",
|
| 910 |
-
" 'reduce six pigs',\n",
|
| 911 |
-
" 'reduce six sport pigs',\n",
|
| 912 |
-
" 'reduce six superheavy birds',\n",
|
| 913 |
-
" 'reduce some antigravity birds',\n",
|
| 914 |
-
" 'reduce some big birds',\n",
|
| 915 |
-
" 'reduce some birds',\n",
|
| 916 |
-
" 'reduce some catapult birds',\n",
|
| 917 |
-
" 'reduce some elderly pigs',\n",
|
| 918 |
-
" 'reduce some flash birds',\n",
|
| 919 |
-
" 'reduce some magnet birds',\n",
|
| 920 |
-
" 'reduce some pigs',\n",
|
| 921 |
-
" 'reduce some sport pigs',\n",
|
| 922 |
-
" 'reduce some superheavy birds',\n",
|
| 923 |
-
" 'reduce sport pigs',\n",
|
| 924 |
-
" 'reduce superheavy birds',\n",
|
| 925 |
-
" 'reduce ten antigravity birds',\n",
|
| 926 |
-
" 'reduce ten big birds',\n",
|
| 927 |
-
" 'reduce ten birds',\n",
|
| 928 |
-
" 'reduce ten catapult birds',\n",
|
| 929 |
-
" 'reduce ten elderly pigs',\n",
|
| 930 |
-
" 'reduce ten flash birds',\n",
|
| 931 |
-
" 'reduce ten magnet birds',\n",
|
| 932 |
-
" 'reduce ten pigs',\n",
|
| 933 |
-
" 'reduce ten sport pigs',\n",
|
| 934 |
-
" 'reduce ten superheavy birds',\n",
|
| 935 |
-
" 'reduce three antigravity birds',\n",
|
| 936 |
-
" 'reduce three big birds',\n",
|
| 937 |
-
" 'reduce three birds',\n",
|
| 938 |
-
" 'reduce three catapult birds',\n",
|
| 939 |
-
" 'reduce three elderly pigs',\n",
|
| 940 |
-
" 'reduce three flash birds',\n",
|
| 941 |
-
" 'reduce three magnet birds',\n",
|
| 942 |
-
" 'reduce three pigs',\n",
|
| 943 |
-
" 'reduce three sport pigs',\n",
|
| 944 |
-
" 'reduce three superheavy birds',\n",
|
| 945 |
-
" 'reduce two antigravity birds',\n",
|
| 946 |
-
" 'reduce two big birds',\n",
|
| 947 |
-
" 'reduce two birds',\n",
|
| 948 |
-
" 'reduce two catapult birds',\n",
|
| 949 |
-
" 'reduce two elderly pigs',\n",
|
| 950 |
-
" 'reduce two flash birds',\n",
|
| 951 |
-
" 'reduce two magnet birds',\n",
|
| 952 |
-
" 'reduce two pigs',\n",
|
| 953 |
-
" 'reduce two sport pigs',\n",
|
| 954 |
-
" 'reduce two superheavy birds',\n",
|
| 955 |
-
" 'show bird list',\n",
|
| 956 |
-
" 'show pig list',\n",
|
| 957 |
-
" \"the obstacles are too weak. let's build some solid houses\",\n",
|
| 958 |
-
" 'the pigs are too weak. increase the blood level for them',\n",
|
| 959 |
-
" 'the pigs are too weak. increase the blood levels for them',\n",
|
| 960 |
-
" 'the pigs are too weak. increase the health points for them',\n",
|
| 961 |
-
" 'the pigs are too weak. increase the hit points for them',\n",
|
| 962 |
-
" 'the pigs are too weak. increase the hp for them',\n",
|
| 963 |
-
" 'what kind of birds do you have?',\n",
|
| 964 |
-
" 'what kind of pigs do you have?']"
|
| 965 |
-
]
|
| 966 |
-
},
|
| 967 |
-
"execution_count": 20,
|
| 968 |
-
"metadata": {},
|
| 969 |
-
"output_type": "execute_result"
|
| 970 |
-
}
|
| 971 |
-
],
|
| 972 |
-
"source": [
|
| 973 |
-
"sorted(keys)"
|
| 974 |
-
]
|
| 975 |
-
},
|
| 976 |
-
{
|
| 977 |
-
"cell_type": "code",
|
| 978 |
-
"execution_count": null,
|
| 979 |
-
"id": "54dfec68-3956-4b92-83a2-e1ab6a9cec9c",
|
| 980 |
-
"metadata": {},
|
| 981 |
-
"outputs": [],
|
| 982 |
-
"source": []
|
| 983 |
-
},
|
| 984 |
-
{
|
| 985 |
-
"cell_type": "code",
|
| 986 |
-
"execution_count": 4,
|
| 987 |
-
"id": "29eab725-99f4-480f-9750-bf41758be527",
|
| 988 |
-
"metadata": {},
|
| 989 |
-
"outputs": [],
|
| 990 |
-
"source": [
|
| 991 |
-
"with open('../game_train.json', 'r') as f:\n",
|
| 992 |
-
" s = json.load(f)"
|
| 993 |
-
]
|
| 994 |
-
},
|
| 995 |
-
{
|
| 996 |
-
"cell_type": "code",
|
| 997 |
-
"execution_count": 5,
|
| 998 |
-
"id": "559708ec-5adf-4648-a2ef-14bc0a70fea4",
|
| 999 |
-
"metadata": {},
|
| 1000 |
-
"outputs": [
|
| 1001 |
-
{
|
| 1002 |
-
"data": {
|
| 1003 |
-
"text/plain": [
|
| 1004 |
-
"773"
|
| 1005 |
-
]
|
| 1006 |
-
},
|
| 1007 |
-
"execution_count": 5,
|
| 1008 |
-
"metadata": {},
|
| 1009 |
-
"output_type": "execute_result"
|
| 1010 |
-
}
|
| 1011 |
-
],
|
| 1012 |
-
"source": [
|
| 1013 |
-
"len(s)"
|
| 1014 |
-
]
|
| 1015 |
-
},
|
| 1016 |
-
{
|
| 1017 |
-
"cell_type": "code",
|
| 1018 |
-
"execution_count": 6,
|
| 1019 |
-
"id": "8cb63fe9-c8a0-4316-aace-92ee6477c97a",
|
| 1020 |
-
"metadata": {},
|
| 1021 |
-
"outputs": [
|
| 1022 |
-
{
|
| 1023 |
-
"data": {
|
| 1024 |
-
"text/plain": [
|
| 1025 |
-
"True"
|
| 1026 |
-
]
|
| 1027 |
-
},
|
| 1028 |
-
"execution_count": 6,
|
| 1029 |
-
"metadata": {},
|
| 1030 |
-
"output_type": "execute_result"
|
| 1031 |
-
}
|
| 1032 |
-
],
|
| 1033 |
-
"source": [
|
| 1034 |
-
"'build a house' in s"
|
| 1035 |
-
]
|
| 1036 |
-
},
|
| 1037 |
-
{
|
| 1038 |
-
"cell_type": "code",
|
| 1039 |
-
"execution_count": 7,
|
| 1040 |
-
"id": "6908bc1e-4c93-422b-b392-d9a66863c8e9",
|
| 1041 |
-
"metadata": {},
|
| 1042 |
-
"outputs": [
|
| 1043 |
-
{
|
| 1044 |
-
"data": {
|
| 1045 |
-
"text/plain": [
|
| 1046 |
-
"773"
|
| 1047 |
-
]
|
| 1048 |
-
},
|
| 1049 |
-
"execution_count": 7,
|
| 1050 |
-
"metadata": {},
|
| 1051 |
-
"output_type": "execute_result"
|
| 1052 |
-
}
|
| 1053 |
-
],
|
| 1054 |
-
"source": [
|
| 1055 |
-
"len(s)"
|
| 1056 |
-
]
|
| 1057 |
-
},
|
| 1058 |
-
{
|
| 1059 |
-
"cell_type": "code",
|
| 1060 |
-
"execution_count": 8,
|
| 1061 |
-
"id": "987ccc02-9837-4ba1-8d02-0750d9ab94ea",
|
| 1062 |
-
"metadata": {},
|
| 1063 |
-
"outputs": [
|
| 1064 |
-
{
|
| 1065 |
-
"data": {
|
| 1066 |
-
"text/plain": [
|
| 1067 |
-
"773"
|
| 1068 |
-
]
|
| 1069 |
-
},
|
| 1070 |
-
"execution_count": 8,
|
| 1071 |
-
"metadata": {},
|
| 1072 |
-
"output_type": "execute_result"
|
| 1073 |
-
}
|
| 1074 |
-
],
|
| 1075 |
-
"source": [
|
| 1076 |
-
"len([x.lower() for x in s.keys()])"
|
| 1077 |
-
]
|
| 1078 |
-
},
|
| 1079 |
-
{
|
| 1080 |
-
"cell_type": "code",
|
| 1081 |
-
"execution_count": 9,
|
| 1082 |
-
"id": "ff240004-b842-4d99-8d55-4fc936bcaf31",
|
| 1083 |
-
"metadata": {},
|
| 1084 |
-
"outputs": [
|
| 1085 |
-
{
|
| 1086 |
-
"data": {
|
| 1087 |
-
"text/plain": [
|
| 1088 |
-
"773"
|
| 1089 |
-
]
|
| 1090 |
-
},
|
| 1091 |
-
"execution_count": 9,
|
| 1092 |
-
"metadata": {},
|
| 1093 |
-
"output_type": "execute_result"
|
| 1094 |
-
}
|
| 1095 |
-
],
|
| 1096 |
-
"source": [
|
| 1097 |
-
"len(set([x.lower() for x in s.keys()]))"
|
| 1098 |
-
]
|
| 1099 |
-
},
|
| 1100 |
-
{
|
| 1101 |
-
"cell_type": "code",
|
| 1102 |
-
"execution_count": 10,
|
| 1103 |
-
"id": "fb6990af-55c5-4c56-98f5-3816571323ce",
|
| 1104 |
-
"metadata": {},
|
| 1105 |
-
"outputs": [],
|
| 1106 |
-
"source": [
|
| 1107 |
-
"from collections import Counter"
|
| 1108 |
-
]
|
| 1109 |
-
},
|
| 1110 |
-
{
|
| 1111 |
-
"cell_type": "code",
|
| 1112 |
-
"execution_count": 11,
|
| 1113 |
-
"id": "8320aace-22b5-44a2-bab3-fe81d5cb9f1e",
|
| 1114 |
-
"metadata": {},
|
| 1115 |
-
"outputs": [],
|
| 1116 |
-
"source": [
|
| 1117 |
-
"# Counter([x.lower() for x in s.keys()]).most_common()"
|
| 1118 |
-
]
|
| 1119 |
-
},
|
| 1120 |
-
{
|
| 1121 |
-
"cell_type": "code",
|
| 1122 |
-
"execution_count": null,
|
| 1123 |
-
"id": "69fec331-e930-449d-9be4-53b9aa01ea73",
|
| 1124 |
-
"metadata": {},
|
| 1125 |
-
"outputs": [],
|
| 1126 |
-
"source": []
|
| 1127 |
-
},
|
| 1128 |
-
{
|
| 1129 |
-
"cell_type": "code",
|
| 1130 |
-
"execution_count": null,
|
| 1131 |
-
"id": "56c7ba52-8828-4cf9-a363-442a5b6058f5",
|
| 1132 |
-
"metadata": {},
|
| 1133 |
-
"outputs": [],
|
| 1134 |
-
"source": []
|
| 1135 |
-
}
|
| 1136 |
-
],
|
| 1137 |
-
"metadata": {
|
| 1138 |
-
"kernelspec": {
|
| 1139 |
-
"display_name": "Python 3 (ipykernel)",
|
| 1140 |
-
"language": "python",
|
| 1141 |
-
"name": "python3"
|
| 1142 |
-
},
|
| 1143 |
-
"language_info": {
|
| 1144 |
-
"codemirror_mode": {
|
| 1145 |
-
"name": "ipython",
|
| 1146 |
-
"version": 3
|
| 1147 |
-
},
|
| 1148 |
-
"file_extension": ".py",
|
| 1149 |
-
"mimetype": "text/x-python",
|
| 1150 |
-
"name": "python",
|
| 1151 |
-
"nbconvert_exporter": "python",
|
| 1152 |
-
"pygments_lexer": "ipython3",
|
| 1153 |
-
"version": "3.11.4"
|
| 1154 |
-
}
|
| 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-4945-a689-d04f9365bb99",
|
| 7 |
-
"metadata": {},
|
| 8 |
-
"outputs": [],
|
| 9 |
-
"source": [
|
| 10 |
-
"%load_ext autoreload\n",
|
| 11 |
-
"%autoreload 2"
|
| 12 |
-
]
|
| 13 |
-
},
|
| 14 |
-
{
|
| 15 |
-
"cell_type": "code",
|
| 16 |
-
"execution_count": 8,
|
| 17 |
-
"id": "eaed216c-160a-4e31-96fe-015c140ff18b",
|
| 18 |
-
"metadata": {},
|
| 19 |
-
"outputs": [],
|
| 20 |
-
"source": [
|
| 21 |
-
"# from pprint import pprint"
|
| 22 |
-
]
|
| 23 |
-
},
|
| 24 |
-
{
|
| 25 |
-
"cell_type": "code",
|
| 26 |
-
"execution_count": 9,
|
| 27 |
-
"id": "8ddfb0a9-57bd-411a-98af-331ae5098c2d",
|
| 28 |
-
"metadata": {},
|
| 29 |
-
"outputs": [],
|
| 30 |
-
"source": [
|
| 31 |
-
"import json\n",
|
| 32 |
-
"import pandas as pd\n",
|
| 33 |
-
"\n",
|
| 34 |
-
"import openai\n",
|
| 35 |
-
"from openai.embeddings_utils import get_embedding, cosine_similarity"
|
| 36 |
-
]
|
| 37 |
-
},
|
| 38 |
-
{
|
| 39 |
-
"cell_type": "code",
|
| 40 |
-
"execution_count": 10,
|
| 41 |
-
"id": "6e3c3925-2fc6-412d-bb10-9492c9457273",
|
| 42 |
-
"metadata": {},
|
| 43 |
-
"outputs": [],
|
| 44 |
-
"source": [
|
| 45 |
-
"# from games.angrybirds.util import util\n",
|
| 46 |
-
"# from games.angrybirds.config import config\n",
|
| 47 |
-
"# from games.angrybirds.prompt import prompt\n",
|
| 48 |
-
"# from games.angrybirds.query import query, yes_no_query\n",
|
| 49 |
-
"from games.angrybirds.angrybirds import angrybird\n",
|
| 50 |
-
"from games.angrybirds.common import api_key"
|
| 51 |
-
]
|
| 52 |
-
},
|
| 53 |
-
{
|
| 54 |
-
"cell_type": "code",
|
| 55 |
-
"execution_count": null,
|
| 56 |
-
"id": "ae27ebd0-2d95-4ff0-b188-f6e46b189cd1",
|
| 57 |
-
"metadata": {},
|
| 58 |
-
"outputs": [],
|
| 59 |
-
"source": []
|
| 60 |
-
},
|
| 61 |
-
{
|
| 62 |
-
"cell_type": "code",
|
| 63 |
-
"execution_count": 11,
|
| 64 |
-
"id": "2839129a-61bf-4182-a9e3-477935d18a5f",
|
| 65 |
-
"metadata": {},
|
| 66 |
-
"outputs": [],
|
| 67 |
-
"source": [
|
| 68 |
-
"openai.api_key = api_key"
|
| 69 |
-
]
|
| 70 |
-
},
|
| 71 |
-
{
|
| 72 |
-
"cell_type": "code",
|
| 73 |
-
"execution_count": 4,
|
| 74 |
-
"id": "468f0a2f-a42d-4cf9-9c32-a1c0daaf7b2b",
|
| 75 |
-
"metadata": {},
|
| 76 |
-
"outputs": [],
|
| 77 |
-
"source": [
|
| 78 |
-
"# optional"
|
| 79 |
-
]
|
| 80 |
-
},
|
| 81 |
-
{
|
| 82 |
-
"cell_type": "code",
|
| 83 |
-
"execution_count": 13,
|
| 84 |
-
"id": "dc3829e5-9896-46ca-ae49-6830ff99a15d",
|
| 85 |
-
"metadata": {},
|
| 86 |
-
"outputs": [
|
| 87 |
-
{
|
| 88 |
-
"ename": "Timeout",
|
| 89 |
-
"evalue": "Request timed out: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/models (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x129e054d0>, 'Connection to api.openai.com timed out. (connect timeout=600)'))",
|
| 90 |
-
"output_type": "error",
|
| 91 |
-
"traceback": [
|
| 92 |
-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
| 93 |
-
"\u001b[0;31mTimeoutError\u001b[0m Traceback (most recent call last)",
|
| 94 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/connection.py:200\u001b[0m, in \u001b[0;36mHTTPConnection._new_conn\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 199\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 200\u001b[0m sock \u001b[38;5;241m=\u001b[39m \u001b[43mconnection\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcreate_connection\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 201\u001b[0m \u001b[43m \u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_dns_host\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mport\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 202\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtimeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 203\u001b[0m \u001b[43m \u001b[49m\u001b[43msource_address\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msource_address\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 204\u001b[0m \u001b[43m \u001b[49m\u001b[43msocket_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msocket_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 205\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 206\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m socket\u001b[38;5;241m.\u001b[39mgaierror \u001b[38;5;28;01mas\u001b[39;00m e:\n",
|
| 95 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/util/connection.py:85\u001b[0m, in \u001b[0;36mcreate_connection\u001b[0;34m(address, timeout, source_address, socket_options)\u001b[0m\n\u001b[1;32m 84\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m---> 85\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m err\n\u001b[1;32m 86\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[1;32m 87\u001b[0m \u001b[38;5;66;03m# Break explicitly a reference cycle\u001b[39;00m\n",
|
| 96 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/util/connection.py:73\u001b[0m, in \u001b[0;36mcreate_connection\u001b[0;34m(address, timeout, source_address, socket_options)\u001b[0m\n\u001b[1;32m 72\u001b[0m sock\u001b[38;5;241m.\u001b[39mbind(source_address)\n\u001b[0;32m---> 73\u001b[0m \u001b[43msock\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconnect\u001b[49m\u001b[43m(\u001b[49m\u001b[43msa\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 74\u001b[0m \u001b[38;5;66;03m# Break explicitly a reference cycle\u001b[39;00m\n",
|
| 97 |
-
"\u001b[0;31mTimeoutError\u001b[0m: [Errno 60] Operation timed out",
|
| 98 |
-
"\nThe above exception was the direct cause of the following exception:\n",
|
| 99 |
-
"\u001b[0;31mConnectTimeoutError\u001b[0m Traceback (most recent call last)",
|
| 100 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py:790\u001b[0m, in \u001b[0;36mHTTPConnectionPool.urlopen\u001b[0;34m(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)\u001b[0m\n\u001b[1;32m 789\u001b[0m \u001b[38;5;66;03m# Make the request on the HTTPConnection object\u001b[39;00m\n\u001b[0;32m--> 790\u001b[0m response \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_make_request\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 791\u001b[0m \u001b[43m \u001b[49m\u001b[43mconn\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 792\u001b[0m \u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 793\u001b[0m \u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 794\u001b[0m \u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtimeout_obj\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 795\u001b[0m \u001b[43m \u001b[49m\u001b[43mbody\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbody\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 796\u001b[0m \u001b[43m \u001b[49m\u001b[43mheaders\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 797\u001b[0m \u001b[43m \u001b[49m\u001b[43mchunked\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mchunked\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 798\u001b[0m \u001b[43m \u001b[49m\u001b[43mretries\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mretries\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 799\u001b[0m \u001b[43m \u001b[49m\u001b[43mresponse_conn\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mresponse_conn\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 800\u001b[0m \u001b[43m \u001b[49m\u001b[43mpreload_content\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mpreload_content\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 801\u001b[0m \u001b[43m \u001b[49m\u001b[43mdecode_content\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdecode_content\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 802\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mresponse_kw\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 803\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 805\u001b[0m \u001b[38;5;66;03m# Everything went great!\u001b[39;00m\n",
|
| 101 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py:491\u001b[0m, in \u001b[0;36mHTTPConnectionPool._make_request\u001b[0;34m(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)\u001b[0m\n\u001b[1;32m 490\u001b[0m new_e \u001b[38;5;241m=\u001b[39m _wrap_proxy_error(new_e, conn\u001b[38;5;241m.\u001b[39mproxy\u001b[38;5;241m.\u001b[39mscheme)\n\u001b[0;32m--> 491\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m new_e\n\u001b[1;32m 493\u001b[0m \u001b[38;5;66;03m# conn.request() calls http.client.*.request, not the method in\u001b[39;00m\n\u001b[1;32m 494\u001b[0m \u001b[38;5;66;03m# urllib3.request. It also calls makefile (recv) on the socket.\u001b[39;00m\n",
|
| 102 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py:467\u001b[0m, in \u001b[0;36mHTTPConnectionPool._make_request\u001b[0;34m(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)\u001b[0m\n\u001b[1;32m 466\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 467\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_validate_conn\u001b[49m\u001b[43m(\u001b[49m\u001b[43mconn\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 468\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m (SocketTimeout, BaseSSLError) \u001b[38;5;28;01mas\u001b[39;00m e:\n",
|
| 103 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py:1092\u001b[0m, in \u001b[0;36mHTTPSConnectionPool._validate_conn\u001b[0;34m(self, conn)\u001b[0m\n\u001b[1;32m 1091\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m conn\u001b[38;5;241m.\u001b[39mis_closed:\n\u001b[0;32m-> 1092\u001b[0m \u001b[43mconn\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconnect\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1094\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m conn\u001b[38;5;241m.\u001b[39mis_verified:\n",
|
| 104 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/connection.py:604\u001b[0m, in \u001b[0;36mHTTPSConnection.connect\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 603\u001b[0m sock: socket\u001b[38;5;241m.\u001b[39msocket \u001b[38;5;241m|\u001b[39m ssl\u001b[38;5;241m.\u001b[39mSSLSocket\n\u001b[0;32m--> 604\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msock \u001b[38;5;241m=\u001b[39m sock \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_new_conn\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 605\u001b[0m server_hostname: \u001b[38;5;28mstr\u001b[39m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhost\n",
|
| 105 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/connection.py:209\u001b[0m, in \u001b[0;36mHTTPConnection._new_conn\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 208\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m SocketTimeout \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m--> 209\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m ConnectTimeoutError(\n\u001b[1;32m 210\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m 211\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mConnection to \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhost\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m timed out. (connect timeout=\u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtimeout\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m)\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 212\u001b[0m ) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01me\u001b[39;00m\n\u001b[1;32m 214\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mOSError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n",
|
| 106 |
-
"\u001b[0;31mConnectTimeoutError\u001b[0m: (<urllib3.connection.HTTPSConnection object at 0x129e054d0>, 'Connection to api.openai.com timed out. (connect timeout=600)')",
|
| 107 |
-
"\nThe above exception was the direct cause of the following exception:\n",
|
| 108 |
-
"\u001b[0;31mMaxRetryError\u001b[0m Traceback (most recent call last)",
|
| 109 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/requests/adapters.py:486\u001b[0m, in \u001b[0;36mHTTPAdapter.send\u001b[0;34m(self, request, stream, timeout, verify, cert, proxies)\u001b[0m\n\u001b[1;32m 485\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 486\u001b[0m resp \u001b[38;5;241m=\u001b[39m \u001b[43mconn\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43murlopen\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 487\u001b[0m \u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequest\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 488\u001b[0m \u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 489\u001b[0m \u001b[43m \u001b[49m\u001b[43mbody\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequest\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mbody\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 490\u001b[0m \u001b[43m \u001b[49m\u001b[43mheaders\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequest\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 491\u001b[0m \u001b[43m \u001b[49m\u001b[43mredirect\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[1;32m 492\u001b[0m \u001b[43m \u001b[49m\u001b[43massert_same_host\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[1;32m 493\u001b[0m \u001b[43m \u001b[49m\u001b[43mpreload_content\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[1;32m 494\u001b[0m \u001b[43m \u001b[49m\u001b[43mdecode_content\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[1;32m 495\u001b[0m \u001b[43m \u001b[49m\u001b[43mretries\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmax_retries\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 496\u001b[0m \u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtimeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 497\u001b[0m \u001b[43m \u001b[49m\u001b[43mchunked\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mchunked\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 498\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 500\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m (ProtocolError, \u001b[38;5;167;01mOSError\u001b[39;00m) \u001b[38;5;28;01mas\u001b[39;00m err:\n",
|
| 110 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py:874\u001b[0m, in \u001b[0;36mHTTPConnectionPool.urlopen\u001b[0;34m(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)\u001b[0m\n\u001b[1;32m 871\u001b[0m log\u001b[38;5;241m.\u001b[39mwarning(\n\u001b[1;32m 872\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mRetrying (\u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m) after connection broken by \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m: \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m\"\u001b[39m, retries, err, url\n\u001b[1;32m 873\u001b[0m )\n\u001b[0;32m--> 874\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43murlopen\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 875\u001b[0m \u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 876\u001b[0m \u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 877\u001b[0m \u001b[43m \u001b[49m\u001b[43mbody\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 878\u001b[0m \u001b[43m \u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 879\u001b[0m \u001b[43m \u001b[49m\u001b[43mretries\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 880\u001b[0m \u001b[43m \u001b[49m\u001b[43mredirect\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 881\u001b[0m \u001b[43m \u001b[49m\u001b[43massert_same_host\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 882\u001b[0m \u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtimeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 883\u001b[0m \u001b[43m \u001b[49m\u001b[43mpool_timeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mpool_timeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 884\u001b[0m \u001b[43m \u001b[49m\u001b[43mrelease_conn\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrelease_conn\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 885\u001b[0m \u001b[43m \u001b[49m\u001b[43mchunked\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mchunked\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 886\u001b[0m \u001b[43m \u001b[49m\u001b[43mbody_pos\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbody_pos\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 887\u001b[0m \u001b[43m \u001b[49m\u001b[43mpreload_content\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mpreload_content\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 888\u001b[0m \u001b[43m \u001b[49m\u001b[43mdecode_content\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdecode_content\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 889\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mresponse_kw\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 890\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 892\u001b[0m \u001b[38;5;66;03m# Handle redirect?\u001b[39;00m\n",
|
| 111 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py:874\u001b[0m, in \u001b[0;36mHTTPConnectionPool.urlopen\u001b[0;34m(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)\u001b[0m\n\u001b[1;32m 871\u001b[0m log\u001b[38;5;241m.\u001b[39mwarning(\n\u001b[1;32m 872\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mRetrying (\u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m) after connection broken by \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m: \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m\"\u001b[39m, retries, err, url\n\u001b[1;32m 873\u001b[0m )\n\u001b[0;32m--> 874\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43murlopen\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 875\u001b[0m \u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 876\u001b[0m \u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 877\u001b[0m \u001b[43m \u001b[49m\u001b[43mbody\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 878\u001b[0m \u001b[43m \u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 879\u001b[0m \u001b[43m \u001b[49m\u001b[43mretries\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 880\u001b[0m \u001b[43m \u001b[49m\u001b[43mredirect\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 881\u001b[0m \u001b[43m \u001b[49m\u001b[43massert_same_host\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 882\u001b[0m \u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtimeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 883\u001b[0m \u001b[43m \u001b[49m\u001b[43mpool_timeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mpool_timeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 884\u001b[0m \u001b[43m \u001b[49m\u001b[43mrelease_conn\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrelease_conn\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 885\u001b[0m \u001b[43m \u001b[49m\u001b[43mchunked\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mchunked\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 886\u001b[0m \u001b[43m \u001b[49m\u001b[43mbody_pos\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbody_pos\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 887\u001b[0m \u001b[43m \u001b[49m\u001b[43mpreload_content\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mpreload_content\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 888\u001b[0m \u001b[43m \u001b[49m\u001b[43mdecode_content\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdecode_content\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 889\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mresponse_kw\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 890\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 892\u001b[0m \u001b[38;5;66;03m# Handle redirect?\u001b[39;00m\n",
|
| 112 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py:844\u001b[0m, in \u001b[0;36mHTTPConnectionPool.urlopen\u001b[0;34m(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)\u001b[0m\n\u001b[1;32m 842\u001b[0m new_e \u001b[38;5;241m=\u001b[39m ProtocolError(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mConnection aborted.\u001b[39m\u001b[38;5;124m\"\u001b[39m, new_e)\n\u001b[0;32m--> 844\u001b[0m retries \u001b[38;5;241m=\u001b[39m \u001b[43mretries\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mincrement\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 845\u001b[0m \u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43merror\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mnew_e\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m_pool\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m_stacktrace\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msys\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mexc_info\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m2\u001b[39;49m\u001b[43m]\u001b[49m\n\u001b[1;32m 846\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 847\u001b[0m retries\u001b[38;5;241m.\u001b[39msleep()\n",
|
| 113 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/urllib3/util/retry.py:515\u001b[0m, in \u001b[0;36mRetry.increment\u001b[0;34m(self, method, url, response, error, _pool, _stacktrace)\u001b[0m\n\u001b[1;32m 514\u001b[0m reason \u001b[38;5;241m=\u001b[39m error \u001b[38;5;129;01mor\u001b[39;00m ResponseError(cause)\n\u001b[0;32m--> 515\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m MaxRetryError(_pool, url, reason) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mreason\u001b[39;00m \u001b[38;5;66;03m# type: ignore[arg-type]\u001b[39;00m\n\u001b[1;32m 517\u001b[0m log\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mIncremented Retry for (url=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m): \u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m\"\u001b[39m, url, new_retry)\n",
|
| 114 |
-
"\u001b[0;31mMaxRetryError\u001b[0m: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/models (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x129e054d0>, 'Connection to api.openai.com timed out. (connect timeout=600)'))",
|
| 115 |
-
"\nDuring handling of the above exception, another exception occurred:\n",
|
| 116 |
-
"\u001b[0;31mConnectTimeout\u001b[0m Traceback (most recent call last)",
|
| 117 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/openai/api_requestor.py:596\u001b[0m, in \u001b[0;36mAPIRequestor.request_raw\u001b[0;34m(self, method, url, params, supplied_headers, files, stream, request_id, request_timeout)\u001b[0m\n\u001b[1;32m 595\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 596\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43m_thread_context\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msession\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrequest\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 597\u001b[0m \u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 598\u001b[0m \u001b[43m \u001b[49m\u001b[43mabs_url\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 599\u001b[0m \u001b[43m \u001b[49m\u001b[43mheaders\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 600\u001b[0m \u001b[43m \u001b[49m\u001b[43mdata\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdata\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 601\u001b[0m \u001b[43m \u001b[49m\u001b[43mfiles\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mfiles\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 602\u001b[0m \u001b[43m \u001b[49m\u001b[43mstream\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstream\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 603\u001b[0m \u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequest_timeout\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mif\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mrequest_timeout\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01melse\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mTIMEOUT_SECS\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 604\u001b[0m \u001b[43m \u001b[49m\u001b[43mproxies\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m_thread_context\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msession\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mproxies\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 605\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 606\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m requests\u001b[38;5;241m.\u001b[39mexceptions\u001b[38;5;241m.\u001b[39mTimeout \u001b[38;5;28;01mas\u001b[39;00m e:\n",
|
| 118 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/requests/sessions.py:589\u001b[0m, in \u001b[0;36mSession.request\u001b[0;34m(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)\u001b[0m\n\u001b[1;32m 588\u001b[0m send_kwargs\u001b[38;5;241m.\u001b[39mupdate(settings)\n\u001b[0;32m--> 589\u001b[0m resp \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msend\u001b[49m\u001b[43m(\u001b[49m\u001b[43mprep\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43msend_kwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 591\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m resp\n",
|
| 119 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/requests/sessions.py:703\u001b[0m, in \u001b[0;36mSession.send\u001b[0;34m(self, request, **kwargs)\u001b[0m\n\u001b[1;32m 702\u001b[0m \u001b[38;5;66;03m# Send the request\u001b[39;00m\n\u001b[0;32m--> 703\u001b[0m r \u001b[38;5;241m=\u001b[39m \u001b[43madapter\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msend\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 705\u001b[0m \u001b[38;5;66;03m# Total elapsed time of the request (approximately)\u001b[39;00m\n",
|
| 120 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/requests/adapters.py:507\u001b[0m, in \u001b[0;36mHTTPAdapter.send\u001b[0;34m(self, request, stream, timeout, verify, cert, proxies)\u001b[0m\n\u001b[1;32m 506\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(e\u001b[38;5;241m.\u001b[39mreason, NewConnectionError):\n\u001b[0;32m--> 507\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m ConnectTimeout(e, request\u001b[38;5;241m=\u001b[39mrequest)\n\u001b[1;32m 509\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(e\u001b[38;5;241m.\u001b[39mreason, ResponseError):\n",
|
| 121 |
-
"\u001b[0;31mConnectTimeout\u001b[0m: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/models (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x129e054d0>, 'Connection to api.openai.com timed out. (connect timeout=600)'))",
|
| 122 |
-
"\nThe above exception was the direct cause of the following exception:\n",
|
| 123 |
-
"\u001b[0;31mTimeout\u001b[0m Traceback (most recent call last)",
|
| 124 |
-
"Cell \u001b[0;32mIn[13], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m models \u001b[38;5;241m=\u001b[39m \u001b[43mopenai\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mModel\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mlist\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2\u001b[0m [d\u001b[38;5;241m.\u001b[39mid \u001b[38;5;28;01mfor\u001b[39;00m d \u001b[38;5;129;01min\u001b[39;00m models\u001b[38;5;241m.\u001b[39mdata \u001b[38;5;28;01mif\u001b[39;00m d\u001b[38;5;241m.\u001b[39mid\u001b[38;5;241m.\u001b[39mstartswith(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mg\u001b[39m\u001b[38;5;124m'\u001b[39m)]\n",
|
| 125 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/openai/api_resources/abstract/listable_api_resource.py:60\u001b[0m, in \u001b[0;36mListableAPIResource.list\u001b[0;34m(cls, api_key, request_id, api_version, organization, api_base, api_type, **params)\u001b[0m\n\u001b[1;32m 41\u001b[0m \u001b[38;5;129m@classmethod\u001b[39m\n\u001b[1;32m 42\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mlist\u001b[39m(\n\u001b[1;32m 43\u001b[0m \u001b[38;5;28mcls\u001b[39m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 50\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mparams,\n\u001b[1;32m 51\u001b[0m ):\n\u001b[1;32m 52\u001b[0m requestor, url \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mcls\u001b[39m\u001b[38;5;241m.\u001b[39m__prepare_list_requestor(\n\u001b[1;32m 53\u001b[0m api_key,\n\u001b[1;32m 54\u001b[0m api_version,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 57\u001b[0m api_type,\n\u001b[1;32m 58\u001b[0m )\n\u001b[0;32m---> 60\u001b[0m response, _, api_key \u001b[38;5;241m=\u001b[39m \u001b[43mrequestor\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrequest\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 61\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mget\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mparams\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrequest_id\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequest_id\u001b[49m\n\u001b[1;32m 62\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 63\u001b[0m openai_object \u001b[38;5;241m=\u001b[39m util\u001b[38;5;241m.\u001b[39mconvert_to_openai_object(\n\u001b[1;32m 64\u001b[0m response, api_key, api_version, organization\n\u001b[1;32m 65\u001b[0m )\n\u001b[1;32m 66\u001b[0m openai_object\u001b[38;5;241m.\u001b[39m_retrieve_params \u001b[38;5;241m=\u001b[39m params\n",
|
| 126 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/openai/api_requestor.py:288\u001b[0m, in \u001b[0;36mAPIRequestor.request\u001b[0;34m(self, method, url, params, headers, files, stream, request_id, request_timeout)\u001b[0m\n\u001b[1;32m 277\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mrequest\u001b[39m(\n\u001b[1;32m 278\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m 279\u001b[0m method,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 286\u001b[0m request_timeout: Optional[Union[\u001b[38;5;28mfloat\u001b[39m, Tuple[\u001b[38;5;28mfloat\u001b[39m, \u001b[38;5;28mfloat\u001b[39m]]] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[1;32m 287\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Tuple[Union[OpenAIResponse, Iterator[OpenAIResponse]], \u001b[38;5;28mbool\u001b[39m, \u001b[38;5;28mstr\u001b[39m]:\n\u001b[0;32m--> 288\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrequest_raw\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 289\u001b[0m \u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mlower\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 290\u001b[0m \u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 291\u001b[0m \u001b[43m \u001b[49m\u001b[43mparams\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mparams\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 292\u001b[0m \u001b[43m \u001b[49m\u001b[43msupplied_headers\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 293\u001b[0m \u001b[43m \u001b[49m\u001b[43mfiles\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mfiles\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 294\u001b[0m \u001b[43m \u001b[49m\u001b[43mstream\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstream\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 295\u001b[0m \u001b[43m \u001b[49m\u001b[43mrequest_id\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequest_id\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 296\u001b[0m \u001b[43m \u001b[49m\u001b[43mrequest_timeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequest_timeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 297\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 298\u001b[0m resp, got_stream \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_interpret_response(result, stream)\n\u001b[1;32m 299\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m resp, got_stream, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mapi_key\n",
|
| 127 |
-
"File \u001b[0;32m~/playgo/abc123/.venv/lib/python3.11/site-packages/openai/api_requestor.py:607\u001b[0m, in \u001b[0;36mAPIRequestor.request_raw\u001b[0;34m(self, method, url, params, supplied_headers, files, stream, request_id, request_timeout)\u001b[0m\n\u001b[1;32m 596\u001b[0m result \u001b[38;5;241m=\u001b[39m _thread_context\u001b[38;5;241m.\u001b[39msession\u001b[38;5;241m.\u001b[39mrequest(\n\u001b[1;32m 597\u001b[0m method,\n\u001b[1;32m 598\u001b[0m abs_url,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 604\u001b[0m proxies\u001b[38;5;241m=\u001b[39m_thread_context\u001b[38;5;241m.\u001b[39msession\u001b[38;5;241m.\u001b[39mproxies,\n\u001b[1;32m 605\u001b[0m )\n\u001b[1;32m 606\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m requests\u001b[38;5;241m.\u001b[39mexceptions\u001b[38;5;241m.\u001b[39mTimeout \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m--> 607\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m error\u001b[38;5;241m.\u001b[39mTimeout(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mRequest timed out: \u001b[39m\u001b[38;5;132;01m{}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(e)) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01me\u001b[39;00m\n\u001b[1;32m 608\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m requests\u001b[38;5;241m.\u001b[39mexceptions\u001b[38;5;241m.\u001b[39mRequestException \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[1;32m 609\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m error\u001b[38;5;241m.\u001b[39mAPIConnectionError(\n\u001b[1;32m 610\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mError communicating with OpenAI: \u001b[39m\u001b[38;5;132;01m{}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(e)\n\u001b[1;32m 611\u001b[0m ) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01me\u001b[39;00m\n",
|
| 128 |
-
"\u001b[0;31mTimeout\u001b[0m: Request timed out: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/models (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x129e054d0>, 'Connection to api.openai.com timed out. (connect timeout=600)'))"
|
| 129 |
-
]
|
| 130 |
-
}
|
| 131 |
-
],
|
| 132 |
-
"source": [
|
| 133 |
-
"models = openai.Model.list()\n",
|
| 134 |
-
"[d.id for d in models.data if d.id.startswith('g')]"
|
| 135 |
-
]
|
| 136 |
-
},
|
| 137 |
-
{
|
| 138 |
-
"cell_type": "code",
|
| 139 |
-
"execution_count": 6,
|
| 140 |
-
"id": "0668fb4b-b4c1-4be1-aa4a-c0c2ada7c128",
|
| 141 |
-
"metadata": {},
|
| 142 |
-
"outputs": [
|
| 143 |
-
{
|
| 144 |
-
"data": {
|
| 145 |
-
"text/plain": [
|
| 146 |
-
"['gpt-3.5-turbo-16k-0613',\n",
|
| 147 |
-
" 'gpt-3.5-turbo-16k',\n",
|
| 148 |
-
" 'gpt-3.5-turbo',\n",
|
| 149 |
-
" 'gpt-3.5-turbo-0301',\n",
|
| 150 |
-
" 'gpt-3.5-turbo-0613']"
|
| 151 |
-
]
|
| 152 |
-
},
|
| 153 |
-
"execution_count": 6,
|
| 154 |
-
"metadata": {},
|
| 155 |
-
"output_type": "execute_result"
|
| 156 |
-
}
|
| 157 |
-
],
|
| 158 |
-
"source": [
|
| 159 |
-
"models = openai.Model.list()\n",
|
| 160 |
-
"[d.id for d in models.data if d.id.startswith('g')]"
|
| 161 |
-
]
|
| 162 |
-
},
|
| 163 |
-
{
|
| 164 |
-
"cell_type": "code",
|
| 165 |
-
"execution_count": null,
|
| 166 |
-
"id": "daf7a5db-dd42-4452-8c3d-41a466e7da7e",
|
| 167 |
-
"metadata": {},
|
| 168 |
-
"outputs": [],
|
| 169 |
-
"source": []
|
| 170 |
-
},
|
| 171 |
-
{
|
| 172 |
-
"cell_type": "code",
|
| 173 |
-
"execution_count": 21,
|
| 174 |
-
"id": "0a5c3ff3-2bb1-4f72-9aa3-04473a7b714e",
|
| 175 |
-
"metadata": {},
|
| 176 |
-
"outputs": [],
|
| 177 |
-
"source": [
|
| 178 |
-
"space = 'stevez-abc123'"
|
| 179 |
-
]
|
| 180 |
-
},
|
| 181 |
-
{
|
| 182 |
-
"cell_type": "code",
|
| 183 |
-
"execution_count": null,
|
| 184 |
-
"id": "21fe7b7b-eb92-45f4-8cf4-d42aedebf9e8",
|
| 185 |
-
"metadata": {},
|
| 186 |
-
"outputs": [],
|
| 187 |
-
"source": []
|
| 188 |
-
},
|
| 189 |
-
{
|
| 190 |
-
"cell_type": "code",
|
| 191 |
-
"execution_count": null,
|
| 192 |
-
"id": "f589b196-b1ae-4cd5-8b67-15919ba43b3b",
|
| 193 |
-
"metadata": {},
|
| 194 |
-
"outputs": [],
|
| 195 |
-
"source": []
|
| 196 |
-
},
|
| 197 |
-
{
|
| 198 |
-
"cell_type": "code",
|
| 199 |
-
"execution_count": null,
|
| 200 |
-
"id": "c8a50d0f-0e2a-4f1c-b258-1768f75937b5",
|
| 201 |
-
"metadata": {},
|
| 202 |
-
"outputs": [],
|
| 203 |
-
"source": []
|
| 204 |
-
},
|
| 205 |
-
{
|
| 206 |
-
"cell_type": "code",
|
| 207 |
-
"execution_count": 14,
|
| 208 |
-
"id": "6b619c70-f9e8-46d2-9326-371559c95c64",
|
| 209 |
-
"metadata": {},
|
| 210 |
-
"outputs": [],
|
| 211 |
-
"source": [
|
| 212 |
-
"# modify_request = json.dumps(['Please modify your request.'])\n",
|
| 213 |
-
"# modify_request"
|
| 214 |
-
]
|
| 215 |
-
},
|
| 216 |
-
{
|
| 217 |
-
"cell_type": "code",
|
| 218 |
-
"execution_count": 15,
|
| 219 |
-
"id": "766fda6a-71c8-48a8-941b-0493e7f41584",
|
| 220 |
-
"metadata": {},
|
| 221 |
-
"outputs": [],
|
| 222 |
-
"source": [
|
| 223 |
-
"# json.loads(modify_request)"
|
| 224 |
-
]
|
| 225 |
-
},
|
| 226 |
-
{
|
| 227 |
-
"cell_type": "code",
|
| 228 |
-
"execution_count": 16,
|
| 229 |
-
"id": "f7f67984-540b-4aa3-ba4d-f95d4570fce8",
|
| 230 |
-
"metadata": {},
|
| 231 |
-
"outputs": [
|
| 232 |
-
{
|
| 233 |
-
"data": {
|
| 234 |
-
"text/plain": [
|
| 235 |
-
"27"
|
| 236 |
-
]
|
| 237 |
-
},
|
| 238 |
-
"execution_count": 16,
|
| 239 |
-
"metadata": {},
|
| 240 |
-
"output_type": "execute_result"
|
| 241 |
-
}
|
| 242 |
-
],
|
| 243 |
-
"source": [
|
| 244 |
-
"len(list(config.game_examples.keys()))"
|
| 245 |
-
]
|
| 246 |
-
},
|
| 247 |
-
{
|
| 248 |
-
"cell_type": "code",
|
| 249 |
-
"execution_count": 17,
|
| 250 |
-
"id": "4edf89fb-0b93-4d1a-b9c2-341417128a45",
|
| 251 |
-
"metadata": {},
|
| 252 |
-
"outputs": [
|
| 253 |
-
{
|
| 254 |
-
"data": {
|
| 255 |
-
"text/plain": [
|
| 256 |
-
"['Add a bird.',\n",
|
| 257 |
-
" 'Delete a bird.',\n",
|
| 258 |
-
" 'Add more birds.',\n",
|
| 259 |
-
" 'Add a big bird.',\n",
|
| 260 |
-
" 'Add a magnet bird.',\n",
|
| 261 |
-
" 'Add a superheavy bird.',\n",
|
| 262 |
-
" 'Add a catapult bird.',\n",
|
| 263 |
-
" 'Add a flash bird.',\n",
|
| 264 |
-
" 'Add an antigravity bird.',\n",
|
| 265 |
-
" 'The game is too difficult. Please add more birds.',\n",
|
| 266 |
-
" 'Make the bird bigger.',\n",
|
| 267 |
-
" 'Make the bird bigger, so it can run over the enemies.',\n",
|
| 268 |
-
" 'List birds.',\n",
|
| 269 |
-
" 'Show bird list.',\n",
|
| 270 |
-
" 'What kind of birds do you have?',\n",
|
| 271 |
-
" 'Are there new kinds of birds?',\n",
|
| 272 |
-
" 'Add a pig.',\n",
|
| 273 |
-
" 'Our pigs are losing. Add more pigs.',\n",
|
| 274 |
-
" 'The pigs are too week. Increase the health points for them.',\n",
|
| 275 |
-
" 'The pigs are too week. Increase the HP for them.',\n",
|
| 276 |
-
" 'The pigs are too week. Increase the hit points for them.',\n",
|
| 277 |
-
" 'The pigs are too week. Increase the blood level for them.',\n",
|
| 278 |
-
" 'The pigs are too week. Increase the blood levels for them.',\n",
|
| 279 |
-
" 'I want to protect the pigs by build houses for them.',\n",
|
| 280 |
-
" 'I want to build houses.',\n",
|
| 281 |
-
" 'I want to build houses, so I can protect my pigs.',\n",
|
| 282 |
-
" \"The obstacles are too weak. Let's build some solid houses.\"]"
|
| 283 |
-
]
|
| 284 |
-
},
|
| 285 |
-
"execution_count": 17,
|
| 286 |
-
"metadata": {},
|
| 287 |
-
"output_type": "execute_result"
|
| 288 |
-
}
|
| 289 |
-
],
|
| 290 |
-
"source": [
|
| 291 |
-
"list(config.game_examples.keys())"
|
| 292 |
-
]
|
| 293 |
-
},
|
| 294 |
-
{
|
| 295 |
-
"cell_type": "code",
|
| 296 |
-
"execution_count": 18,
|
| 297 |
-
"id": "4ae67ee9-2907-4811-8dae-aeb2140c827d",
|
| 298 |
-
"metadata": {},
|
| 299 |
-
"outputs": [
|
| 300 |
-
{
|
| 301 |
-
"data": {
|
| 302 |
-
"text/plain": [
|
| 303 |
-
"'Add a bird.'"
|
| 304 |
-
]
|
| 305 |
-
},
|
| 306 |
-
"execution_count": 18,
|
| 307 |
-
"metadata": {},
|
| 308 |
-
"output_type": "execute_result"
|
| 309 |
-
}
|
| 310 |
-
],
|
| 311 |
-
"source": [
|
| 312 |
-
"command = list(config.game_examples.keys())[0]\n",
|
| 313 |
-
"command"
|
| 314 |
-
]
|
| 315 |
-
},
|
| 316 |
-
{
|
| 317 |
-
"cell_type": "code",
|
| 318 |
-
"execution_count": 19,
|
| 319 |
-
"id": "b625856c-b9ea-4d57-83dd-99e57b0d3404",
|
| 320 |
-
"metadata": {},
|
| 321 |
-
"outputs": [],
|
| 322 |
-
"source": [
|
| 323 |
-
"# test"
|
| 324 |
-
]
|
| 325 |
-
},
|
| 326 |
-
{
|
| 327 |
-
"cell_type": "code",
|
| 328 |
-
"execution_count": 20,
|
| 329 |
-
"id": "be16a49a-7b4f-4842-b079-19728e50eecc",
|
| 330 |
-
"metadata": {},
|
| 331 |
-
"outputs": [
|
| 332 |
-
{
|
| 333 |
-
"data": {
|
| 334 |
-
"text/plain": [
|
| 335 |
-
"['The game developer is talking about birds.',\n",
|
| 336 |
-
" 'The game developer wants to add a bird.']"
|
| 337 |
-
]
|
| 338 |
-
},
|
| 339 |
-
"execution_count": 20,
|
| 340 |
-
"metadata": {},
|
| 341 |
-
"output_type": "execute_result"
|
| 342 |
-
}
|
| 343 |
-
],
|
| 344 |
-
"source": [
|
| 345 |
-
"prompts = config.game_examples[command]['prompt']\n",
|
| 346 |
-
"prompts"
|
| 347 |
-
]
|
| 348 |
-
},
|
| 349 |
-
{
|
| 350 |
-
"cell_type": "code",
|
| 351 |
-
"execution_count": 21,
|
| 352 |
-
"id": "28e7d1bc-df58-4399-b2c3-d7b96aa1a780",
|
| 353 |
-
"metadata": {},
|
| 354 |
-
"outputs": [],
|
| 355 |
-
"source": [
|
| 356 |
-
"bird = angrybird()"
|
| 357 |
-
]
|
| 358 |
-
},
|
| 359 |
-
{
|
| 360 |
-
"cell_type": "code",
|
| 361 |
-
"execution_count": 22,
|
| 362 |
-
"id": "2d4abff5-2b19-4ea5-98ca-453a9d2139d0",
|
| 363 |
-
"metadata": {},
|
| 364 |
-
"outputs": [
|
| 365 |
-
{
|
| 366 |
-
"name": "stdout",
|
| 367 |
-
"output_type": "stream",
|
| 368 |
-
"text": [
|
| 369 |
-
"1.0000 15/15\ty\n",
|
| 370 |
-
"[('y', 15)]\n"
|
| 371 |
-
]
|
| 372 |
-
},
|
| 373 |
-
{
|
| 374 |
-
"data": {
|
| 375 |
-
"text/plain": [
|
| 376 |
-
"'y'"
|
| 377 |
-
]
|
| 378 |
-
},
|
| 379 |
-
"execution_count": 22,
|
| 380 |
-
"metadata": {},
|
| 381 |
-
"output_type": "execute_result"
|
| 382 |
-
}
|
| 383 |
-
],
|
| 384 |
-
"source": [
|
| 385 |
-
"yes_no_query(bird, command, prompts[0])"
|
| 386 |
-
]
|
| 387 |
-
},
|
| 388 |
-
{
|
| 389 |
-
"cell_type": "code",
|
| 390 |
-
"execution_count": null,
|
| 391 |
-
"id": "449c163a-4348-4000-a596-6c85d71f5d12",
|
| 392 |
-
"metadata": {},
|
| 393 |
-
"outputs": [],
|
| 394 |
-
"source": []
|
| 395 |
-
},
|
| 396 |
-
{
|
| 397 |
-
"cell_type": "code",
|
| 398 |
-
"execution_count": 23,
|
| 399 |
-
"id": "8ca28c48-512b-41db-a470-a9337690ed30",
|
| 400 |
-
"metadata": {},
|
| 401 |
-
"outputs": [],
|
| 402 |
-
"source": [
|
| 403 |
-
"debug = 2"
|
| 404 |
-
]
|
| 405 |
-
},
|
| 406 |
-
{
|
| 407 |
-
"cell_type": "code",
|
| 408 |
-
"execution_count": 25,
|
| 409 |
-
"id": "f3f8f3bd-d928-4de1-a8af-c0f6b3fcd111",
|
| 410 |
-
"metadata": {},
|
| 411 |
-
"outputs": [
|
| 412 |
-
{
|
| 413 |
-
"name": "stdout",
|
| 414 |
-
"output_type": "stream",
|
| 415 |
-
"text": [
|
| 416 |
-
"--------------------\n",
|
| 417 |
-
"prompt:\n",
|
| 418 |
-
"\n",
|
| 419 |
-
"Imaging we are developing the game of the Angry Birds, \n",
|
| 420 |
-
"and the game is described as the following: \n",
|
| 421 |
-
"\n",
|
| 422 |
-
"In Angry Birds, players take control of a group of birds who are seeking \n",
|
| 423 |
-
"revenge on a group of green pigs that have stolen their eggs. \n",
|
| 424 |
-
"The gameplay involves using a slingshot to launch the birds at various \n",
|
| 425 |
-
"structures where the pigs are hiding. The objective is to \n",
|
| 426 |
-
"eliminate all the pigs on each level and score as many points as possible.\n",
|
| 427 |
-
"\n",
|
| 428 |
-
"A game developer is building the game, \n",
|
| 429 |
-
"and I need you to help me figure out what is going on.\n",
|
| 430 |
-
"\n",
|
| 431 |
-
"\n",
|
| 432 |
-
"The game developer says: \"Add a bird.\".\n",
|
| 433 |
-
"\n",
|
| 434 |
-
"The game developer is talking about ___\n",
|
| 435 |
-
"(A) birds (B) houses (C) pigs (D) building houses for pigs (E) none of the above\n",
|
| 436 |
-
"\n",
|
| 437 |
-
"Do not explain.\n",
|
| 438 |
-
"\n",
|
| 439 |
-
"1.0000 15/15\t(A) birds\n",
|
| 440 |
-
"[('(A) birds', 15)]\n"
|
| 441 |
-
]
|
| 442 |
-
}
|
| 443 |
-
],
|
| 444 |
-
"source": [
|
| 445 |
-
"modify_request = 'Please modify your request.'\n",
|
| 446 |
-
"p = prompt()\n",
|
| 447 |
-
"\n",
|
| 448 |
-
"print('-'*20)\n",
|
| 449 |
-
"obj_lst = list(config.game_spec.keys())\n",
|
| 450 |
-
"obj_list = [f\"{i} {o}\" for i, o in zip(util.order, obj_lst)]\n",
|
| 451 |
-
"s = p.prompt_which_object(\n",
|
| 452 |
-
" config.game_desc, \n",
|
| 453 |
-
" command,\n",
|
| 454 |
-
" \" \".join(obj_list))\n",
|
| 455 |
-
"full_prompt = p.get_full_prompt(s)\n",
|
| 456 |
-
"if debug >= 2:\n",
|
| 457 |
-
" print(f'prompt:{s}')\n",
|
| 458 |
-
"\n",
|
| 459 |
-
"res = bird.query_chatgpt(full_prompt)"
|
| 460 |
-
]
|
| 461 |
-
},
|
| 462 |
-
{
|
| 463 |
-
"cell_type": "code",
|
| 464 |
-
"execution_count": null,
|
| 465 |
-
"id": "615f67e3-9982-4fde-a2de-aec47f86f798",
|
| 466 |
-
"metadata": {},
|
| 467 |
-
"outputs": [],
|
| 468 |
-
"source": []
|
| 469 |
-
},
|
| 470 |
-
{
|
| 471 |
-
"cell_type": "code",
|
| 472 |
-
"execution_count": 103,
|
| 473 |
-
"id": "593083b1-9d98-45e4-b3ff-55d00cd805f0",
|
| 474 |
-
"metadata": {},
|
| 475 |
-
"outputs": [
|
| 476 |
-
{
|
| 477 |
-
"name": "stdout",
|
| 478 |
-
"output_type": "stream",
|
| 479 |
-
"text": [
|
| 480 |
-
"\n",
|
| 481 |
-
"====================\n",
|
| 482 |
-
"--------------------\n",
|
| 483 |
-
"add a big bird\n",
|
| 484 |
-
"The game developer is talking about birds.\n",
|
| 485 |
-
"0.8667 13/15\ty\n",
|
| 486 |
-
"[('y', 13), ('n', 2)]\n",
|
| 487 |
-
"--------------------\n",
|
| 488 |
-
"add a big bird\n",
|
| 489 |
-
"The game developer wants to add a bird.\n",
|
| 490 |
-
"1.0000 15/15\ty\n",
|
| 491 |
-
"[('y', 15)]\n",
|
| 492 |
-
"--------------------\n",
|
| 493 |
-
"add a big bird\n",
|
| 494 |
-
"The type of the bird the game developer wants to add is a big bird.\n",
|
| 495 |
-
"0.5333 8/15\ty\n",
|
| 496 |
-
"[('y', 8), ('n', 7)]\n",
|
| 497 |
-
"\n",
|
| 498 |
-
"====================\n",
|
| 499 |
-
"--------------------\n",
|
| 500 |
-
"Make the bird bigger, so it can run over the enemies.\n",
|
| 501 |
-
"The game developer is talking about birds.\n",
|
| 502 |
-
"0.7333 11/15\ty\n",
|
| 503 |
-
"[('y', 11), ('n', 4)]\n",
|
| 504 |
-
"--------------------\n",
|
| 505 |
-
"Make the bird bigger, so it can run over the enemies.\n",
|
| 506 |
-
"The game developer wants to change the size of a bird.\n",
|
| 507 |
-
"1.0000 15/15\ty\n",
|
| 508 |
-
"[('y', 15)]\n",
|
| 509 |
-
"--------------------\n",
|
| 510 |
-
"Make the bird bigger, so it can run over the enemies.\n",
|
| 511 |
-
"The game developer did not specify how much bigger\n",
|
| 512 |
-
"0.8000 12/15\ty\n",
|
| 513 |
-
"[('y', 12), ('n', 3)]\n",
|
| 514 |
-
"\n",
|
| 515 |
-
"====================\n",
|
| 516 |
-
"--------------------\n",
|
| 517 |
-
"Our pigs are losing. Add more pigs\n",
|
| 518 |
-
"The game developer is talking about pigs.\n",
|
| 519 |
-
"1.0000 15/15\ty\n",
|
| 520 |
-
"[('y', 15)]\n",
|
| 521 |
-
"--------------------\n",
|
| 522 |
-
"Our pigs are losing. Add more pigs\n",
|
| 523 |
-
"The game developer wants to add some pig.\n",
|
| 524 |
-
"1.0000 15/15\ty\n",
|
| 525 |
-
"[('y', 15)]\n"
|
| 526 |
-
]
|
| 527 |
-
}
|
| 528 |
-
],
|
| 529 |
-
"source": [
|
| 530 |
-
"for command in config.game_examples:\n",
|
| 531 |
-
" if 'prompt' not in config.game_examples[command]:\n",
|
| 532 |
-
" continue\n",
|
| 533 |
-
"\n",
|
| 534 |
-
" if 'train' in config.game_examples[command]:\n",
|
| 535 |
-
" continue\n",
|
| 536 |
-
" prompts = config.game_examples[command]['prompt']\n",
|
| 537 |
-
" print()\n",
|
| 538 |
-
" print('='*20)\n",
|
| 539 |
-
" for prompt in prompts:\n",
|
| 540 |
-
" print('-'*20)\n",
|
| 541 |
-
" print(command)\n",
|
| 542 |
-
" print(prompt)\n",
|
| 543 |
-
" assert yes_no_query(command, prompt) == 'y'"
|
| 544 |
-
]
|
| 545 |
-
},
|
| 546 |
-
{
|
| 547 |
-
"cell_type": "code",
|
| 548 |
-
"execution_count": 86,
|
| 549 |
-
"id": "fbc675f6-ff70-442f-8b5d-8db4af917954",
|
| 550 |
-
"metadata": {},
|
| 551 |
-
"outputs": [
|
| 552 |
-
{
|
| 553 |
-
"name": "stdout",
|
| 554 |
-
"output_type": "stream",
|
| 555 |
-
"text": [
|
| 556 |
-
"====================\n",
|
| 557 |
-
"\n",
|
| 558 |
-
"--------------------\n",
|
| 559 |
-
"add a big bird\n",
|
| 560 |
-
"The game developer is talking about birds.\n",
|
| 561 |
-
"\n",
|
| 562 |
-
"0.9333 14/15\ty\n",
|
| 563 |
-
"[('y', 14), ('n', 1)]\n",
|
| 564 |
-
"y\n",
|
| 565 |
-
"\n",
|
| 566 |
-
"--------------------\n",
|
| 567 |
-
"add a big bird\n",
|
| 568 |
-
"The game developer wants to add a bird.\n",
|
| 569 |
-
"\n",
|
| 570 |
-
"1.0000 15/15\ty\n",
|
| 571 |
-
"[('y', 15)]\n",
|
| 572 |
-
"y\n",
|
| 573 |
-
"\n",
|
| 574 |
-
"--------------------\n",
|
| 575 |
-
"add a big bird\n",
|
| 576 |
-
"The type of the bird the game developer wants to add is a big bird.\n",
|
| 577 |
-
"\n",
|
| 578 |
-
"0.8000 12/15\tn\n",
|
| 579 |
-
"[('n', 12), ('y', 3)]\n",
|
| 580 |
-
"n\n",
|
| 581 |
-
"\n",
|
| 582 |
-
"====================\n",
|
| 583 |
-
"\n",
|
| 584 |
-
"--------------------\n",
|
| 585 |
-
"Make the bird bigger, so it can run over the enemies.\n",
|
| 586 |
-
"The game developer is talking about birds.\n",
|
| 587 |
-
"\n",
|
| 588 |
-
"0.6000 9/15\ty\n",
|
| 589 |
-
"[('y', 9), ('n', 6)]\n",
|
| 590 |
-
"y\n",
|
| 591 |
-
"\n",
|
| 592 |
-
"--------------------\n",
|
| 593 |
-
"Make the bird bigger, so it can run over the enemies.\n",
|
| 594 |
-
"The game developer wants to change the size of a bird.\n",
|
| 595 |
-
"\n",
|
| 596 |
-
"1.0000 15/15\ty\n",
|
| 597 |
-
"[('y', 15)]\n",
|
| 598 |
-
"y\n",
|
| 599 |
-
"\n",
|
| 600 |
-
"--------------------\n",
|
| 601 |
-
"Make the bird bigger, so it can run over the enemies.\n",
|
| 602 |
-
"The game developer did not specify how much bigger\n",
|
| 603 |
-
"\n",
|
| 604 |
-
"0.9333 14/15\ty\n",
|
| 605 |
-
"[('y', 14), ('n', 1)]\n",
|
| 606 |
-
"y\n",
|
| 607 |
-
"\n"
|
| 608 |
-
]
|
| 609 |
-
}
|
| 610 |
-
],
|
| 611 |
-
"source": [
|
| 612 |
-
"for command in config.game_examples:\n",
|
| 613 |
-
" if 'prompt' not in config.game_examples[command]:\n",
|
| 614 |
-
" continue\n",
|
| 615 |
-
"\n",
|
| 616 |
-
" if 'focus' not in config.game_examples[command]:\n",
|
| 617 |
-
" continue\n",
|
| 618 |
-
" prompts = config.game_examples[command]['prompt']\n",
|
| 619 |
-
" print('='*20)\n",
|
| 620 |
-
" print()\n",
|
| 621 |
-
" for prompt in prompts:\n",
|
| 622 |
-
" print('-'*20)\n",
|
| 623 |
-
" print(command)\n",
|
| 624 |
-
" print(prompt)\n",
|
| 625 |
-
" print()\n",
|
| 626 |
-
" print(yes_no_query(command, prompt))\n",
|
| 627 |
-
" print()"
|
| 628 |
-
]
|
| 629 |
-
},
|
| 630 |
-
{
|
| 631 |
-
"cell_type": "code",
|
| 632 |
-
"execution_count": 84,
|
| 633 |
-
"id": "89c4c4b0-c2c1-4566-a5ff-3fd4436bb027",
|
| 634 |
-
"metadata": {},
|
| 635 |
-
"outputs": [],
|
| 636 |
-
"source": [
|
| 637 |
-
"# command = \"add a flash bird.\"\n",
|
| 638 |
-
"input_command = \"add a red pig\""
|
| 639 |
-
]
|
| 640 |
-
},
|
| 641 |
-
{
|
| 642 |
-
"cell_type": "code",
|
| 643 |
-
"execution_count": 22,
|
| 644 |
-
"id": "18888a7b-d32d-45b4-a9b3-3ce29b18a7f7",
|
| 645 |
-
"metadata": {},
|
| 646 |
-
"outputs": [],
|
| 647 |
-
"source": [
|
| 648 |
-
"# sim query"
|
| 649 |
-
]
|
| 650 |
-
},
|
| 651 |
-
{
|
| 652 |
-
"cell_type": "code",
|
| 653 |
-
"execution_count": 23,
|
| 654 |
-
"id": "5dd25e64-cf95-4831-95f1-b4a853b3ef1a",
|
| 655 |
-
"metadata": {},
|
| 656 |
-
"outputs": [],
|
| 657 |
-
"source": [
|
| 658 |
-
"def get_emb(command):\n",
|
| 659 |
-
" return get_embedding(\n",
|
| 660 |
-
" command,\n",
|
| 661 |
-
" engine=\"text-embedding-ada-002\"\n",
|
| 662 |
-
" )"
|
| 663 |
-
]
|
| 664 |
-
},
|
| 665 |
-
{
|
| 666 |
-
"cell_type": "code",
|
| 667 |
-
"execution_count": 24,
|
| 668 |
-
"id": "c44cb708-d129-43f2-bb63-9287ee6fe899",
|
| 669 |
-
"metadata": {},
|
| 670 |
-
"outputs": [],
|
| 671 |
-
"source": [
|
| 672 |
-
"input_embedding = get_emb(input_command)"
|
| 673 |
-
]
|
| 674 |
-
},
|
| 675 |
-
{
|
| 676 |
-
"cell_type": "code",
|
| 677 |
-
"execution_count": 26,
|
| 678 |
-
"id": "d8847340-1d63-47df-bca2-b7a18fe5243b",
|
| 679 |
-
"metadata": {},
|
| 680 |
-
"outputs": [
|
| 681 |
-
{
|
| 682 |
-
"data": {
|
| 683 |
-
"text/plain": [
|
| 684 |
-
"[-0.009216495789587498,\n",
|
| 685 |
-
" -0.020423918962478638,\n",
|
| 686 |
-
" -0.007699600420892239,\n",
|
| 687 |
-
" 0.0027933907695114613,\n",
|
| 688 |
-
" -0.009676982648670673]"
|
| 689 |
-
]
|
| 690 |
-
},
|
| 691 |
-
"execution_count": 26,
|
| 692 |
-
"metadata": {},
|
| 693 |
-
"output_type": "execute_result"
|
| 694 |
-
}
|
| 695 |
-
],
|
| 696 |
-
"source": [
|
| 697 |
-
"input_embedding[:5]"
|
| 698 |
-
]
|
| 699 |
-
},
|
| 700 |
-
{
|
| 701 |
-
"cell_type": "code",
|
| 702 |
-
"execution_count": 27,
|
| 703 |
-
"id": "374629b3-54c9-4a6f-9621-d0daa9d200b6",
|
| 704 |
-
"metadata": {},
|
| 705 |
-
"outputs": [],
|
| 706 |
-
"source": [
|
| 707 |
-
"embeddings = {}\n",
|
| 708 |
-
"for command in config.examples.keys():\n",
|
| 709 |
-
" embeddings[command] = get_emb(command)"
|
| 710 |
-
]
|
| 711 |
-
},
|
| 712 |
-
{
|
| 713 |
-
"cell_type": "code",
|
| 714 |
-
"execution_count": null,
|
| 715 |
-
"id": "3dede08f-376f-4bd9-8b9c-5561f4c03bce",
|
| 716 |
-
"metadata": {},
|
| 717 |
-
"outputs": [],
|
| 718 |
-
"source": []
|
| 719 |
-
},
|
| 720 |
-
{
|
| 721 |
-
"cell_type": "code",
|
| 722 |
-
"execution_count": 28,
|
| 723 |
-
"id": "c845321b-51c9-42a9-b645-277a3c630bb2",
|
| 724 |
-
"metadata": {},
|
| 725 |
-
"outputs": [],
|
| 726 |
-
"source": [
|
| 727 |
-
"df = pd.DataFrame(columns=['sim', 'command'])"
|
| 728 |
-
]
|
| 729 |
-
},
|
| 730 |
-
{
|
| 731 |
-
"cell_type": "code",
|
| 732 |
-
"execution_count": 29,
|
| 733 |
-
"id": "98be3413-d5f1-4d32-ad50-7bb47384c270",
|
| 734 |
-
"metadata": {},
|
| 735 |
-
"outputs": [
|
| 736 |
-
{
|
| 737 |
-
"data": {
|
| 738 |
-
"text/html": [
|
| 739 |
-
"<div>\n",
|
| 740 |
-
"<style scoped>\n",
|
| 741 |
-
" .dataframe tbody tr th:only-of-type {\n",
|
| 742 |
-
" vertical-align: middle;\n",
|
| 743 |
-
" }\n",
|
| 744 |
-
"\n",
|
| 745 |
-
" .dataframe tbody tr th {\n",
|
| 746 |
-
" vertical-align: top;\n",
|
| 747 |
-
" }\n",
|
| 748 |
-
"\n",
|
| 749 |
-
" .dataframe thead th {\n",
|
| 750 |
-
" text-align: right;\n",
|
| 751 |
-
" }\n",
|
| 752 |
-
"</style>\n",
|
| 753 |
-
"<table border=\"1\" class=\"dataframe\">\n",
|
| 754 |
-
" <thead>\n",
|
| 755 |
-
" <tr style=\"text-align: right;\">\n",
|
| 756 |
-
" <th></th>\n",
|
| 757 |
-
" <th>sim</th>\n",
|
| 758 |
-
" <th>command</th>\n",
|
| 759 |
-
" </tr>\n",
|
| 760 |
-
" </thead>\n",
|
| 761 |
-
" <tbody>\n",
|
| 762 |
-
" </tbody>\n",
|
| 763 |
-
"</table>\n",
|
| 764 |
-
"</div>"
|
| 765 |
-
],
|
| 766 |
-
"text/plain": [
|
| 767 |
-
"Empty DataFrame\n",
|
| 768 |
-
"Columns: [sim, command]\n",
|
| 769 |
-
"Index: []"
|
| 770 |
-
]
|
| 771 |
-
},
|
| 772 |
-
"execution_count": 29,
|
| 773 |
-
"metadata": {},
|
| 774 |
-
"output_type": "execute_result"
|
| 775 |
-
}
|
| 776 |
-
],
|
| 777 |
-
"source": [
|
| 778 |
-
"df"
|
| 779 |
-
]
|
| 780 |
-
},
|
| 781 |
-
{
|
| 782 |
-
"cell_type": "code",
|
| 783 |
-
"execution_count": null,
|
| 784 |
-
"id": "c0457c5f-149a-41f3-a153-c5fbc19573ef",
|
| 785 |
-
"metadata": {},
|
| 786 |
-
"outputs": [],
|
| 787 |
-
"source": []
|
| 788 |
-
},
|
| 789 |
-
{
|
| 790 |
-
"cell_type": "code",
|
| 791 |
-
"execution_count": 30,
|
| 792 |
-
"id": "8b5c4536-f046-4872-b583-5f5be6b4bf41",
|
| 793 |
-
"metadata": {},
|
| 794 |
-
"outputs": [],
|
| 795 |
-
"source": [
|
| 796 |
-
"for command in embeddings:\n",
|
| 797 |
-
" sim = cosine_similarity(input_embedding, embeddings[command])\n",
|
| 798 |
-
" # print(f\":{sim:.4f}\\t{command}\")\n",
|
| 799 |
-
" df2 = pd.DataFrame({'sim': [sim], 'command': [command]})\n",
|
| 800 |
-
" df = pd.concat([df, df2])"
|
| 801 |
-
]
|
| 802 |
-
},
|
| 803 |
-
{
|
| 804 |
-
"cell_type": "code",
|
| 805 |
-
"execution_count": 31,
|
| 806 |
-
"id": "c4413de1-844b-4bed-be27-177c11229117",
|
| 807 |
-
"metadata": {},
|
| 808 |
-
"outputs": [
|
| 809 |
-
{
|
| 810 |
-
"data": {
|
| 811 |
-
"text/html": [
|
| 812 |
-
"<div>\n",
|
| 813 |
-
"<style scoped>\n",
|
| 814 |
-
" .dataframe tbody tr th:only-of-type {\n",
|
| 815 |
-
" vertical-align: middle;\n",
|
| 816 |
-
" }\n",
|
| 817 |
-
"\n",
|
| 818 |
-
" .dataframe tbody tr th {\n",
|
| 819 |
-
" vertical-align: top;\n",
|
| 820 |
-
" }\n",
|
| 821 |
-
"\n",
|
| 822 |
-
" .dataframe thead th {\n",
|
| 823 |
-
" text-align: right;\n",
|
| 824 |
-
" }\n",
|
| 825 |
-
"</style>\n",
|
| 826 |
-
"<table border=\"1\" class=\"dataframe\">\n",
|
| 827 |
-
" <thead>\n",
|
| 828 |
-
" <tr style=\"text-align: right;\">\n",
|
| 829 |
-
" <th></th>\n",
|
| 830 |
-
" <th>sim</th>\n",
|
| 831 |
-
" <th>command</th>\n",
|
| 832 |
-
" </tr>\n",
|
| 833 |
-
" </thead>\n",
|
| 834 |
-
" <tbody>\n",
|
| 835 |
-
" <tr>\n",
|
| 836 |
-
" <th>0</th>\n",
|
| 837 |
-
" <td>0.853803</td>\n",
|
| 838 |
-
" <td>add a bird.</td>\n",
|
| 839 |
-
" </tr>\n",
|
| 840 |
-
" <tr>\n",
|
| 841 |
-
" <th>0</th>\n",
|
| 842 |
-
" <td>0.839128</td>\n",
|
| 843 |
-
" <td>add more birds</td>\n",
|
| 844 |
-
" </tr>\n",
|
| 845 |
-
" <tr>\n",
|
| 846 |
-
" <th>0</th>\n",
|
| 847 |
-
" <td>0.852401</td>\n",
|
| 848 |
-
" <td>add a big bird</td>\n",
|
| 849 |
-
" </tr>\n",
|
| 850 |
-
" </tbody>\n",
|
| 851 |
-
"</table>\n",
|
| 852 |
-
"</div>"
|
| 853 |
-
],
|
| 854 |
-
"text/plain": [
|
| 855 |
-
" sim command\n",
|
| 856 |
-
"0 0.853803 add a bird.\n",
|
| 857 |
-
"0 0.839128 add more birds\n",
|
| 858 |
-
"0 0.852401 add a big bird"
|
| 859 |
-
]
|
| 860 |
-
},
|
| 861 |
-
"execution_count": 31,
|
| 862 |
-
"metadata": {},
|
| 863 |
-
"output_type": "execute_result"
|
| 864 |
-
}
|
| 865 |
-
],
|
| 866 |
-
"source": [
|
| 867 |
-
"df[0:3]"
|
| 868 |
-
]
|
| 869 |
-
},
|
| 870 |
-
{
|
| 871 |
-
"cell_type": "code",
|
| 872 |
-
"execution_count": 33,
|
| 873 |
-
"id": "436b68a4-70ff-495b-bcb5-e837b331606b",
|
| 874 |
-
"metadata": {},
|
| 875 |
-
"outputs": [
|
| 876 |
-
{
|
| 877 |
-
"data": {
|
| 878 |
-
"text/plain": [
|
| 879 |
-
"'add a red pig'"
|
| 880 |
-
]
|
| 881 |
-
},
|
| 882 |
-
"execution_count": 33,
|
| 883 |
-
"metadata": {},
|
| 884 |
-
"output_type": "execute_result"
|
| 885 |
-
}
|
| 886 |
-
],
|
| 887 |
-
"source": [
|
| 888 |
-
"input_command"
|
| 889 |
-
]
|
| 890 |
-
},
|
| 891 |
-
{
|
| 892 |
-
"cell_type": "code",
|
| 893 |
-
"execution_count": 34,
|
| 894 |
-
"id": "579a9788-fbea-4c2d-b5dd-9c6eaf20ee20",
|
| 895 |
-
"metadata": {},
|
| 896 |
-
"outputs": [
|
| 897 |
-
{
|
| 898 |
-
"data": {
|
| 899 |
-
"text/html": [
|
| 900 |
-
"<div>\n",
|
| 901 |
-
"<style scoped>\n",
|
| 902 |
-
" .dataframe tbody tr th:only-of-type {\n",
|
| 903 |
-
" vertical-align: middle;\n",
|
| 904 |
-
" }\n",
|
| 905 |
-
"\n",
|
| 906 |
-
" .dataframe tbody tr th {\n",
|
| 907 |
-
" vertical-align: top;\n",
|
| 908 |
-
" }\n",
|
| 909 |
-
"\n",
|
| 910 |
-
" .dataframe thead th {\n",
|
| 911 |
-
" text-align: right;\n",
|
| 912 |
-
" }\n",
|
| 913 |
-
"</style>\n",
|
| 914 |
-
"<table border=\"1\" class=\"dataframe\">\n",
|
| 915 |
-
" <thead>\n",
|
| 916 |
-
" <tr style=\"text-align: right;\">\n",
|
| 917 |
-
" <th></th>\n",
|
| 918 |
-
" <th>sim</th>\n",
|
| 919 |
-
" <th>command</th>\n",
|
| 920 |
-
" </tr>\n",
|
| 921 |
-
" </thead>\n",
|
| 922 |
-
" <tbody>\n",
|
| 923 |
-
" <tr>\n",
|
| 924 |
-
" <th>0</th>\n",
|
| 925 |
-
" <td>0.955520</td>\n",
|
| 926 |
-
" <td>add a pig</td>\n",
|
| 927 |
-
" </tr>\n",
|
| 928 |
-
" <tr>\n",
|
| 929 |
-
" <th>0</th>\n",
|
| 930 |
-
" <td>0.864960</td>\n",
|
| 931 |
-
" <td>Our pigs are loosing. Add more pigs</td>\n",
|
| 932 |
-
" </tr>\n",
|
| 933 |
-
" <tr>\n",
|
| 934 |
-
" <th>0</th>\n",
|
| 935 |
-
" <td>0.853803</td>\n",
|
| 936 |
-
" <td>add a bird.</td>\n",
|
| 937 |
-
" </tr>\n",
|
| 938 |
-
" <tr>\n",
|
| 939 |
-
" <th>0</th>\n",
|
| 940 |
-
" <td>0.852401</td>\n",
|
| 941 |
-
" <td>add a big bird</td>\n",
|
| 942 |
-
" </tr>\n",
|
| 943 |
-
" <tr>\n",
|
| 944 |
-
" <th>0</th>\n",
|
| 945 |
-
" <td>0.840981</td>\n",
|
| 946 |
-
" <td>The pigs are too week. Increase the blood leve...</td>\n",
|
| 947 |
-
" </tr>\n",
|
| 948 |
-
" </tbody>\n",
|
| 949 |
-
"</table>\n",
|
| 950 |
-
"</div>"
|
| 951 |
-
],
|
| 952 |
-
"text/plain": [
|
| 953 |
-
" sim command\n",
|
| 954 |
-
"0 0.955520 add a pig\n",
|
| 955 |
-
"0 0.864960 Our pigs are loosing. Add more pigs\n",
|
| 956 |
-
"0 0.853803 add a bird.\n",
|
| 957 |
-
"0 0.852401 add a big bird\n",
|
| 958 |
-
"0 0.840981 The pigs are too week. Increase the blood leve..."
|
| 959 |
-
]
|
| 960 |
-
},
|
| 961 |
-
"execution_count": 34,
|
| 962 |
-
"metadata": {},
|
| 963 |
-
"output_type": "execute_result"
|
| 964 |
-
}
|
| 965 |
-
],
|
| 966 |
-
"source": [
|
| 967 |
-
"df.sort_values('sim', ascending=False)[:5]"
|
| 968 |
-
]
|
| 969 |
-
},
|
| 970 |
-
{
|
| 971 |
-
"cell_type": "code",
|
| 972 |
-
"execution_count": null,
|
| 973 |
-
"id": "41df04aa-4aaf-48ef-8fb8-fc4c0c743b9f",
|
| 974 |
-
"metadata": {},
|
| 975 |
-
"outputs": [],
|
| 976 |
-
"source": []
|
| 977 |
-
},
|
| 978 |
-
{
|
| 979 |
-
"cell_type": "code",
|
| 980 |
-
"execution_count": null,
|
| 981 |
-
"id": "a6910b5c-ae29-4988-b4eb-218efb594689",
|
| 982 |
-
"metadata": {},
|
| 983 |
-
"outputs": [],
|
| 984 |
-
"source": [
|
| 985 |
-
"assert False"
|
| 986 |
-
]
|
| 987 |
-
},
|
| 988 |
-
{
|
| 989 |
-
"cell_type": "code",
|
| 990 |
-
"execution_count": null,
|
| 991 |
-
"id": "93ed444b-e938-4923-be55-525481c23615",
|
| 992 |
-
"metadata": {},
|
| 993 |
-
"outputs": [],
|
| 994 |
-
"source": [
|
| 995 |
-
"res = query(command)"
|
| 996 |
-
]
|
| 997 |
-
},
|
| 998 |
-
{
|
| 999 |
-
"cell_type": "code",
|
| 1000 |
-
"execution_count": null,
|
| 1001 |
-
"id": "a0aa2da0-9560-4496-ac5f-610b4946e082",
|
| 1002 |
-
"metadata": {},
|
| 1003 |
-
"outputs": [],
|
| 1004 |
-
"source": [
|
| 1005 |
-
"res"
|
| 1006 |
-
]
|
| 1007 |
-
},
|
| 1008 |
-
{
|
| 1009 |
-
"cell_type": "code",
|
| 1010 |
-
"execution_count": null,
|
| 1011 |
-
"id": "fa3287e7-a4fe-44ee-aa55-50ea88968d65",
|
| 1012 |
-
"metadata": {},
|
| 1013 |
-
"outputs": [],
|
| 1014 |
-
"source": [
|
| 1015 |
-
"type(res)"
|
| 1016 |
-
]
|
| 1017 |
-
},
|
| 1018 |
-
{
|
| 1019 |
-
"cell_type": "code",
|
| 1020 |
-
"execution_count": null,
|
| 1021 |
-
"id": "2ef74c20-8859-4280-acd2-4c181a83bbef",
|
| 1022 |
-
"metadata": {},
|
| 1023 |
-
"outputs": [],
|
| 1024 |
-
"source": []
|
| 1025 |
-
},
|
| 1026 |
-
{
|
| 1027 |
-
"cell_type": "code",
|
| 1028 |
-
"execution_count": null,
|
| 1029 |
-
"id": "b1ad0047-e5b9-4aea-abfb-3881458531e1",
|
| 1030 |
-
"metadata": {},
|
| 1031 |
-
"outputs": [],
|
| 1032 |
-
"source": [
|
| 1033 |
-
"x"
|
| 1034 |
-
]
|
| 1035 |
-
},
|
| 1036 |
-
{
|
| 1037 |
-
"cell_type": "code",
|
| 1038 |
-
"execution_count": null,
|
| 1039 |
-
"id": "59405568-618d-44c8-8c23-ec3a6fd1b347",
|
| 1040 |
-
"metadata": {},
|
| 1041 |
-
"outputs": [],
|
| 1042 |
-
"source": [
|
| 1043 |
-
"x['data']"
|
| 1044 |
-
]
|
| 1045 |
-
},
|
| 1046 |
-
{
|
| 1047 |
-
"cell_type": "code",
|
| 1048 |
-
"execution_count": null,
|
| 1049 |
-
"id": "876bd705-c36c-44e8-a0ad-c3a1cb68237a",
|
| 1050 |
-
"metadata": {},
|
| 1051 |
-
"outputs": [],
|
| 1052 |
-
"source": [
|
| 1053 |
-
"json.loads(x['data'][0])"
|
| 1054 |
-
]
|
| 1055 |
-
},
|
| 1056 |
-
{
|
| 1057 |
-
"cell_type": "code",
|
| 1058 |
-
"execution_count": null,
|
| 1059 |
-
"id": "9148abdc-8ddb-49de-a709-69ed838a53b6",
|
| 1060 |
-
"metadata": {},
|
| 1061 |
-
"outputs": [],
|
| 1062 |
-
"source": []
|
| 1063 |
-
},
|
| 1064 |
-
{
|
| 1065 |
-
"cell_type": "code",
|
| 1066 |
-
"execution_count": null,
|
| 1067 |
-
"id": "b86d999b-30b6-48b1-8eca-589651392caf",
|
| 1068 |
-
"metadata": {},
|
| 1069 |
-
"outputs": [],
|
| 1070 |
-
"source": [
|
| 1071 |
-
"x= json.loads(res)\n",
|
| 1072 |
-
"x"
|
| 1073 |
-
]
|
| 1074 |
-
},
|
| 1075 |
-
{
|
| 1076 |
-
"cell_type": "code",
|
| 1077 |
-
"execution_count": null,
|
| 1078 |
-
"id": "0c2828ac-af6c-4592-8b96-9f318f16fa56",
|
| 1079 |
-
"metadata": {},
|
| 1080 |
-
"outputs": [],
|
| 1081 |
-
"source": [
|
| 1082 |
-
"['please modify your request']"
|
| 1083 |
-
]
|
| 1084 |
-
},
|
| 1085 |
-
{
|
| 1086 |
-
"cell_type": "code",
|
| 1087 |
-
"execution_count": null,
|
| 1088 |
-
"id": "751e8f6d-5e5c-4d6f-90b1-08271c287fdf",
|
| 1089 |
-
"metadata": {},
|
| 1090 |
-
"outputs": [],
|
| 1091 |
-
"source": [
|
| 1092 |
-
"type(x)"
|
| 1093 |
-
]
|
| 1094 |
-
},
|
| 1095 |
-
{
|
| 1096 |
-
"cell_type": "code",
|
| 1097 |
-
"execution_count": null,
|
| 1098 |
-
"id": "c274efb2-d6fd-4dd0-beff-1ea3e0e74207",
|
| 1099 |
-
"metadata": {},
|
| 1100 |
-
"outputs": [],
|
| 1101 |
-
"source": [
|
| 1102 |
-
"x[0]"
|
| 1103 |
-
]
|
| 1104 |
-
},
|
| 1105 |
-
{
|
| 1106 |
-
"cell_type": "code",
|
| 1107 |
-
"execution_count": null,
|
| 1108 |
-
"id": "56446edc-1708-4387-ade8-4da5b217553b",
|
| 1109 |
-
"metadata": {},
|
| 1110 |
-
"outputs": [],
|
| 1111 |
-
"source": [
|
| 1112 |
-
"len(x)"
|
| 1113 |
-
]
|
| 1114 |
-
},
|
| 1115 |
-
{
|
| 1116 |
-
"cell_type": "code",
|
| 1117 |
-
"execution_count": null,
|
| 1118 |
-
"id": "e3263229-c828-4ec4-9790-d90e08d4ca62",
|
| 1119 |
-
"metadata": {},
|
| 1120 |
-
"outputs": [],
|
| 1121 |
-
"source": []
|
| 1122 |
-
},
|
| 1123 |
-
{
|
| 1124 |
-
"cell_type": "code",
|
| 1125 |
-
"execution_count": null,
|
| 1126 |
-
"id": "04e2ffc0-3451-44aa-abe0-879c30f4eded",
|
| 1127 |
-
"metadata": {},
|
| 1128 |
-
"outputs": [],
|
| 1129 |
-
"source": [
|
| 1130 |
-
"res"
|
| 1131 |
-
]
|
| 1132 |
-
},
|
| 1133 |
-
{
|
| 1134 |
-
"cell_type": "code",
|
| 1135 |
-
"execution_count": null,
|
| 1136 |
-
"id": "dc16a485-71e0-4c09-8ee1-4b5ee5079d5f",
|
| 1137 |
-
"metadata": {},
|
| 1138 |
-
"outputs": [],
|
| 1139 |
-
"source": [
|
| 1140 |
-
"json.loads(res)"
|
| 1141 |
-
]
|
| 1142 |
-
},
|
| 1143 |
-
{
|
| 1144 |
-
"cell_type": "code",
|
| 1145 |
-
"execution_count": null,
|
| 1146 |
-
"id": "66b26cd3-f7ae-4652-8982-576069b23224",
|
| 1147 |
-
"metadata": {},
|
| 1148 |
-
"outputs": [],
|
| 1149 |
-
"source": [
|
| 1150 |
-
"print(f\"{command}\\n\\t{json.loads(res)}\\n\")"
|
| 1151 |
-
]
|
| 1152 |
-
},
|
| 1153 |
-
{
|
| 1154 |
-
"cell_type": "code",
|
| 1155 |
-
"execution_count": null,
|
| 1156 |
-
"id": "3daf7e67-a149-4c9e-bf7d-b8e90764af4b",
|
| 1157 |
-
"metadata": {},
|
| 1158 |
-
"outputs": [],
|
| 1159 |
-
"source": [
|
| 1160 |
-
"res"
|
| 1161 |
-
]
|
| 1162 |
-
},
|
| 1163 |
-
{
|
| 1164 |
-
"cell_type": "code",
|
| 1165 |
-
"execution_count": null,
|
| 1166 |
-
"id": "55511792-72ed-48ee-8585-35699f118017",
|
| 1167 |
-
"metadata": {},
|
| 1168 |
-
"outputs": [],
|
| 1169 |
-
"source": [
|
| 1170 |
-
"import time"
|
| 1171 |
-
]
|
| 1172 |
-
},
|
| 1173 |
-
{
|
| 1174 |
-
"cell_type": "code",
|
| 1175 |
-
"execution_count": null,
|
| 1176 |
-
"id": "739321a6-1ba6-4124-b7cc-5d78a94e47a6",
|
| 1177 |
-
"metadata": {},
|
| 1178 |
-
"outputs": [],
|
| 1179 |
-
"source": [
|
| 1180 |
-
"time.sleep(3)"
|
| 1181 |
-
]
|
| 1182 |
-
},
|
| 1183 |
-
{
|
| 1184 |
-
"cell_type": "code",
|
| 1185 |
-
"execution_count": null,
|
| 1186 |
-
"id": "5a2d1414-cc65-42f8-ad74-196443dd918b",
|
| 1187 |
-
"metadata": {},
|
| 1188 |
-
"outputs": [],
|
| 1189 |
-
"source": [
|
| 1190 |
-
"datetime.today()"
|
| 1191 |
-
]
|
| 1192 |
-
},
|
| 1193 |
-
{
|
| 1194 |
-
"cell_type": "code",
|
| 1195 |
-
"execution_count": null,
|
| 1196 |
-
"id": "1b827bad-2bdf-4f3a-85b8-3ab2243207fa",
|
| 1197 |
-
"metadata": {},
|
| 1198 |
-
"outputs": [],
|
| 1199 |
-
"source": [
|
| 1200 |
-
"for i, command in enumerate(config.game_commands):\n",
|
| 1201 |
-
" res = query(command)\n",
|
| 1202 |
-
" print(f\"\\n{i+1}/{len(config.game_commands)}\\t{command}\\n\\t{json.loads(res)}\\n\")\n",
|
| 1203 |
-
" time.sleep(10)"
|
| 1204 |
-
]
|
| 1205 |
-
},
|
| 1206 |
-
{
|
| 1207 |
-
"cell_type": "code",
|
| 1208 |
-
"execution_count": null,
|
| 1209 |
-
"id": "82ff07d2-33e3-4e01-8023-9941d5fd2714",
|
| 1210 |
-
"metadata": {},
|
| 1211 |
-
"outputs": [],
|
| 1212 |
-
"source": []
|
| 1213 |
-
},
|
| 1214 |
-
{
|
| 1215 |
-
"cell_type": "code",
|
| 1216 |
-
"execution_count": null,
|
| 1217 |
-
"id": "a6b0aa67-5272-46f8-b065-8b9c97183bcd",
|
| 1218 |
-
"metadata": {},
|
| 1219 |
-
"outputs": [],
|
| 1220 |
-
"source": [
|
| 1221 |
-
"for i, command in enumerate(config.game_commands):\n",
|
| 1222 |
-
" res = query(command)\n",
|
| 1223 |
-
" print(f\"\\n{i+1}/{len(config.game_commands)}\\t{command}\\n\\t{json.loads(res)}\\n\")\n",
|
| 1224 |
-
" time.sleep(3)"
|
| 1225 |
-
]
|
| 1226 |
-
},
|
| 1227 |
-
{
|
| 1228 |
-
"cell_type": "code",
|
| 1229 |
-
"execution_count": null,
|
| 1230 |
-
"id": "ef911a45-51c3-4403-a91a-1d73ca536fb6",
|
| 1231 |
-
"metadata": {},
|
| 1232 |
-
"outputs": [],
|
| 1233 |
-
"source": []
|
| 1234 |
-
},
|
| 1235 |
-
{
|
| 1236 |
-
"cell_type": "code",
|
| 1237 |
-
"execution_count": null,
|
| 1238 |
-
"id": "758ac7f0-50c6-462c-95f9-f40788878e44",
|
| 1239 |
-
"metadata": {},
|
| 1240 |
-
"outputs": [],
|
| 1241 |
-
"source": []
|
| 1242 |
-
}
|
| 1243 |
-
],
|
| 1244 |
-
"metadata": {
|
| 1245 |
-
"kernelspec": {
|
| 1246 |
-
"display_name": "Python 3 (ipykernel)",
|
| 1247 |
-
"language": "python",
|
| 1248 |
-
"name": "python3"
|
| 1249 |
-
},
|
| 1250 |
-
"language_info": {
|
| 1251 |
-
"codemirror_mode": {
|
| 1252 |
-
"name": "ipython",
|
| 1253 |
-
"version": 3
|
| 1254 |
-
},
|
| 1255 |
-
"file_extension": ".py",
|
| 1256 |
-
"mimetype": "text/x-python",
|
| 1257 |
-
"name": "python",
|
| 1258 |
-
"nbconvert_exporter": "python",
|
| 1259 |
-
"pygments_lexer": "ipython3",
|
| 1260 |
-
"version": "3.11.4"
|
| 1261 |
-
}
|
| 1262 |
-
},
|
| 1263 |
-
"nbformat": 4,
|
| 1264 |
-
"nbformat_minor": 5
|
| 1265 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
games/angrybirds/notebooks/to_anhang.ipynb
DELETED
|
@@ -1,529 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "code",
|
| 5 |
-
"execution_count": 1,
|
| 6 |
-
"id": "245fbc34-352d-4945-a689-d04f9365bb99",
|
| 7 |
-
"metadata": {},
|
| 8 |
-
"outputs": [],
|
| 9 |
-
"source": [
|
| 10 |
-
"%load_ext autoreload\n",
|
| 11 |
-
"%autoreload 2"
|
| 12 |
-
]
|
| 13 |
-
},
|
| 14 |
-
{
|
| 15 |
-
"cell_type": "code",
|
| 16 |
-
"execution_count": 2,
|
| 17 |
-
"id": "eaed216c-160a-4e31-96fe-015c140ff18b",
|
| 18 |
-
"metadata": {},
|
| 19 |
-
"outputs": [],
|
| 20 |
-
"source": [
|
| 21 |
-
"# from pprint import pprint"
|
| 22 |
-
]
|
| 23 |
-
},
|
| 24 |
-
{
|
| 25 |
-
"cell_type": "code",
|
| 26 |
-
"execution_count": 3,
|
| 27 |
-
"id": "97953551-8ef1-42c1-9317-99d5e65f535e",
|
| 28 |
-
"metadata": {},
|
| 29 |
-
"outputs": [
|
| 30 |
-
{
|
| 31 |
-
"name": "stdout",
|
| 32 |
-
"output_type": "stream",
|
| 33 |
-
"text": [
|
| 34 |
-
"723\n",
|
| 35 |
-
"770\n"
|
| 36 |
-
]
|
| 37 |
-
}
|
| 38 |
-
],
|
| 39 |
-
"source": [
|
| 40 |
-
"import json\n",
|
| 41 |
-
"import pandas as pd\n",
|
| 42 |
-
"\n",
|
| 43 |
-
"import openai\n",
|
| 44 |
-
"# from openai.embeddings_utils import get_embedding, cosine_similarity\n",
|
| 45 |
-
"\n",
|
| 46 |
-
"# from games.angrybirds.util import util\n",
|
| 47 |
-
"from games.angrybirds.config import config\n",
|
| 48 |
-
"# from games.angrybirds.prompt import prompt\n",
|
| 49 |
-
"# from games.angrybirds.query import query, yes_no_query\n",
|
| 50 |
-
"from games.angrybirds.angrybirds import angrybird"
|
| 51 |
-
]
|
| 52 |
-
},
|
| 53 |
-
{
|
| 54 |
-
"cell_type": "code",
|
| 55 |
-
"execution_count": null,
|
| 56 |
-
"id": "ae27ebd0-2d95-4ff0-b188-f6e46b189cd1",
|
| 57 |
-
"metadata": {},
|
| 58 |
-
"outputs": [],
|
| 59 |
-
"source": []
|
| 60 |
-
},
|
| 61 |
-
{
|
| 62 |
-
"cell_type": "code",
|
| 63 |
-
"execution_count": 19,
|
| 64 |
-
"id": "766fda6a-71c8-48a8-941b-0493e7f41584",
|
| 65 |
-
"metadata": {},
|
| 66 |
-
"outputs": [],
|
| 67 |
-
"source": [
|
| 68 |
-
"# json.loads(modify_request)"
|
| 69 |
-
]
|
| 70 |
-
},
|
| 71 |
-
{
|
| 72 |
-
"cell_type": "code",
|
| 73 |
-
"execution_count": 22,
|
| 74 |
-
"id": "f7f67984-540b-4aa3-ba4d-f95d4570fce8",
|
| 75 |
-
"metadata": {},
|
| 76 |
-
"outputs": [
|
| 77 |
-
{
|
| 78 |
-
"data": {
|
| 79 |
-
"text/plain": [
|
| 80 |
-
"50"
|
| 81 |
-
]
|
| 82 |
-
},
|
| 83 |
-
"execution_count": 22,
|
| 84 |
-
"metadata": {},
|
| 85 |
-
"output_type": "execute_result"
|
| 86 |
-
}
|
| 87 |
-
],
|
| 88 |
-
"source": [
|
| 89 |
-
"len(list(config.game_examples.keys()))"
|
| 90 |
-
]
|
| 91 |
-
},
|
| 92 |
-
{
|
| 93 |
-
"cell_type": "code",
|
| 94 |
-
"execution_count": 23,
|
| 95 |
-
"id": "4edf89fb-0b93-4d1a-b9c2-341417128a45",
|
| 96 |
-
"metadata": {},
|
| 97 |
-
"outputs": [
|
| 98 |
-
{
|
| 99 |
-
"data": {
|
| 100 |
-
"text/plain": [
|
| 101 |
-
"['Add a bird.',\n",
|
| 102 |
-
" 'Delete a bird.',\n",
|
| 103 |
-
" 'Add more birds.',\n",
|
| 104 |
-
" 'Add a big bird.',\n",
|
| 105 |
-
" 'Add a magnet bird.',\n",
|
| 106 |
-
" 'Add a superheavy bird.',\n",
|
| 107 |
-
" 'Add a catapult bird.',\n",
|
| 108 |
-
" 'Add a flash bird.',\n",
|
| 109 |
-
" 'Add an antigravity bird.',\n",
|
| 110 |
-
" 'The game is too difficult. Please add more birds.',\n",
|
| 111 |
-
" 'Make the bird bigger.',\n",
|
| 112 |
-
" 'Make the bird bigger, so it can run over the enemies.',\n",
|
| 113 |
-
" 'List birds.',\n",
|
| 114 |
-
" 'Show bird list.',\n",
|
| 115 |
-
" 'What kind of birds do you have?',\n",
|
| 116 |
-
" 'Are there new kinds of birds?',\n",
|
| 117 |
-
" 'I want to change the positon of birds',\n",
|
| 118 |
-
" 'I want to change the positon of pigs',\n",
|
| 119 |
-
" 'I want to change the positon of houses',\n",
|
| 120 |
-
" 'I want to change the positon of obstacles',\n",
|
| 121 |
-
" 'Add a pig.',\n",
|
| 122 |
-
" 'Please add two pigs.',\n",
|
| 123 |
-
" 'Please add 2 pigs.',\n",
|
| 124 |
-
" 'Please add three pigs.',\n",
|
| 125 |
-
" 'Please add 3 pigs.',\n",
|
| 126 |
-
" 'Please add four pigs.',\n",
|
| 127 |
-
" 'Please add 4 pigs.',\n",
|
| 128 |
-
" 'Please add five pigs.',\n",
|
| 129 |
-
" 'Please add 5 pigs.',\n",
|
| 130 |
-
" 'Please add six pigs.',\n",
|
| 131 |
-
" 'Please add 6 pigs.',\n",
|
| 132 |
-
" 'Please add seven pigs.',\n",
|
| 133 |
-
" 'Please add 7 pigs.',\n",
|
| 134 |
-
" 'Please add eight pigs.',\n",
|
| 135 |
-
" 'Please add 8 pigs.',\n",
|
| 136 |
-
" 'Please add nine pigs.',\n",
|
| 137 |
-
" 'Please add 9 pigs.',\n",
|
| 138 |
-
" 'Please add ten pigs.',\n",
|
| 139 |
-
" 'Please add 10 pigs.',\n",
|
| 140 |
-
" 'I want to make pigs everywehre.',\n",
|
| 141 |
-
" 'Our pigs are losing. Add more pigs.',\n",
|
| 142 |
-
" 'The pigs are too week. Increase the health points for them.',\n",
|
| 143 |
-
" 'The pigs are too week. Increase the HP for them.',\n",
|
| 144 |
-
" 'The pigs are too week. Increase the hit points for them.',\n",
|
| 145 |
-
" 'The pigs are too week. Increase the blood level for them.',\n",
|
| 146 |
-
" 'The pigs are too week. Increase the blood levels for them.',\n",
|
| 147 |
-
" 'I want to protect the pigs by build houses for them.',\n",
|
| 148 |
-
" 'I want to build houses.',\n",
|
| 149 |
-
" 'I want to build houses, so I can protect my pigs.',\n",
|
| 150 |
-
" \"The obstacles are too weak. Let's build some solid houses.\"]"
|
| 151 |
-
]
|
| 152 |
-
},
|
| 153 |
-
"execution_count": 23,
|
| 154 |
-
"metadata": {},
|
| 155 |
-
"output_type": "execute_result"
|
| 156 |
-
}
|
| 157 |
-
],
|
| 158 |
-
"source": [
|
| 159 |
-
"list(config.game_examples.keys())"
|
| 160 |
-
]
|
| 161 |
-
},
|
| 162 |
-
{
|
| 163 |
-
"cell_type": "code",
|
| 164 |
-
"execution_count": 24,
|
| 165 |
-
"id": "4ae67ee9-2907-4811-8dae-aeb2140c827d",
|
| 166 |
-
"metadata": {},
|
| 167 |
-
"outputs": [
|
| 168 |
-
{
|
| 169 |
-
"data": {
|
| 170 |
-
"text/plain": [
|
| 171 |
-
"'Add a bird.'"
|
| 172 |
-
]
|
| 173 |
-
},
|
| 174 |
-
"execution_count": 24,
|
| 175 |
-
"metadata": {},
|
| 176 |
-
"output_type": "execute_result"
|
| 177 |
-
}
|
| 178 |
-
],
|
| 179 |
-
"source": [
|
| 180 |
-
"command = list(config.game_examples.keys())[0]\n",
|
| 181 |
-
"command"
|
| 182 |
-
]
|
| 183 |
-
},
|
| 184 |
-
{
|
| 185 |
-
"cell_type": "code",
|
| 186 |
-
"execution_count": 25,
|
| 187 |
-
"id": "b625856c-b9ea-4d57-83dd-99e57b0d3404",
|
| 188 |
-
"metadata": {},
|
| 189 |
-
"outputs": [],
|
| 190 |
-
"source": [
|
| 191 |
-
"# test"
|
| 192 |
-
]
|
| 193 |
-
},
|
| 194 |
-
{
|
| 195 |
-
"cell_type": "code",
|
| 196 |
-
"execution_count": 32,
|
| 197 |
-
"id": "be16a49a-7b4f-4842-b079-19728e50eecc",
|
| 198 |
-
"metadata": {},
|
| 199 |
-
"outputs": [
|
| 200 |
-
{
|
| 201 |
-
"data": {
|
| 202 |
-
"text/plain": [
|
| 203 |
-
"['The game developer is talking about birds.',\n",
|
| 204 |
-
" 'The game developer wants to add a bird.']"
|
| 205 |
-
]
|
| 206 |
-
},
|
| 207 |
-
"execution_count": 32,
|
| 208 |
-
"metadata": {},
|
| 209 |
-
"output_type": "execute_result"
|
| 210 |
-
}
|
| 211 |
-
],
|
| 212 |
-
"source": [
|
| 213 |
-
"prompts = config.game_examples[command]['prompt']\n",
|
| 214 |
-
"prompts"
|
| 215 |
-
]
|
| 216 |
-
},
|
| 217 |
-
{
|
| 218 |
-
"cell_type": "code",
|
| 219 |
-
"execution_count": 34,
|
| 220 |
-
"id": "522394aa-7805-4ab3-a95e-b7826d0759e7",
|
| 221 |
-
"metadata": {},
|
| 222 |
-
"outputs": [
|
| 223 |
-
{
|
| 224 |
-
"data": {
|
| 225 |
-
"text/plain": [
|
| 226 |
-
"['bird', 'add', {}]"
|
| 227 |
-
]
|
| 228 |
-
},
|
| 229 |
-
"execution_count": 34,
|
| 230 |
-
"metadata": {},
|
| 231 |
-
"output_type": "execute_result"
|
| 232 |
-
}
|
| 233 |
-
],
|
| 234 |
-
"source": [
|
| 235 |
-
"returns = config.game_examples[command]['result']\n",
|
| 236 |
-
"returns"
|
| 237 |
-
]
|
| 238 |
-
},
|
| 239 |
-
{
|
| 240 |
-
"cell_type": "code",
|
| 241 |
-
"execution_count": null,
|
| 242 |
-
"id": "e198dbe4-3b28-4b7b-a9b1-cb1245692fa9",
|
| 243 |
-
"metadata": {},
|
| 244 |
-
"outputs": [],
|
| 245 |
-
"source": []
|
| 246 |
-
},
|
| 247 |
-
{
|
| 248 |
-
"cell_type": "code",
|
| 249 |
-
"execution_count": 26,
|
| 250 |
-
"id": "1f168079-4a85-4a09-bfa2-11cea105a21e",
|
| 251 |
-
"metadata": {},
|
| 252 |
-
"outputs": [],
|
| 253 |
-
"source": [
|
| 254 |
-
"bird = angrybird()\n",
|
| 255 |
-
"# bird.init_emb()"
|
| 256 |
-
]
|
| 257 |
-
},
|
| 258 |
-
{
|
| 259 |
-
"cell_type": "code",
|
| 260 |
-
"execution_count": 12,
|
| 261 |
-
"id": "2d4abff5-2b19-4ea5-98ca-453a9d2139d0",
|
| 262 |
-
"metadata": {},
|
| 263 |
-
"outputs": [
|
| 264 |
-
{
|
| 265 |
-
"name": "stdout",
|
| 266 |
-
"output_type": "stream",
|
| 267 |
-
"text": [
|
| 268 |
-
"\n",
|
| 269 |
-
"====================\n",
|
| 270 |
-
"--------------------\n",
|
| 271 |
-
"Make the bird bigger, so it can run over the enemies.\n",
|
| 272 |
-
"The game developer is talking about birds.\n",
|
| 273 |
-
"0.6667 10/15\tn\n",
|
| 274 |
-
"[('n', 10), ('y', 5)]\n"
|
| 275 |
-
]
|
| 276 |
-
},
|
| 277 |
-
{
|
| 278 |
-
"ename": "AssertionError",
|
| 279 |
-
"evalue": "",
|
| 280 |
-
"output_type": "error",
|
| 281 |
-
"traceback": [
|
| 282 |
-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
| 283 |
-
"\u001b[0;31mAssertionError\u001b[0m Traceback (most recent call last)",
|
| 284 |
-
"Cell \u001b[0;32mIn[12], line 14\u001b[0m\n\u001b[1;32m 12\u001b[0m \u001b[38;5;28mprint\u001b[39m(command)\n\u001b[1;32m 13\u001b[0m \u001b[38;5;28mprint\u001b[39m(prompt)\n\u001b[0;32m---> 14\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m yes_no_query(bird, command, prompt) \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124my\u001b[39m\u001b[38;5;124m'\u001b[39m\n",
|
| 285 |
-
"\u001b[0;31mAssertionError\u001b[0m: "
|
| 286 |
-
]
|
| 287 |
-
}
|
| 288 |
-
],
|
| 289 |
-
"source": [
|
| 290 |
-
"for command in config.game_examples:\n",
|
| 291 |
-
" if 'prompt' not in config.game_examples[command]:\n",
|
| 292 |
-
" continue\n",
|
| 293 |
-
"\n",
|
| 294 |
-
" if 'train' in config.game_examples[command]:\n",
|
| 295 |
-
" continue\n",
|
| 296 |
-
" prompts = config.game_examples[command]['prompt']\n",
|
| 297 |
-
" print()\n",
|
| 298 |
-
" print('='*20)\n",
|
| 299 |
-
" for prompt in prompts:\n",
|
| 300 |
-
" print('-'*20)\n",
|
| 301 |
-
" print(command)\n",
|
| 302 |
-
" print(prompt)\n",
|
| 303 |
-
" assert yes_no_query(bird, command, prompt) == 'y'"
|
| 304 |
-
]
|
| 305 |
-
},
|
| 306 |
-
{
|
| 307 |
-
"cell_type": "code",
|
| 308 |
-
"execution_count": null,
|
| 309 |
-
"id": "6bc6d2fb-ff82-44c3-8a78-33f577f60d64",
|
| 310 |
-
"metadata": {},
|
| 311 |
-
"outputs": [],
|
| 312 |
-
"source": []
|
| 313 |
-
},
|
| 314 |
-
{
|
| 315 |
-
"cell_type": "code",
|
| 316 |
-
"execution_count": 30,
|
| 317 |
-
"id": "fba16d64-8981-4bc1-bc3e-facc2e263f96",
|
| 318 |
-
"metadata": {},
|
| 319 |
-
"outputs": [],
|
| 320 |
-
"source": [
|
| 321 |
-
"s = {}\n",
|
| 322 |
-
"for command in config.game_examples:\n",
|
| 323 |
-
" if 'train' not in config.game_examples[command]:\n",
|
| 324 |
-
" continue\n",
|
| 325 |
-
" s[command] = {}\n",
|
| 326 |
-
" s[command]['result'] = config.game_examples[command]['result']\n",
|
| 327 |
-
" # s[command]['desc'] = config.game_examples[command]['desc']\n",
|
| 328 |
-
"res = {\n",
|
| 329 |
-
" 'version': '1.0-2023-07-26-a',\n",
|
| 330 |
-
" 'data': s,\n",
|
| 331 |
-
"}"
|
| 332 |
-
]
|
| 333 |
-
},
|
| 334 |
-
{
|
| 335 |
-
"cell_type": "code",
|
| 336 |
-
"execution_count": null,
|
| 337 |
-
"id": "572dfa7d-bdc7-4c5c-875e-7d2779d60d72",
|
| 338 |
-
"metadata": {},
|
| 339 |
-
"outputs": [],
|
| 340 |
-
"source": []
|
| 341 |
-
},
|
| 342 |
-
{
|
| 343 |
-
"cell_type": "code",
|
| 344 |
-
"execution_count": 31,
|
| 345 |
-
"id": "c9c376d6-75e8-4ba0-9aa3-f0b673d1646c",
|
| 346 |
-
"metadata": {},
|
| 347 |
-
"outputs": [
|
| 348 |
-
{
|
| 349 |
-
"ename": "SyntaxError",
|
| 350 |
-
"evalue": "'return' outside function (3844427982.py, line 1)",
|
| 351 |
-
"output_type": "error",
|
| 352 |
-
"traceback": [
|
| 353 |
-
"\u001b[0;36m Cell \u001b[0;32mIn[31], line 1\u001b[0;36m\u001b[0m\n\u001b[0;31m return json.dumps(res, indent=4), \"\"\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m 'return' outside function\n"
|
| 354 |
-
]
|
| 355 |
-
}
|
| 356 |
-
],
|
| 357 |
-
"source": [
|
| 358 |
-
"return json.dumps(res, indent=4), \"\""
|
| 359 |
-
]
|
| 360 |
-
},
|
| 361 |
-
{
|
| 362 |
-
"cell_type": "code",
|
| 363 |
-
"execution_count": 49,
|
| 364 |
-
"id": "ca386aa5-762f-4c6c-b601-2388d87dfb97",
|
| 365 |
-
"metadata": {},
|
| 366 |
-
"outputs": [],
|
| 367 |
-
"source": [
|
| 368 |
-
"s = {}\n",
|
| 369 |
-
"for command in config.game_examples:\n",
|
| 370 |
-
" if 'train' not in config.game_examples[command]:\n",
|
| 371 |
-
" continue\n",
|
| 372 |
-
" s[command] = {}\n",
|
| 373 |
-
" s[command]['result'] = config.game_examples[command]['result']"
|
| 374 |
-
]
|
| 375 |
-
},
|
| 376 |
-
{
|
| 377 |
-
"cell_type": "code",
|
| 378 |
-
"execution_count": 32,
|
| 379 |
-
"id": "60a451d8-0fc5-4d8b-935f-10016a9b1560",
|
| 380 |
-
"metadata": {},
|
| 381 |
-
"outputs": [],
|
| 382 |
-
"source": [
|
| 383 |
-
"ss = json.dumps(res, indent=4)"
|
| 384 |
-
]
|
| 385 |
-
},
|
| 386 |
-
{
|
| 387 |
-
"cell_type": "code",
|
| 388 |
-
"execution_count": null,
|
| 389 |
-
"id": "4d5aea15-e2d2-47d5-b579-8166ed426040",
|
| 390 |
-
"metadata": {},
|
| 391 |
-
"outputs": [],
|
| 392 |
-
"source": []
|
| 393 |
-
},
|
| 394 |
-
{
|
| 395 |
-
"cell_type": "code",
|
| 396 |
-
"execution_count": 33,
|
| 397 |
-
"id": "52161707-0a42-4deb-849a-c07fcd9644f3",
|
| 398 |
-
"metadata": {},
|
| 399 |
-
"outputs": [
|
| 400 |
-
{
|
| 401 |
-
"data": {
|
| 402 |
-
"text/plain": [
|
| 403 |
-
"{'version': '1.0-2023-07-26-a',\n",
|
| 404 |
-
" 'data': {'Add a bird.': {'result': ['bird', 'add', {}]},\n",
|
| 405 |
-
" 'Delete a bird.': {'result': ['bird', 'add', {'quantiy': -1}]},\n",
|
| 406 |
-
" 'Add more birds.': {'result': ['bird', 'add', {'quantiy': 'some'}]},\n",
|
| 407 |
-
" 'Add a big bird.': {'result': ['bird', 'add', {'type': 'big'}]},\n",
|
| 408 |
-
" 'Add a magnet bird.': {'result': ['bird', 'add', {'type': 'magnet'}]},\n",
|
| 409 |
-
" 'Add a superheavy bird.': {'result': ['bird',\n",
|
| 410 |
-
" 'add',\n",
|
| 411 |
-
" {'type': 'superheavy'}]},\n",
|
| 412 |
-
" 'Add a catapult bird.': {'result': ['bird', 'add', {'type': 'catapult'}]},\n",
|
| 413 |
-
" 'Add a flash bird.': {'result': ['bird', 'add', {'type': 'flash'}]},\n",
|
| 414 |
-
" 'Add an antigravity bird.': {'result': ['bird',\n",
|
| 415 |
-
" 'add',\n",
|
| 416 |
-
" {'type': 'antigravity'}]},\n",
|
| 417 |
-
" 'The game is too difficult. Please add more birds.': {'result': ['bird',\n",
|
| 418 |
-
" 'add',\n",
|
| 419 |
-
" {'quantiy': 'some'}]},\n",
|
| 420 |
-
" 'Make the bird bigger.': {'result': ['bird', 'size', {}]},\n",
|
| 421 |
-
" 'Make the bird bigger, so it can run over the enemies.': {'result': ['bird',\n",
|
| 422 |
-
" 'size',\n",
|
| 423 |
-
" {}]},\n",
|
| 424 |
-
" 'List birds.': {'result': ['bird', 'list', {}]},\n",
|
| 425 |
-
" 'Show bird list.': {'result': ['bird', 'list', {}]},\n",
|
| 426 |
-
" 'What kind of birds do you have?': {'result': ['bird', 'list', {}]},\n",
|
| 427 |
-
" 'Are there new kinds of birds?': {'result': ['bird',\n",
|
| 428 |
-
" 'list',\n",
|
| 429 |
-
" {'type': 'new'}]},\n",
|
| 430 |
-
" 'I want to change the positon of birds': {'result': ['change position',\n",
|
| 431 |
-
" {'args': 'bird'}]},\n",
|
| 432 |
-
" 'I want to change the positon of pigs': {'result': ['change position',\n",
|
| 433 |
-
" {'args': 'pig'}]},\n",
|
| 434 |
-
" 'I want to change the positon of houses': {'result': ['change position',\n",
|
| 435 |
-
" {'args': 'house'}]},\n",
|
| 436 |
-
" 'I want to change the positon of obstacles': {'result': ['change position',\n",
|
| 437 |
-
" {'args': 'obstacle'}]},\n",
|
| 438 |
-
" 'Add a pig.': {'result': ['pig', 'add', {}]},\n",
|
| 439 |
-
" 'Please add two pigs.': {'result': ['pig', 'add', {'quantiy': 2}]},\n",
|
| 440 |
-
" 'Please add 2 pigs.': {'result': ['pig', 'add', {'quantiy': 2}]},\n",
|
| 441 |
-
" 'Please add three pigs.': {'result': ['pig', 'add', {'quantiy': 3}]},\n",
|
| 442 |
-
" 'Please add 3 pigs.': {'result': ['pig', 'add', {'quantiy': 3}]},\n",
|
| 443 |
-
" 'Please add four pigs.': {'result': ['pig', 'add', {'quantiy': 4}]},\n",
|
| 444 |
-
" 'Please add 4 pigs.': {'result': ['pig', 'add', {'quantiy': 4}]},\n",
|
| 445 |
-
" 'Please add five pigs.': {'result': ['pig', 'add', {'quantiy': 5}]},\n",
|
| 446 |
-
" 'Please add 5 pigs.': {'result': ['pig', 'add', {'quantiy': 5}]},\n",
|
| 447 |
-
" 'Please add six pigs.': {'result': ['pig', 'add', {'quantiy': 6}]},\n",
|
| 448 |
-
" 'Please add 6 pigs.': {'result': ['pig', 'add', {'quantiy': 6}]},\n",
|
| 449 |
-
" 'Please add seven pigs.': {'result': ['pig', 'add', {'quantiy': 7}]},\n",
|
| 450 |
-
" 'Please add 7 pigs.': {'result': ['pig', 'add', {'quantiy': 7}]},\n",
|
| 451 |
-
" 'Please add eight pigs.': {'result': ['pig', 'add', {'quantiy': 8}]},\n",
|
| 452 |
-
" 'Please add 8 pigs.': {'result': ['pig', 'add', {'quantiy': 8}]},\n",
|
| 453 |
-
" 'Please add nine pigs.': {'result': ['pig', 'add', {'quantiy': 9}]},\n",
|
| 454 |
-
" 'Please add 9 pigs.': {'result': ['pig', 'add', {'quantiy': 9}]},\n",
|
| 455 |
-
" 'Please add ten pigs.': {'result': ['pig', 'add', {'quantiy': 10}]},\n",
|
| 456 |
-
" 'Please add 10 pigs.': {'result': ['pig', 'add', {'quantiy': 10}]},\n",
|
| 457 |
-
" 'I want to make pigs everywehre.': {'result': ['pig',\n",
|
| 458 |
-
" 'add',\n",
|
| 459 |
-
" {'quantiy': 'everywhere'}]},\n",
|
| 460 |
-
" 'Our pigs are losing. Add more pigs.': {'result': ['pig',\n",
|
| 461 |
-
" 'add',\n",
|
| 462 |
-
" {'quantiy': 'some'}]},\n",
|
| 463 |
-
" 'The pigs are too week. Increase the health points for them.': {'result': ['pig',\n",
|
| 464 |
-
" 'increase health points',\n",
|
| 465 |
-
" {}]},\n",
|
| 466 |
-
" 'The pigs are too week. Increase the HP for them.': {'result': ['pig',\n",
|
| 467 |
-
" 'increase health points',\n",
|
| 468 |
-
" {}]},\n",
|
| 469 |
-
" 'The pigs are too week. Increase the hit points for them.': {'result': ['pig',\n",
|
| 470 |
-
" 'increase health points',\n",
|
| 471 |
-
" {}]},\n",
|
| 472 |
-
" 'The pigs are too week. Increase the blood level for them.': {'result': ['pig',\n",
|
| 473 |
-
" 'increase health points',\n",
|
| 474 |
-
" {}]},\n",
|
| 475 |
-
" 'The pigs are too week. Increase the blood levels for them.': {'result': ['pig',\n",
|
| 476 |
-
" 'increase health points',\n",
|
| 477 |
-
" {}]},\n",
|
| 478 |
-
" 'I want to protect the pigs by build houses for them.': {'result': ['house',\n",
|
| 479 |
-
" 'add',\n",
|
| 480 |
-
" {'quantiy': 'some'}]},\n",
|
| 481 |
-
" 'I want to build houses.': {'result': ['house', 'add', {}]},\n",
|
| 482 |
-
" 'I want to build houses, so I can protect my pigs.': {'result': ['house',\n",
|
| 483 |
-
" 'add',\n",
|
| 484 |
-
" {}]},\n",
|
| 485 |
-
" \"The obstacles are too weak. Let's build some solid houses.\": {'result': ['house',\n",
|
| 486 |
-
" 'add',\n",
|
| 487 |
-
" {'args': 'solid'}]}}}"
|
| 488 |
-
]
|
| 489 |
-
},
|
| 490 |
-
"execution_count": 33,
|
| 491 |
-
"metadata": {},
|
| 492 |
-
"output_type": "execute_result"
|
| 493 |
-
}
|
| 494 |
-
],
|
| 495 |
-
"source": [
|
| 496 |
-
"json.loads(ss)"
|
| 497 |
-
]
|
| 498 |
-
},
|
| 499 |
-
{
|
| 500 |
-
"cell_type": "code",
|
| 501 |
-
"execution_count": null,
|
| 502 |
-
"id": "4618fed0-320b-4be2-bce6-73b6b051d9c5",
|
| 503 |
-
"metadata": {},
|
| 504 |
-
"outputs": [],
|
| 505 |
-
"source": []
|
| 506 |
-
}
|
| 507 |
-
],
|
| 508 |
-
"metadata": {
|
| 509 |
-
"kernelspec": {
|
| 510 |
-
"display_name": "Python 3 (ipykernel)",
|
| 511 |
-
"language": "python",
|
| 512 |
-
"name": "python3"
|
| 513 |
-
},
|
| 514 |
-
"language_info": {
|
| 515 |
-
"codemirror_mode": {
|
| 516 |
-
"name": "ipython",
|
| 517 |
-
"version": 3
|
| 518 |
-
},
|
| 519 |
-
"file_extension": ".py",
|
| 520 |
-
"mimetype": "text/x-python",
|
| 521 |
-
"name": "python",
|
| 522 |
-
"nbconvert_exporter": "python",
|
| 523 |
-
"pygments_lexer": "ipython3",
|
| 524 |
-
"version": "3.11.4"
|
| 525 |
-
}
|
| 526 |
-
},
|
| 527 |
-
"nbformat": 4,
|
| 528 |
-
"nbformat_minor": 5
|
| 529 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
games/angrybirds/notebooks/tok.ipynb
DELETED
|
@@ -1,106 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "code",
|
| 5 |
-
"execution_count": 9,
|
| 6 |
-
"id": "eceea364-b90c-4d42-bdf6-db3d940c5063",
|
| 7 |
-
"metadata": {},
|
| 8 |
-
"outputs": [],
|
| 9 |
-
"source": [
|
| 10 |
-
"from gensim.utils import tokenize"
|
| 11 |
-
]
|
| 12 |
-
},
|
| 13 |
-
{
|
| 14 |
-
"cell_type": "code",
|
| 15 |
-
"execution_count": 10,
|
| 16 |
-
"id": "0bf38b21-bb63-4a76-ae60-7cf073c1e955",
|
| 17 |
-
"metadata": {},
|
| 18 |
-
"outputs": [
|
| 19 |
-
{
|
| 20 |
-
"name": "stdout",
|
| 21 |
-
"output_type": "stream",
|
| 22 |
-
"text": [
|
| 23 |
-
"['There', 'are', 'multiple', 'ways', 'we', 'can', 'perform', 'tokenization', 'on', 'given', 'text', 'data', 'We', 'can', 'choose', 'any', 'method', 'based', 'on', 'langauge', 'library', 'and', 'purpose', 'of', 'modeling']\n"
|
| 24 |
-
]
|
| 25 |
-
}
|
| 26 |
-
],
|
| 27 |
-
"source": [
|
| 28 |
-
"text = \"\"\"There are multiple ways we can perform tokenization on given text data. We can choose any method based on langauge, library and purpose of modeling.\"\"\"\n",
|
| 29 |
-
"\n",
|
| 30 |
-
"tokens = list(tokenize(text))\n",
|
| 31 |
-
"print(tokens)"
|
| 32 |
-
]
|
| 33 |
-
},
|
| 34 |
-
{
|
| 35 |
-
"cell_type": "code",
|
| 36 |
-
"execution_count": 11,
|
| 37 |
-
"id": "bf2d2a7a-3d81-4118-b83c-f22cc5355caf",
|
| 38 |
-
"metadata": {},
|
| 39 |
-
"outputs": [
|
| 40 |
-
{
|
| 41 |
-
"data": {
|
| 42 |
-
"text/plain": [
|
| 43 |
-
"['this', 'is', 'a', 'book']"
|
| 44 |
-
]
|
| 45 |
-
},
|
| 46 |
-
"execution_count": 11,
|
| 47 |
-
"metadata": {},
|
| 48 |
-
"output_type": "execute_result"
|
| 49 |
-
}
|
| 50 |
-
],
|
| 51 |
-
"source": [
|
| 52 |
-
"list(tokenize('this is a book.'))"
|
| 53 |
-
]
|
| 54 |
-
},
|
| 55 |
-
{
|
| 56 |
-
"cell_type": "code",
|
| 57 |
-
"execution_count": 14,
|
| 58 |
-
"id": "5ca5aac7-18f1-4ada-8499-a6c9a301af50",
|
| 59 |
-
"metadata": {},
|
| 60 |
-
"outputs": [
|
| 61 |
-
{
|
| 62 |
-
"data": {
|
| 63 |
-
"text/plain": [
|
| 64 |
-
"['this', 'is', 'USA']"
|
| 65 |
-
]
|
| 66 |
-
},
|
| 67 |
-
"execution_count": 14,
|
| 68 |
-
"metadata": {},
|
| 69 |
-
"output_type": "execute_result"
|
| 70 |
-
}
|
| 71 |
-
],
|
| 72 |
-
"source": [
|
| 73 |
-
"list(tokenize('this is USA!'))"
|
| 74 |
-
]
|
| 75 |
-
},
|
| 76 |
-
{
|
| 77 |
-
"cell_type": "code",
|
| 78 |
-
"execution_count": null,
|
| 79 |
-
"id": "939ed5e8-7547-41aa-ab32-52fa7abaea5c",
|
| 80 |
-
"metadata": {},
|
| 81 |
-
"outputs": [],
|
| 82 |
-
"source": []
|
| 83 |
-
}
|
| 84 |
-
],
|
| 85 |
-
"metadata": {
|
| 86 |
-
"kernelspec": {
|
| 87 |
-
"display_name": "Python 3 (ipykernel)",
|
| 88 |
-
"language": "python",
|
| 89 |
-
"name": "python3"
|
| 90 |
-
},
|
| 91 |
-
"language_info": {
|
| 92 |
-
"codemirror_mode": {
|
| 93 |
-
"name": "ipython",
|
| 94 |
-
"version": 3
|
| 95 |
-
},
|
| 96 |
-
"file_extension": ".py",
|
| 97 |
-
"mimetype": "text/x-python",
|
| 98 |
-
"name": "python",
|
| 99 |
-
"nbconvert_exporter": "python",
|
| 100 |
-
"pygments_lexer": "ipython3",
|
| 101 |
-
"version": "3.11.4"
|
| 102 |
-
}
|
| 103 |
-
},
|
| 104 |
-
"nbformat": 4,
|
| 105 |
-
"nbformat_minor": 5
|
| 106 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
games/snake/notebooks/emb.ipynb
DELETED
|
@@ -1,137 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "code",
|
| 5 |
-
"execution_count": 2,
|
| 6 |
-
"id": "1cc076bb-3248-466d-8eee-df79ded42c47",
|
| 7 |
-
"metadata": {},
|
| 8 |
-
"outputs": [],
|
| 9 |
-
"source": [
|
| 10 |
-
"import openai\n",
|
| 11 |
-
"from openai.embeddings_utils import get_embedding as openai_get_embedding\n",
|
| 12 |
-
"from openai.embeddings_utils import cosine_similarity as openai_cosine_similarity"
|
| 13 |
-
]
|
| 14 |
-
},
|
| 15 |
-
{
|
| 16 |
-
"cell_type": "code",
|
| 17 |
-
"execution_count": 3,
|
| 18 |
-
"id": "085a6255-d828-42b6-8da9-cc9a8cc02681",
|
| 19 |
-
"metadata": {},
|
| 20 |
-
"outputs": [],
|
| 21 |
-
"source": [
|
| 22 |
-
"api_key = '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'"
|
| 23 |
-
]
|
| 24 |
-
},
|
| 25 |
-
{
|
| 26 |
-
"cell_type": "code",
|
| 27 |
-
"execution_count": 4,
|
| 28 |
-
"id": "8e8fb3b6-a8ec-405f-a801-ba0435e4a767",
|
| 29 |
-
"metadata": {},
|
| 30 |
-
"outputs": [],
|
| 31 |
-
"source": [
|
| 32 |
-
"openai.api_key = api_key"
|
| 33 |
-
]
|
| 34 |
-
},
|
| 35 |
-
{
|
| 36 |
-
"cell_type": "code",
|
| 37 |
-
"execution_count": 5,
|
| 38 |
-
"id": "08c2a609-91a2-4d62-a187-d29f3148b68e",
|
| 39 |
-
"metadata": {},
|
| 40 |
-
"outputs": [],
|
| 41 |
-
"source": [
|
| 42 |
-
"def _compute_emb(command: str):\n",
|
| 43 |
-
" # always normalize text when query OpenAI embedding service\n",
|
| 44 |
-
" command = command.strip().lower()\n",
|
| 45 |
-
" return openai_get_embedding(\n",
|
| 46 |
-
" command,\n",
|
| 47 |
-
" engine=\"text-embedding-ada-002\"\n",
|
| 48 |
-
" )\n"
|
| 49 |
-
]
|
| 50 |
-
},
|
| 51 |
-
{
|
| 52 |
-
"cell_type": "code",
|
| 53 |
-
"execution_count": 7,
|
| 54 |
-
"id": "7a7c2dba-c54e-44a8-9466-adba94053b47",
|
| 55 |
-
"metadata": {},
|
| 56 |
-
"outputs": [],
|
| 57 |
-
"source": [
|
| 58 |
-
"t = _compute_emb('hi')"
|
| 59 |
-
]
|
| 60 |
-
},
|
| 61 |
-
{
|
| 62 |
-
"cell_type": "code",
|
| 63 |
-
"execution_count": 8,
|
| 64 |
-
"id": "f1ea3765-3c99-477c-82d3-d539e6b79f95",
|
| 65 |
-
"metadata": {},
|
| 66 |
-
"outputs": [
|
| 67 |
-
{
|
| 68 |
-
"data": {
|
| 69 |
-
"text/plain": [
|
| 70 |
-
"[-0.03515825420618057,\n",
|
| 71 |
-
" -0.02061408944427967,\n",
|
| 72 |
-
" -0.015398159623146057,\n",
|
| 73 |
-
" -0.03980923444032669,\n",
|
| 74 |
-
" -0.027459176257252693]"
|
| 75 |
-
]
|
| 76 |
-
},
|
| 77 |
-
"execution_count": 8,
|
| 78 |
-
"metadata": {},
|
| 79 |
-
"output_type": "execute_result"
|
| 80 |
-
}
|
| 81 |
-
],
|
| 82 |
-
"source": [
|
| 83 |
-
"t[:5]"
|
| 84 |
-
]
|
| 85 |
-
},
|
| 86 |
-
{
|
| 87 |
-
"cell_type": "code",
|
| 88 |
-
"execution_count": 9,
|
| 89 |
-
"id": "3ab28dda-dff3-4921-9e24-f4ca05527ebe",
|
| 90 |
-
"metadata": {},
|
| 91 |
-
"outputs": [
|
| 92 |
-
{
|
| 93 |
-
"data": {
|
| 94 |
-
"text/plain": [
|
| 95 |
-
"1536"
|
| 96 |
-
]
|
| 97 |
-
},
|
| 98 |
-
"execution_count": 9,
|
| 99 |
-
"metadata": {},
|
| 100 |
-
"output_type": "execute_result"
|
| 101 |
-
}
|
| 102 |
-
],
|
| 103 |
-
"source": [
|
| 104 |
-
"len(t)"
|
| 105 |
-
]
|
| 106 |
-
},
|
| 107 |
-
{
|
| 108 |
-
"cell_type": "code",
|
| 109 |
-
"execution_count": null,
|
| 110 |
-
"id": "564a9a79-5906-4b29-9063-6b4ee8663d2d",
|
| 111 |
-
"metadata": {},
|
| 112 |
-
"outputs": [],
|
| 113 |
-
"source": []
|
| 114 |
-
}
|
| 115 |
-
],
|
| 116 |
-
"metadata": {
|
| 117 |
-
"kernelspec": {
|
| 118 |
-
"display_name": "Python 3 (ipykernel)",
|
| 119 |
-
"language": "python",
|
| 120 |
-
"name": "python3"
|
| 121 |
-
},
|
| 122 |
-
"language_info": {
|
| 123 |
-
"codemirror_mode": {
|
| 124 |
-
"name": "ipython",
|
| 125 |
-
"version": 3
|
| 126 |
-
},
|
| 127 |
-
"file_extension": ".py",
|
| 128 |
-
"mimetype": "text/x-python",
|
| 129 |
-
"name": "python",
|
| 130 |
-
"nbconvert_exporter": "python",
|
| 131 |
-
"pygments_lexer": "ipython3",
|
| 132 |
-
"version": "3.11.4"
|
| 133 |
-
}
|
| 134 |
-
},
|
| 135 |
-
"nbformat": 4,
|
| 136 |
-
"nbformat_minor": 5
|
| 137 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
games/snake/notebooks/gen-all.ipynb
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
games/snake/notebooks/logs.ipynb
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
games/snake/notebooks/query.ipynb
DELETED
|
@@ -1,755 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "code",
|
| 5 |
-
"execution_count": 4,
|
| 6 |
-
"id": "245fbc34-352d-4945-a689-d04f9365bb99",
|
| 7 |
-
"metadata": {},
|
| 8 |
-
"outputs": [
|
| 9 |
-
{
|
| 10 |
-
"name": "stdout",
|
| 11 |
-
"output_type": "stream",
|
| 12 |
-
"text": [
|
| 13 |
-
"The autoreload extension is already loaded. To reload it, use:\n",
|
| 14 |
-
" %reload_ext autoreload\n"
|
| 15 |
-
]
|
| 16 |
-
}
|
| 17 |
-
],
|
| 18 |
-
"source": [
|
| 19 |
-
"%load_ext autoreload\n",
|
| 20 |
-
"%autoreload 2"
|
| 21 |
-
]
|
| 22 |
-
},
|
| 23 |
-
{
|
| 24 |
-
"cell_type": "code",
|
| 25 |
-
"execution_count": 5,
|
| 26 |
-
"id": "eaed216c-160a-4e31-96fe-015c140ff18b",
|
| 27 |
-
"metadata": {},
|
| 28 |
-
"outputs": [],
|
| 29 |
-
"source": [
|
| 30 |
-
"# from pprint import pprint"
|
| 31 |
-
]
|
| 32 |
-
},
|
| 33 |
-
{
|
| 34 |
-
"cell_type": "code",
|
| 35 |
-
"execution_count": 6,
|
| 36 |
-
"id": "97953551-8ef1-42c1-9317-99d5e65f535e",
|
| 37 |
-
"metadata": {},
|
| 38 |
-
"outputs": [],
|
| 39 |
-
"source": [
|
| 40 |
-
"import json\n",
|
| 41 |
-
"import pandas as pd\n",
|
| 42 |
-
"import pickle\n",
|
| 43 |
-
"\n",
|
| 44 |
-
"import openai\n",
|
| 45 |
-
"from openai.embeddings_utils import get_embedding, cosine_similarity\n",
|
| 46 |
-
"\n",
|
| 47 |
-
"# from games.angrybirds.util import util\n",
|
| 48 |
-
"from games.snake.config import config\n",
|
| 49 |
-
"# from games.angrybirds.prompt import prompt\n",
|
| 50 |
-
"# from games.angrybirds.query import query, yes_no_query\n",
|
| 51 |
-
"from games.snake.snake import snake"
|
| 52 |
-
]
|
| 53 |
-
},
|
| 54 |
-
{
|
| 55 |
-
"cell_type": "code",
|
| 56 |
-
"execution_count": null,
|
| 57 |
-
"id": "fc213f4c-cb07-468b-b15f-60e5120b3d94",
|
| 58 |
-
"metadata": {},
|
| 59 |
-
"outputs": [],
|
| 60 |
-
"source": []
|
| 61 |
-
},
|
| 62 |
-
{
|
| 63 |
-
"cell_type": "code",
|
| 64 |
-
"execution_count": 7,
|
| 65 |
-
"id": "0c876614-a9bf-4d0b-a728-07770f1ad9c5",
|
| 66 |
-
"metadata": {},
|
| 67 |
-
"outputs": [
|
| 68 |
-
{
|
| 69 |
-
"name": "stdout",
|
| 70 |
-
"output_type": "stream",
|
| 71 |
-
"text": [
|
| 72 |
-
"before add_config\n",
|
| 73 |
-
"3104\n",
|
| 74 |
-
"after add_config\n",
|
| 75 |
-
"3104\n",
|
| 76 |
-
"final\n",
|
| 77 |
-
"3104\n"
|
| 78 |
-
]
|
| 79 |
-
}
|
| 80 |
-
],
|
| 81 |
-
"source": [
|
| 82 |
-
"game = snake()"
|
| 83 |
-
]
|
| 84 |
-
},
|
| 85 |
-
{
|
| 86 |
-
"cell_type": "code",
|
| 87 |
-
"execution_count": 8,
|
| 88 |
-
"id": "1411de96-97d5-4bac-b8ed-e279fb1edaa0",
|
| 89 |
-
"metadata": {},
|
| 90 |
-
"outputs": [
|
| 91 |
-
{
|
| 92 |
-
"data": {
|
| 93 |
-
"text/plain": [
|
| 94 |
-
"0"
|
| 95 |
-
]
|
| 96 |
-
},
|
| 97 |
-
"execution_count": 8,
|
| 98 |
-
"metadata": {},
|
| 99 |
-
"output_type": "execute_result"
|
| 100 |
-
}
|
| 101 |
-
],
|
| 102 |
-
"source": [
|
| 103 |
-
"len(game.embeddings)"
|
| 104 |
-
]
|
| 105 |
-
},
|
| 106 |
-
{
|
| 107 |
-
"cell_type": "code",
|
| 108 |
-
"execution_count": 9,
|
| 109 |
-
"id": "129403ce-69f4-4f2a-9b22-7b3e36d78f24",
|
| 110 |
-
"metadata": {},
|
| 111 |
-
"outputs": [],
|
| 112 |
-
"source": [
|
| 113 |
-
"# game.embeddings"
|
| 114 |
-
]
|
| 115 |
-
},
|
| 116 |
-
{
|
| 117 |
-
"cell_type": "code",
|
| 118 |
-
"execution_count": 10,
|
| 119 |
-
"id": "50e372eb-48ba-4378-b866-f2b7120bc94e",
|
| 120 |
-
"metadata": {},
|
| 121 |
-
"outputs": [
|
| 122 |
-
{
|
| 123 |
-
"data": {
|
| 124 |
-
"text/plain": [
|
| 125 |
-
"3104"
|
| 126 |
-
]
|
| 127 |
-
},
|
| 128 |
-
"execution_count": 10,
|
| 129 |
-
"metadata": {},
|
| 130 |
-
"output_type": "execute_result"
|
| 131 |
-
}
|
| 132 |
-
],
|
| 133 |
-
"source": [
|
| 134 |
-
"len(game.train)"
|
| 135 |
-
]
|
| 136 |
-
},
|
| 137 |
-
{
|
| 138 |
-
"cell_type": "code",
|
| 139 |
-
"execution_count": null,
|
| 140 |
-
"id": "f78b2c43-bfc7-478f-894d-d757b0e9927f",
|
| 141 |
-
"metadata": {},
|
| 142 |
-
"outputs": [],
|
| 143 |
-
"source": []
|
| 144 |
-
},
|
| 145 |
-
{
|
| 146 |
-
"cell_type": "code",
|
| 147 |
-
"execution_count": 11,
|
| 148 |
-
"id": "163545c6-c707-401a-93b8-fb2cb9d65136",
|
| 149 |
-
"metadata": {},
|
| 150 |
-
"outputs": [
|
| 151 |
-
{
|
| 152 |
-
"name": "stdout",
|
| 153 |
-
"output_type": "stream",
|
| 154 |
-
"text": [
|
| 155 |
-
"initializing...\n",
|
| 156 |
-
"loading embeddings from a file...\n",
|
| 157 |
-
"pkl size: 3126\n",
|
| 158 |
-
"embedding size: 3104\n",
|
| 159 |
-
"creating embeddings by query OpenAI...\n",
|
| 160 |
-
"embedding size: 3104\n",
|
| 161 |
-
"train size: 3104\n"
|
| 162 |
-
]
|
| 163 |
-
}
|
| 164 |
-
],
|
| 165 |
-
"source": [
|
| 166 |
-
"game.init_emb()"
|
| 167 |
-
]
|
| 168 |
-
},
|
| 169 |
-
{
|
| 170 |
-
"cell_type": "code",
|
| 171 |
-
"execution_count": 12,
|
| 172 |
-
"id": "31c02b28-0078-425d-87b6-702caeea02e3",
|
| 173 |
-
"metadata": {},
|
| 174 |
-
"outputs": [
|
| 175 |
-
{
|
| 176 |
-
"data": {
|
| 177 |
-
"text/plain": [
|
| 178 |
-
"3104"
|
| 179 |
-
]
|
| 180 |
-
},
|
| 181 |
-
"execution_count": 12,
|
| 182 |
-
"metadata": {},
|
| 183 |
-
"output_type": "execute_result"
|
| 184 |
-
}
|
| 185 |
-
],
|
| 186 |
-
"source": [
|
| 187 |
-
"len(game.embeddings)"
|
| 188 |
-
]
|
| 189 |
-
},
|
| 190 |
-
{
|
| 191 |
-
"cell_type": "code",
|
| 192 |
-
"execution_count": 13,
|
| 193 |
-
"id": "cb8e1af2-b0f8-4b74-bc3d-d02ed7a16912",
|
| 194 |
-
"metadata": {},
|
| 195 |
-
"outputs": [],
|
| 196 |
-
"source": [
|
| 197 |
-
"# list(game.embeddings.keys())"
|
| 198 |
-
]
|
| 199 |
-
},
|
| 200 |
-
{
|
| 201 |
-
"cell_type": "code",
|
| 202 |
-
"execution_count": null,
|
| 203 |
-
"id": "067905b6-b030-4df1-9570-d45885f775eb",
|
| 204 |
-
"metadata": {},
|
| 205 |
-
"outputs": [],
|
| 206 |
-
"source": []
|
| 207 |
-
},
|
| 208 |
-
{
|
| 209 |
-
"cell_type": "code",
|
| 210 |
-
"execution_count": 14,
|
| 211 |
-
"id": "02478e9b-dd11-406a-b405-ea4ee56975b1",
|
| 212 |
-
"metadata": {},
|
| 213 |
-
"outputs": [],
|
| 214 |
-
"source": [
|
| 215 |
-
"import os"
|
| 216 |
-
]
|
| 217 |
-
},
|
| 218 |
-
{
|
| 219 |
-
"cell_type": "code",
|
| 220 |
-
"execution_count": 15,
|
| 221 |
-
"id": "7b506b8c-0b60-44e4-bb6e-f4af8439f04f",
|
| 222 |
-
"metadata": {},
|
| 223 |
-
"outputs": [],
|
| 224 |
-
"source": [
|
| 225 |
-
"# root = os.environ['PYTHONPATH']\n",
|
| 226 |
-
"# root"
|
| 227 |
-
]
|
| 228 |
-
},
|
| 229 |
-
{
|
| 230 |
-
"cell_type": "code",
|
| 231 |
-
"execution_count": null,
|
| 232 |
-
"id": "e977cf56-3bfc-4c87-884e-58577b3808cd",
|
| 233 |
-
"metadata": {},
|
| 234 |
-
"outputs": [],
|
| 235 |
-
"source": []
|
| 236 |
-
},
|
| 237 |
-
{
|
| 238 |
-
"cell_type": "code",
|
| 239 |
-
"execution_count": 16,
|
| 240 |
-
"id": "5662bd80-03c5-4793-94c3-4d0392c08102",
|
| 241 |
-
"metadata": {},
|
| 242 |
-
"outputs": [
|
| 243 |
-
{
|
| 244 |
-
"name": "stdout",
|
| 245 |
-
"output_type": "stream",
|
| 246 |
-
"text": [
|
| 247 |
-
"before add_config\n",
|
| 248 |
-
"3104\n",
|
| 249 |
-
"after add_config\n",
|
| 250 |
-
"3104\n",
|
| 251 |
-
"final\n",
|
| 252 |
-
"3104\n"
|
| 253 |
-
]
|
| 254 |
-
}
|
| 255 |
-
],
|
| 256 |
-
"source": [
|
| 257 |
-
"conf = config()\n",
|
| 258 |
-
"conf.init_game_train()"
|
| 259 |
-
]
|
| 260 |
-
},
|
| 261 |
-
{
|
| 262 |
-
"cell_type": "code",
|
| 263 |
-
"execution_count": 17,
|
| 264 |
-
"id": "30fb4dd7-35d8-442f-bd6e-29e15374e3d6",
|
| 265 |
-
"metadata": {},
|
| 266 |
-
"outputs": [],
|
| 267 |
-
"source": [
|
| 268 |
-
"with open(f'../game_train.json', 'w') as f:\n",
|
| 269 |
-
" json.dump(config.game_train, f, indent=4)"
|
| 270 |
-
]
|
| 271 |
-
},
|
| 272 |
-
{
|
| 273 |
-
"cell_type": "code",
|
| 274 |
-
"execution_count": 18,
|
| 275 |
-
"id": "3c051dbf-d547-4297-8f14-f464e58e9a64",
|
| 276 |
-
"metadata": {},
|
| 277 |
-
"outputs": [],
|
| 278 |
-
"source": [
|
| 279 |
-
"with open(f'../game_train.json', 'r') as f:\n",
|
| 280 |
-
" tmp = json.load(f)"
|
| 281 |
-
]
|
| 282 |
-
},
|
| 283 |
-
{
|
| 284 |
-
"cell_type": "code",
|
| 285 |
-
"execution_count": 19,
|
| 286 |
-
"id": "82c2f34a-f84c-43fd-9a10-b572fd910f31",
|
| 287 |
-
"metadata": {},
|
| 288 |
-
"outputs": [],
|
| 289 |
-
"source": [
|
| 290 |
-
"# config.game_train = tmp"
|
| 291 |
-
]
|
| 292 |
-
},
|
| 293 |
-
{
|
| 294 |
-
"cell_type": "code",
|
| 295 |
-
"execution_count": 20,
|
| 296 |
-
"id": "77789684-e7b1-4e28-b9b7-5fbca3b6d376",
|
| 297 |
-
"metadata": {},
|
| 298 |
-
"outputs": [
|
| 299 |
-
{
|
| 300 |
-
"data": {
|
| 301 |
-
"text/plain": [
|
| 302 |
-
"True"
|
| 303 |
-
]
|
| 304 |
-
},
|
| 305 |
-
"execution_count": 20,
|
| 306 |
-
"metadata": {},
|
| 307 |
-
"output_type": "execute_result"
|
| 308 |
-
}
|
| 309 |
-
],
|
| 310 |
-
"source": [
|
| 311 |
-
"config.game_train == tmp"
|
| 312 |
-
]
|
| 313 |
-
},
|
| 314 |
-
{
|
| 315 |
-
"cell_type": "code",
|
| 316 |
-
"execution_count": null,
|
| 317 |
-
"id": "ce058298-2236-4ede-adca-164d6d1249e1",
|
| 318 |
-
"metadata": {},
|
| 319 |
-
"outputs": [],
|
| 320 |
-
"source": []
|
| 321 |
-
},
|
| 322 |
-
{
|
| 323 |
-
"cell_type": "code",
|
| 324 |
-
"execution_count": 21,
|
| 325 |
-
"id": "dd8c489e-cd3f-4df6-81c0-fe3fd2cc0d33",
|
| 326 |
-
"metadata": {},
|
| 327 |
-
"outputs": [],
|
| 328 |
-
"source": [
|
| 329 |
-
"with open(f'{game.ROOT}/embeddings.pkl', 'wb') as f:\n",
|
| 330 |
-
" pickle.dump(game.embeddings, f)"
|
| 331 |
-
]
|
| 332 |
-
},
|
| 333 |
-
{
|
| 334 |
-
"cell_type": "code",
|
| 335 |
-
"execution_count": 22,
|
| 336 |
-
"id": "07032487-3fe7-4729-8ca0-c57d6a485c28",
|
| 337 |
-
"metadata": {},
|
| 338 |
-
"outputs": [],
|
| 339 |
-
"source": [
|
| 340 |
-
"with open(f'{game.ROOT}/embeddings.pkl', 'rb') as f:\n",
|
| 341 |
-
" tmp = pickle.load(f)"
|
| 342 |
-
]
|
| 343 |
-
},
|
| 344 |
-
{
|
| 345 |
-
"cell_type": "code",
|
| 346 |
-
"execution_count": 23,
|
| 347 |
-
"id": "ab7ec218-0e02-4a2b-9c16-ec26704b3519",
|
| 348 |
-
"metadata": {},
|
| 349 |
-
"outputs": [
|
| 350 |
-
{
|
| 351 |
-
"data": {
|
| 352 |
-
"text/plain": [
|
| 353 |
-
"True"
|
| 354 |
-
]
|
| 355 |
-
},
|
| 356 |
-
"execution_count": 23,
|
| 357 |
-
"metadata": {},
|
| 358 |
-
"output_type": "execute_result"
|
| 359 |
-
}
|
| 360 |
-
],
|
| 361 |
-
"source": [
|
| 362 |
-
"tmp == game.embeddings"
|
| 363 |
-
]
|
| 364 |
-
},
|
| 365 |
-
{
|
| 366 |
-
"cell_type": "code",
|
| 367 |
-
"execution_count": 24,
|
| 368 |
-
"id": "bc896434-21ae-438c-90b1-6b590103e731",
|
| 369 |
-
"metadata": {},
|
| 370 |
-
"outputs": [
|
| 371 |
-
{
|
| 372 |
-
"data": {
|
| 373 |
-
"text/plain": [
|
| 374 |
-
"3104"
|
| 375 |
-
]
|
| 376 |
-
},
|
| 377 |
-
"execution_count": 24,
|
| 378 |
-
"metadata": {},
|
| 379 |
-
"output_type": "execute_result"
|
| 380 |
-
}
|
| 381 |
-
],
|
| 382 |
-
"source": [
|
| 383 |
-
"len(tmp)"
|
| 384 |
-
]
|
| 385 |
-
},
|
| 386 |
-
{
|
| 387 |
-
"cell_type": "code",
|
| 388 |
-
"execution_count": 25,
|
| 389 |
-
"id": "9532b604-b7d6-4bd4-a0b9-c8c36470447b",
|
| 390 |
-
"metadata": {},
|
| 391 |
-
"outputs": [
|
| 392 |
-
{
|
| 393 |
-
"data": {
|
| 394 |
-
"text/plain": [
|
| 395 |
-
"3104"
|
| 396 |
-
]
|
| 397 |
-
},
|
| 398 |
-
"execution_count": 25,
|
| 399 |
-
"metadata": {},
|
| 400 |
-
"output_type": "execute_result"
|
| 401 |
-
}
|
| 402 |
-
],
|
| 403 |
-
"source": [
|
| 404 |
-
"len(game.embeddings)"
|
| 405 |
-
]
|
| 406 |
-
},
|
| 407 |
-
{
|
| 408 |
-
"cell_type": "code",
|
| 409 |
-
"execution_count": 26,
|
| 410 |
-
"id": "18888a7b-d32d-45b4-a9b3-3ce29b18a7f7",
|
| 411 |
-
"metadata": {},
|
| 412 |
-
"outputs": [],
|
| 413 |
-
"source": [
|
| 414 |
-
"# sim query"
|
| 415 |
-
]
|
| 416 |
-
},
|
| 417 |
-
{
|
| 418 |
-
"cell_type": "code",
|
| 419 |
-
"execution_count": 27,
|
| 420 |
-
"id": "4703a269-a1c0-48e4-8848-6b5cdb9b814b",
|
| 421 |
-
"metadata": {},
|
| 422 |
-
"outputs": [
|
| 423 |
-
{
|
| 424 |
-
"data": {
|
| 425 |
-
"text/plain": [
|
| 426 |
-
"3104"
|
| 427 |
-
]
|
| 428 |
-
},
|
| 429 |
-
"execution_count": 27,
|
| 430 |
-
"metadata": {},
|
| 431 |
-
"output_type": "execute_result"
|
| 432 |
-
}
|
| 433 |
-
],
|
| 434 |
-
"source": [
|
| 435 |
-
"len(game.embeddings)"
|
| 436 |
-
]
|
| 437 |
-
},
|
| 438 |
-
{
|
| 439 |
-
"cell_type": "code",
|
| 440 |
-
"execution_count": null,
|
| 441 |
-
"id": "c885da07-e53d-4586-b340-8f9de0515fc2",
|
| 442 |
-
"metadata": {},
|
| 443 |
-
"outputs": [],
|
| 444 |
-
"source": []
|
| 445 |
-
},
|
| 446 |
-
{
|
| 447 |
-
"cell_type": "code",
|
| 448 |
-
"execution_count": 25,
|
| 449 |
-
"id": "4ff48663-e767-4936-807d-07fb8c42ce92",
|
| 450 |
-
"metadata": {},
|
| 451 |
-
"outputs": [
|
| 452 |
-
{
|
| 453 |
-
"name": "stdout",
|
| 454 |
-
"output_type": "stream",
|
| 455 |
-
"text": [
|
| 456 |
-
"{\n",
|
| 457 |
-
" \"version\": \"1.4.0.2023-11-10-a\",\n",
|
| 458 |
-
" \"data\": [\n",
|
| 459 |
-
" \"(1) add/delete bombs/swords/...\",\n",
|
| 460 |
-
" \"(2) add/delete enemies/monsters\",\n",
|
| 461 |
-
" \"(3) add/delete obstacles\",\n",
|
| 462 |
-
" \"(4) add/delete one or more weapons/obstacle\",\n",
|
| 463 |
-
" \"(5) add/delete props\",\n",
|
| 464 |
-
" \"(6) add/delete weapons\",\n",
|
| 465 |
-
" \"(7) change background\",\n",
|
| 466 |
-
" \"(8) change map size\",\n",
|
| 467 |
-
" \"(9) change skin\",\n",
|
| 468 |
-
" \"(10) change snake size\",\n",
|
| 469 |
-
" \"(11) disable patrol\",\n",
|
| 470 |
-
" \"(12) enable patrol\",\n",
|
| 471 |
-
" \"(13) enemies/obstacles attack snake/player\",\n",
|
| 472 |
-
" \"(14) enter edit mode\",\n",
|
| 473 |
-
" \"(15) help\",\n",
|
| 474 |
-
" \"(16) increase/decrease props/weapons/food/obstacles/monsters(enemies) speed\",\n",
|
| 475 |
-
" \"(17) list game modes\",\n",
|
| 476 |
-
" \"(18) list props/weapons/food/obstacles/enemies\",\n",
|
| 477 |
-
" \"(19) mute music\",\n",
|
| 478 |
-
" \"(20) replace props\",\n",
|
| 479 |
-
" \"(21) reset game\",\n",
|
| 480 |
-
" \"(22) set game mode\",\n",
|
| 481 |
-
" \"(23) set/increase/decrease snake speed\",\n",
|
| 482 |
-
" \"(24) timer\",\n",
|
| 483 |
-
" \"(25) winning condition\"\n",
|
| 484 |
-
" ]\n",
|
| 485 |
-
"}\n"
|
| 486 |
-
]
|
| 487 |
-
}
|
| 488 |
-
],
|
| 489 |
-
"source": [
|
| 490 |
-
"print(json.dumps(game.list_functionality(), indent=4))"
|
| 491 |
-
]
|
| 492 |
-
},
|
| 493 |
-
{
|
| 494 |
-
"cell_type": "code",
|
| 495 |
-
"execution_count": 26,
|
| 496 |
-
"id": "3bde59df-de5c-47ec-b131-c5a2c017a88e",
|
| 497 |
-
"metadata": {},
|
| 498 |
-
"outputs": [
|
| 499 |
-
{
|
| 500 |
-
"name": "stdout",
|
| 501 |
-
"output_type": "stream",
|
| 502 |
-
"text": [
|
| 503 |
-
"/Users/shaojun/playgo/prod/ai/games/snake/notebooks\n"
|
| 504 |
-
]
|
| 505 |
-
}
|
| 506 |
-
],
|
| 507 |
-
"source": [
|
| 508 |
-
"!pwd"
|
| 509 |
-
]
|
| 510 |
-
},
|
| 511 |
-
{
|
| 512 |
-
"cell_type": "code",
|
| 513 |
-
"execution_count": null,
|
| 514 |
-
"id": "d7087f6d-103c-4104-b97c-d2eb64e39c0d",
|
| 515 |
-
"metadata": {},
|
| 516 |
-
"outputs": [],
|
| 517 |
-
"source": []
|
| 518 |
-
},
|
| 519 |
-
{
|
| 520 |
-
"cell_type": "code",
|
| 521 |
-
"execution_count": 27,
|
| 522 |
-
"id": "b31e5edc-d9a5-4fd2-b7cc-adbec539d9e6",
|
| 523 |
-
"metadata": {},
|
| 524 |
-
"outputs": [],
|
| 525 |
-
"source": [
|
| 526 |
-
"# command = 'take away 10 guns'"
|
| 527 |
-
]
|
| 528 |
-
},
|
| 529 |
-
{
|
| 530 |
-
"cell_type": "code",
|
| 531 |
-
"execution_count": 28,
|
| 532 |
-
"id": "21f3ad37-2a13-45c8-aa81-42df9aa46197",
|
| 533 |
-
"metadata": {},
|
| 534 |
-
"outputs": [],
|
| 535 |
-
"source": [
|
| 536 |
-
"# command = '10 less guns'"
|
| 537 |
-
]
|
| 538 |
-
},
|
| 539 |
-
{
|
| 540 |
-
"cell_type": "code",
|
| 541 |
-
"execution_count": 29,
|
| 542 |
-
"id": "178d5332-5d68-4924-b6ae-872d0b400900",
|
| 543 |
-
"metadata": {},
|
| 544 |
-
"outputs": [],
|
| 545 |
-
"source": [
|
| 546 |
-
"command = 'create more obstacles'"
|
| 547 |
-
]
|
| 548 |
-
},
|
| 549 |
-
{
|
| 550 |
-
"cell_type": "code",
|
| 551 |
-
"execution_count": 30,
|
| 552 |
-
"id": "3cc479e9-3897-4a56-a9f4-a494ae608c7c",
|
| 553 |
-
"metadata": {},
|
| 554 |
-
"outputs": [],
|
| 555 |
-
"source": [
|
| 556 |
-
"command = 'create more objects'"
|
| 557 |
-
]
|
| 558 |
-
},
|
| 559 |
-
{
|
| 560 |
-
"cell_type": "code",
|
| 561 |
-
"execution_count": 31,
|
| 562 |
-
"id": "5919e519-1776-4433-a901-9c1089d8cb9d",
|
| 563 |
-
"metadata": {},
|
| 564 |
-
"outputs": [],
|
| 565 |
-
"source": [
|
| 566 |
-
"command = 'allow obstacles to move'"
|
| 567 |
-
]
|
| 568 |
-
},
|
| 569 |
-
{
|
| 570 |
-
"cell_type": "code",
|
| 571 |
-
"execution_count": 32,
|
| 572 |
-
"id": "bc9174da-46cc-428e-9306-51fff3db00ad",
|
| 573 |
-
"metadata": {},
|
| 574 |
-
"outputs": [],
|
| 575 |
-
"source": [
|
| 576 |
-
"command = 'shhhh'"
|
| 577 |
-
]
|
| 578 |
-
},
|
| 579 |
-
{
|
| 580 |
-
"cell_type": "code",
|
| 581 |
-
"execution_count": 33,
|
| 582 |
-
"id": "2446f322-b097-477d-81e3-492243013225",
|
| 583 |
-
"metadata": {},
|
| 584 |
-
"outputs": [],
|
| 585 |
-
"source": [
|
| 586 |
-
"command = 'reset game'"
|
| 587 |
-
]
|
| 588 |
-
},
|
| 589 |
-
{
|
| 590 |
-
"cell_type": "code",
|
| 591 |
-
"execution_count": 34,
|
| 592 |
-
"id": "d9fb2a0d-cfc6-48db-b7b1-50442298d143",
|
| 593 |
-
"metadata": {},
|
| 594 |
-
"outputs": [],
|
| 595 |
-
"source": [
|
| 596 |
-
"command = 'change player speed'"
|
| 597 |
-
]
|
| 598 |
-
},
|
| 599 |
-
{
|
| 600 |
-
"cell_type": "code",
|
| 601 |
-
"execution_count": 35,
|
| 602 |
-
"id": "73fa9c0e-b5b1-4120-a7d7-590ff8015817",
|
| 603 |
-
"metadata": {},
|
| 604 |
-
"outputs": [],
|
| 605 |
-
"source": [
|
| 606 |
-
"command = 'slow down player'"
|
| 607 |
-
]
|
| 608 |
-
},
|
| 609 |
-
{
|
| 610 |
-
"cell_type": "code",
|
| 611 |
-
"execution_count": 38,
|
| 612 |
-
"id": "7e7e39ed-2a8d-4bd1-b244-c8b62ecb58b2",
|
| 613 |
-
"metadata": {},
|
| 614 |
-
"outputs": [],
|
| 615 |
-
"source": [
|
| 616 |
-
"command = 'add weapons'"
|
| 617 |
-
]
|
| 618 |
-
},
|
| 619 |
-
{
|
| 620 |
-
"cell_type": "code",
|
| 621 |
-
"execution_count": 39,
|
| 622 |
-
"id": "7eb324ad-1040-47d1-8989-3e38fb130a65",
|
| 623 |
-
"metadata": {},
|
| 624 |
-
"outputs": [],
|
| 625 |
-
"source": [
|
| 626 |
-
"# command = 'tomorrow'"
|
| 627 |
-
]
|
| 628 |
-
},
|
| 629 |
-
{
|
| 630 |
-
"cell_type": "code",
|
| 631 |
-
"execution_count": 40,
|
| 632 |
-
"id": "0af1322d-7342-4cf0-9f81-63a6bd5a5d15",
|
| 633 |
-
"metadata": {},
|
| 634 |
-
"outputs": [
|
| 635 |
-
{
|
| 636 |
-
"name": "stdout",
|
| 637 |
-
"output_type": "stream",
|
| 638 |
-
"text": [
|
| 639 |
-
"skip init\n",
|
| 640 |
-
"\n",
|
| 641 |
-
"--------------------\n",
|
| 642 |
-
"[snake] query count: 2\n",
|
| 643 |
-
"input: add weapons\n",
|
| 644 |
-
"{\n",
|
| 645 |
-
" \"status\": \"OK\",\n",
|
| 646 |
-
" \"result\": [\n",
|
| 647 |
-
" \"weapon\",\n",
|
| 648 |
-
" \"add\",\n",
|
| 649 |
-
" {\n",
|
| 650 |
-
" \"args\": \"some\"\n",
|
| 651 |
-
" }\n",
|
| 652 |
-
" ],\n",
|
| 653 |
-
" \"command\": \"add weapons\",\n",
|
| 654 |
-
" \"timestamp\": \"2023-11-10 18:26:24.587111+08:00\",\n",
|
| 655 |
-
" \"ai-version\": \"1.4.0.2023-11-10-a\"\n",
|
| 656 |
-
"}\n",
|
| 657 |
-
"[\n",
|
| 658 |
-
" [\n",
|
| 659 |
-
" 0,\n",
|
| 660 |
-
" \"1.00000000\",\n",
|
| 661 |
-
" \"add weapons\"\n",
|
| 662 |
-
" ],\n",
|
| 663 |
-
" [\n",
|
| 664 |
-
" 1,\n",
|
| 665 |
-
" \"0.94908069\",\n",
|
| 666 |
-
" \"increase weapons\"\n",
|
| 667 |
-
" ],\n",
|
| 668 |
-
" [\n",
|
| 669 |
-
" 2,\n",
|
| 670 |
-
" \"0.94125815\",\n",
|
| 671 |
-
" \"create weapons\"\n",
|
| 672 |
-
" ],\n",
|
| 673 |
-
" [\n",
|
| 674 |
-
" 3,\n",
|
| 675 |
-
" \"0.93469667\",\n",
|
| 676 |
-
" \"add guns\"\n",
|
| 677 |
-
" ],\n",
|
| 678 |
-
" [\n",
|
| 679 |
-
" 4,\n",
|
| 680 |
-
" \"0.93148426\",\n",
|
| 681 |
-
" \"remove weapons\"\n",
|
| 682 |
-
" ]\n",
|
| 683 |
-
"]\n",
|
| 684 |
-
"%%%%%%%%%%%%%%%%%%%%\n",
|
| 685 |
-
"[snake] query count: 2\n",
|
| 686 |
-
"input: add weapons\n",
|
| 687 |
-
"OK\n",
|
| 688 |
-
"top: add weapons\n",
|
| 689 |
-
"--------------------\n",
|
| 690 |
-
"\n"
|
| 691 |
-
]
|
| 692 |
-
},
|
| 693 |
-
{
|
| 694 |
-
"data": {
|
| 695 |
-
"text/plain": [
|
| 696 |
-
"({'status': 'OK',\n",
|
| 697 |
-
" 'result': ['weapon', 'add', {'args': 'some'}],\n",
|
| 698 |
-
" 'command': 'add weapons',\n",
|
| 699 |
-
" 'timestamp': '2023-11-10 18:26:24.587111+08:00',\n",
|
| 700 |
-
" 'ai-version': '1.4.0.2023-11-10-a'},\n",
|
| 701 |
-
" [[0, '1.00000000', 'add weapons'],\n",
|
| 702 |
-
" [1, '0.94908069', 'increase weapons'],\n",
|
| 703 |
-
" [2, '0.94125815', 'create weapons'],\n",
|
| 704 |
-
" [3, '0.93469667', 'add guns'],\n",
|
| 705 |
-
" [4, '0.93148426', 'remove weapons']])"
|
| 706 |
-
]
|
| 707 |
-
},
|
| 708 |
-
"execution_count": 40,
|
| 709 |
-
"metadata": {},
|
| 710 |
-
"output_type": "execute_result"
|
| 711 |
-
}
|
| 712 |
-
],
|
| 713 |
-
"source": [
|
| 714 |
-
"game.query_entry_point(command)"
|
| 715 |
-
]
|
| 716 |
-
},
|
| 717 |
-
{
|
| 718 |
-
"cell_type": "code",
|
| 719 |
-
"execution_count": null,
|
| 720 |
-
"id": "7c151a5e-6bef-4847-a469-03f22b7af9d9",
|
| 721 |
-
"metadata": {},
|
| 722 |
-
"outputs": [],
|
| 723 |
-
"source": []
|
| 724 |
-
},
|
| 725 |
-
{
|
| 726 |
-
"cell_type": "code",
|
| 727 |
-
"execution_count": null,
|
| 728 |
-
"id": "060f85f3-7e75-4ef5-9100-98df83ea0fd5",
|
| 729 |
-
"metadata": {},
|
| 730 |
-
"outputs": [],
|
| 731 |
-
"source": []
|
| 732 |
-
}
|
| 733 |
-
],
|
| 734 |
-
"metadata": {
|
| 735 |
-
"kernelspec": {
|
| 736 |
-
"display_name": "Python 3 (ipykernel)",
|
| 737 |
-
"language": "python",
|
| 738 |
-
"name": "python3"
|
| 739 |
-
},
|
| 740 |
-
"language_info": {
|
| 741 |
-
"codemirror_mode": {
|
| 742 |
-
"name": "ipython",
|
| 743 |
-
"version": 3
|
| 744 |
-
},
|
| 745 |
-
"file_extension": ".py",
|
| 746 |
-
"mimetype": "text/x-python",
|
| 747 |
-
"name": "python",
|
| 748 |
-
"nbconvert_exporter": "python",
|
| 749 |
-
"pygments_lexer": "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