Islam Mamedov commited on
Commit
bbb66cb
·
1 Parent(s): b36ea58

Day 4: 42-question eval harness; fix max file size (routing.py was unindexed)

Browse files
data/chunks.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
data/eval_cache.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "f04d2a75d7d12ce4": "You set it on the path‑operation decorator itself (or by returning a response object with its own code).\n\n```python\nfrom fastapi import FastAPI, status\nfrom fastapi.responses import JSONResponse\n\napp = FastAPI()\n\n@app.post(\"/items/\", status_code=status.HTTP_201_CREATED) # ← custom code\ndef create_item(item: Item):\n # normal return → FastAPI will wrap it in a JSONResponse with 201\n return item\n\n# or, if you need to decide at runtime:\ndef update_item(item_id: int):\n if item_exists(item_id):\n return {\"msg\": \"updated\"} # default 200\n return JSONResponse(content={\"msg\": \"created\"},\n status_code=status.HTTP_201_CREATED) # ← custom code\n```\n\n* The `status_code` argument on the decorator defines the default response code and is added to the OpenAPI schema [5][2]. \n* You can also return a `Response`/`JSONResponse` directly and set its `status_code` [1].",
3
+ "2768894883ca09f0": "{\"faithful\": true, \"correct\": true}",
4
+ "07679a24f3a9254a": "You declare a parameter of type **`UploadFile`** (or `bytes`) and mark it with **`File`** in the path‑operation function. FastAPI will then read the multipart/form‑data request and give you the uploaded file.\n\n```python\nfrom fastapi import FastAPI, File, UploadFile\n\napp = FastAPI()\n\n@app.post(\"/upload\")\nasync def upload(file: UploadFile = File(...)):\n # `file` is an UploadFile instance with attributes like .filename, .content_type, etc.\n contents = await file.read() # read the file if needed\n return {\"filename\": file.filename}\n```\n\n* `UploadFile` is imported from `fastapi` and provides methods such as `read`, `write`, `seek`, etc. [2] \n* Declaring the parameter with `File` creates a file‑upload field in the request body. [5] \n* Using `File`, `bytes`, or `UploadFile` lets FastAPI receive files sent as form data. [3]",
5
+ "fa4b51b532933b37": "{\"faithful\": true, \"correct\": true}",
6
+ "d98a54f321065d50": "You run a task after the response is sent by injecting a `BackgroundTasks` object into the path‑operation function, adding the callable with `add_task`, and then returning the normal response.\n\n```python\nfrom fastapi import FastAPI, BackgroundTasks\n\napp = FastAPI()\n\ndef write_log(message: str):\n with open(\"log.txt\", \"a\") as f:\n f.write(message + \"\\n\")\n\n@app.post(\"/process\")\nasync def process(background_tasks: BackgroundTasks):\n # schedule the function to run after the response is sent\n background_tasks.add_task(write_log, \"processing finished\")\n return {\"status\": \"accepted\"} # 2xx response → background runs\n```\n\n* Declare a parameter of type `BackgroundTasks` in the endpoint (or a dependency) [2]. \n* Use `background_tasks.add_task(func, *args, **kwargs)` to queue the function [4]. \n* The task is executed only when the response has a successful (2xx) status [1]. \n\nIf you raise an exception (e.g., `HTTPException`) the background tasks are **not** run, because they are only triggered for successful responses [3].",
7
+ "23c4601a08b6b227": "{\"faithful\": true, \"correct\": true}",
8
+ "3b284540067f764b": "Add the **CORSMiddleware** to your FastAPI app and list the origins that are allowed to call it.\n\n```python\nfrom fastapi import FastAPI\nfrom fastapi.middleware.cors import CORSMiddleware # or starlette.middleware.cors\n\napp = FastAPI()\n\norigins = [\n \"http://localhost:8080\", # your frontend URL\n]\n\napp.add_middleware(\n CORSMiddleware,\n allow_origins=origins, # <‑‑ origins that may call the API\n allow_methods=[\"*\"], # or a list like [\"GET\", \"POST\"]\n allow_headers=[\"*\"], # or a list of allowed request headers\n allow_credentials=True, # if you need cookies / auth headers\n)\n```\n\nThe middleware will handle CORS pre‑flight (`OPTIONS`) requests and add the appropriate `Access‑Control‑*` headers to normal responses, allowing the frontend at `http://localhost:8080` to call the API [2].",
9
+ "9bbcac71807abdb4": "{\"faithful\": true, \"correct\": true}",
10
+ "862d19b2979409bb": "Declare the query parameter in the endpoint function with a default value. \nAny default (including `None`) makes the parameter optional:\n\n```python\nfrom fastapi import FastAPI\n\napp = FastAPI()\n\n@app.get(\"/items/\")\ndef read_items(\n q: str = \"fixedquery\", # optional, default value\n skip: int = 0, # optional, default value\n limit: int | None = None # optional, default None\n):\n return {\"q\": q, \"skip\": skip, \"limit\": limit}\n```\n\n- Setting the default to `None` (e.g., `q: str | None = None`) makes the query parameter optional [1]. \n- Any other default value (e.g., `\"fixedquery\"`) also makes the parameter optional [2].",
11
+ "68f7e2127104a8d6": "{\"faithful\": true, \"correct\": true}",
12
+ "f5f87ebcadd556c4": "FastAPI lets a *path operation function* declare the things it needs by adding parameters wrapped with `Depends`. \nWhen a request matches a route, FastAPI **automatically**:\n\n1. Calls each declared dependency (or any other callable that can be used as a dependency) with the same request‑derived parameters that normal path functions receive. \n2. Takes the return value of that call. \n3. Injects that value into the corresponding parameter of the original path operation function.\n\nThus the developer never calls the dependency directly; FastAPI resolves and “injects” it for every request, enabling shared logic such as database connections, security checks, etc. [2][3][5]",
13
+ "c08b0f6a49c19444": "{\"faithful\": true, \"correct\": true}",
14
+ "ba3259db2b841766": "`jsonable_encoder` is a FastAPI utility that walks through **any** Python object and returns a structure that the standard `json.dumps()` can handle (e.g., `dict`, `list`, `str`, `int`, `float`, `None`). \nIt knows how to:\n\n* Convert Pydantic models to plain dictionaries (`model_dump(mode=\"json\")`)【3†L19-L31】. \n* Turn dataclasses into dicts, Enums into their values, `Path` objects into strings, etc.【3†L33-L45】. \n* Apply optional `include` / `exclude` filters, `by_alias`, `exclude_unset`, `exclude_none`, custom encoders, and SQL‑Alchemy‑safe handling【3†L9-L57】. \n\n**When you need it**\n\n* **Before persisting data** in a store that only accepts JSON‑compatible values (e.g., a database that can’t store `datetime` objects). The docs show converting a Pydantic model with a `datetime` field into a `dict` where the date becomes an ISO‑format string【2†L7-L15】. \n* **When building a response manually** (e.g., passing data to `JSONResponse` or a custom `Response`). FastAPI does not alter a `Response` you return, so you must ensure its content is JSON‑compatible first【4†L1-L7】. \n* **Whenever FastAPI itself needs to serialize return values** that are not already a response model; FastAPI calls `jsonable_encoder` internally to prepare the data for `JSONResponse`【5†L7-L12】. \n\nIn short, `jsonable_encoder` turns complex Python objects (Pydantic models, dataclasses, enums, paths, etc.) into plain JSON‑compatible data structures, and you use it whenever you have to serialize such objects yourself—e.g., for database storage or custom response handling.",
15
+ "38c440a1302f1bd5": "{\"faithful\": false, \"correct\": true}",
16
+ "5932c4a434926300": "The **`APIRouter`** class is defined in the **`fastapi.routing`** module and is re‑exported at the top‑level of the FastAPI package, so it can be imported directly with:\n\n```python\nfrom fastapi import APIRouter\n```\n\n[1]",
17
+ "d460c3c3e191d680": "{\"faithful\": false, \"correct\": true}",
18
+ "59d00e411e264fdd": "The `OAuth2PasswordBearer` class is defined in the **`fastapi/security/oauth2.py`** module. 【1】",
19
+ "ce3328a57476a69f": "{\"faithful\": true, \"correct\": true}",
20
+ "d26701006986fce5": "You can add a WebSocket endpoint to a FastAPI app by:\n\n1. **Importing the `WebSocket` class** (it’s re‑exported by FastAPI from Starlette)【4】. \n2. **Declaring a function decorated with `@app.websocket(...)`** that receives a `WebSocket` parameter. \n3. **Accepting the connection** with `await websocket.accept()`. \n4. **Reading and writing** using the `receive_*` and `send_*` methods (e.g., `receive_text`, `send_text`). \n5. **Running the app** (e.g., `fastapi dev`) and connecting from a browser or client【2】.\n\n```python\nfrom fastapi import FastAPI, WebSocket, WebSocketException, status\n\napp = FastAPI()\n\n@app.websocket(\"/items/{item_id}/ws\")\nasync def websocket_endpoint(\n *,\n websocket: WebSocket,\n item_id: str,\n):\n # Example of raising a client‑error exception\n # raise WebSocketException(code=status.WS_1008_POLICY_VIOLATION)\n\n await websocket.accept() # accept the connection\n while True:\n data = await websocket.receive_text() # read a message\n await websocket.send_text(\n f\"Message text was: {data}, for item ID: {item_id}\"\n ) # send a response\n```\n\n* The `WebSocketException` class can be raised to close the connection with a specific WebSocket close code (e.g., `status.WS_1008_POLICY_VIOLATION`)【5】. \n\nRun the app:\n\n```bash\n$ fastapi dev\nINFO: Uvicorn running on http://127.0.0.1:8000\n```\n\nThen open `http://127.0.0.1:8000` in a browser, type messages, and see the server’s responses【2】.",
21
+ "63e74d7941780851": "{\"faithful\": true, \"correct\": true}",
22
+ "f82568e4b9ac6687": "I couldn't find this in the indexed codebase.",
23
+ "d427347a9f2028cb": "I couldn't find this in the indexed codebase."
24
+ }
data/eval_set.jsonl ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"question": "How do I set a custom status code for an endpoint?", "category": "api_usage", "answerable": true, "gold": ["response-status-code.md", "additional-status-codes.md"]}
2
+ {"question": "How do I receive an uploaded file in an endpoint?", "category": "api_usage", "answerable": true, "gold": ["request-files.md"]}
3
+ {"question": "How do I run a task in the background after returning a response?", "category": "api_usage", "answerable": true, "gold": ["background-tasks.md", "background.py"]}
4
+ {"question": "How do I enable CORS so my frontend can call the API?", "category": "api_usage", "answerable": true, "gold": ["cors.md"]}
5
+ {"question": "How do I declare optional query parameters with default values?", "category": "api_usage", "answerable": true, "gold": ["query-params.md"]}
6
+ {"question": "How do I declare a path parameter with a type like int?", "category": "api_usage", "answerable": true, "gold": ["path-params.md"]}
7
+ {"question": "How do I receive a JSON request body using a Pydantic model?", "category": "api_usage", "answerable": true, "gold": ["tutorial/body.md"]}
8
+ {"question": "How do I receive form data instead of JSON?", "category": "api_usage", "answerable": true, "gold": ["request-forms.md"]}
9
+ {"question": "How do I return a custom error response with a specific status code and message?", "category": "api_usage", "answerable": true, "gold": ["handling-errors.md"]}
10
+ {"question": "How do I use response_model to control which fields are returned?", "category": "api_usage", "answerable": true, "gold": ["response-model.md"]}
11
+ {"question": "How do I serve static files like images or CSS?", "category": "api_usage", "answerable": true, "gold": ["static-files.md", "staticfiles.py"]}
12
+ {"question": "How do I write tests for my FastAPI endpoints?", "category": "api_usage", "answerable": true, "gold": ["tutorial/testing.md", "testclient.py"]}
13
+ {"question": "How do I use WebSockets in FastAPI?", "category": "api_usage", "answerable": true, "gold": ["websockets.md"]}
14
+ {"question": "How do I set a cookie in a response?", "category": "api_usage", "answerable": true, "gold": ["response-cookies.md"]}
15
+ {"question": "How do I add custom headers to a response?", "category": "api_usage", "answerable": true, "gold": ["response-headers.md"]}
16
+ {"question": "How do I implement JWT token authentication?", "category": "api_usage", "answerable": true, "gold": ["oauth2-jwt.md"]}
17
+ {"question": "How does FastAPI's dependency injection system work?", "category": "behavior", "answerable": true, "gold": ["dependencies/index.md"]}
18
+ {"question": "What does jsonable_encoder do and when do I need it?", "category": "behavior", "answerable": true, "gold": ["encoder.md", "encoders.py"]}
19
+ {"question": "What is the difference between async def and def endpoints?", "category": "behavior", "answerable": true, "gold": ["async.md"]}
20
+ {"question": "How can a dependency run cleanup code after the response is sent?", "category": "behavior", "answerable": true, "gold": ["dependencies-with-yield.md"]}
21
+ {"question": "How can I customize or extend the generated OpenAPI schema?", "category": "behavior", "answerable": true, "gold": ["extending-openapi.md"]}
22
+ {"question": "What error does FastAPI return when request validation fails, and how do I customize it?", "category": "behavior", "answerable": true, "gold": ["handling-errors.md", "exceptions.py"]}
23
+ {"question": "How does the OAuth2 password flow work in FastAPI?", "category": "behavior", "answerable": true, "gold": ["security/first-steps.md", "simple-oauth2.md"]}
24
+ {"question": "How do I run code on application startup and shutdown?", "category": "behavior", "answerable": true, "gold": ["events.md"]}
25
+ {"question": "Can I mount another application under a path prefix?", "category": "behavior", "answerable": true, "gold": ["sub-applications.md"]}
26
+ {"question": "How does FastAPI run regular def endpoints without blocking the event loop?", "category": "behavior", "answerable": true, "gold": ["async.md", "concurrency.py"]}
27
+ {"question": "How do I manage configuration and settings with environment variables?", "category": "behavior", "answerable": true, "gold": ["settings.md"]}
28
+ {"question": "Where is the APIRouter class defined?", "category": "location", "answerable": true, "gold": ["fastapi/routing.py"]}
29
+ {"question": "Where is the OAuth2PasswordBearer class implemented?", "category": "location", "answerable": true, "gold": ["fastapi/security/oauth2.py"]}
30
+ {"question": "Where is the jsonable_encoder function implemented?", "category": "location", "answerable": true, "gold": ["fastapi/encoders.py"]}
31
+ {"question": "Where is the BackgroundTasks class defined?", "category": "location", "answerable": true, "gold": ["fastapi/background.py"]}
32
+ {"question": "Where is FastAPI's HTTPException defined?", "category": "location", "answerable": true, "gold": ["fastapi/exceptions.py"]}
33
+ {"question": "Where is the main FastAPI application class defined?", "category": "location", "answerable": true, "gold": ["fastapi/applications.py"]}
34
+ {"question": "Where are the Query, Path, and Body parameter functions defined?", "category": "location", "answerable": true, "gold": ["fastapi/param_functions.py"]}
35
+ {"question": "Where is the TestClient that FastAPI provides for testing?", "category": "location", "answerable": true, "gold": ["fastapi/testclient.py"]}
36
+ {"question": "How do I connect FastAPI to MongoDB?", "category": "unanswerable", "answerable": false, "gold": []}
37
+ {"question": "Does FastAPI have built-in rate limiting?", "category": "unanswerable", "answerable": false, "gold": []}
38
+ {"question": "How do I integrate Celery task queues with FastAPI?", "category": "unanswerable", "answerable": false, "gold": []}
39
+ {"question": "How do I use FastAPI with the Django ORM?", "category": "unanswerable", "answerable": false, "gold": []}
40
+ {"question": "Does FastAPI include a built-in admin dashboard?", "category": "unanswerable", "answerable": false, "gold": []}
41
+ {"question": "How do I schedule recurring cron jobs inside FastAPI?", "category": "unanswerable", "answerable": false, "gold": []}
42
+ {"question": "Does FastAPI have built-in database migration support?", "category": "unanswerable", "answerable": false, "gold": []}
data/manifest.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "repo": "fastapi/fastapi",
3
- "ingested_at": "2026-07-03T07:56:26.690336+00:00",
4
  "files": [
5
  {
6
  "source_type": "doc",
@@ -832,6 +832,11 @@
832
  "path": "fastapi/_compat/v2.py",
833
  "size_bytes": 17601
834
  },
 
 
 
 
 
835
  {
836
  "source_type": "code",
837
  "path": "fastapi/background.py",
@@ -957,6 +962,11 @@
957
  "path": "fastapi/responses.py",
958
  "size_bytes": 4144
959
  },
 
 
 
 
 
960
  {
961
  "source_type": "code",
962
  "path": "fastapi/security/__init__.py",
@@ -1028,881 +1038,5 @@
1028
  "size_bytes": 222
1029
  }
1030
  ],
1031
- "issues": [
1032
- {
1033
- "source_type": "issue",
1034
- "path": "issues/617.json",
1035
- "url": "https://github.com/fastapi/fastapi/issues/617"
1036
- },
1037
- {
1038
- "source_type": "issue",
1039
- "path": "issues/142.json",
1040
- "url": "https://github.com/fastapi/fastapi/issues/142"
1041
- },
1042
- {
1043
- "source_type": "issue",
1044
- "path": "issues/10857.json",
1045
- "url": "https://github.com/fastapi/fastapi/issues/10857"
1046
- },
1047
- {
1048
- "source_type": "issue",
1049
- "path": "issues/11143.json",
1050
- "url": "https://github.com/fastapi/fastapi/issues/11143"
1051
- },
1052
- {
1053
- "source_type": "issue",
1054
- "path": "issues/12133.json",
1055
- "url": "https://github.com/fastapi/fastapi/issues/12133"
1056
- },
1057
- {
1058
- "source_type": "issue",
1059
- "path": "issues/754.json",
1060
- "url": "https://github.com/fastapi/fastapi/issues/754"
1061
- },
1062
- {
1063
- "source_type": "issue",
1064
- "path": "issues/11573.json",
1065
- "url": "https://github.com/fastapi/fastapi/issues/11573"
1066
- },
1067
- {
1068
- "source_type": "issue",
1069
- "path": "issues/13399.json",
1070
- "url": "https://github.com/fastapi/fastapi/issues/13399"
1071
- },
1072
- {
1073
- "source_type": "issue",
1074
- "path": "issues/12965.json",
1075
- "url": "https://github.com/fastapi/fastapi/issues/12965"
1076
- },
1077
- {
1078
- "source_type": "issue",
1079
- "path": "issues/12554.json",
1080
- "url": "https://github.com/fastapi/fastapi/issues/12554"
1081
- },
1082
- {
1083
- "source_type": "issue",
1084
- "path": "issues/1773.json",
1085
- "url": "https://github.com/fastapi/fastapi/issues/1773"
1086
- },
1087
- {
1088
- "source_type": "issue",
1089
- "path": "issues/13533.json",
1090
- "url": "https://github.com/fastapi/fastapi/issues/13533"
1091
- },
1092
- {
1093
- "source_type": "issue",
1094
- "path": "issues/10007.json",
1095
- "url": "https://github.com/fastapi/fastapi/issues/10007"
1096
- },
1097
- {
1098
- "source_type": "issue",
1099
- "path": "issues/1273.json",
1100
- "url": "https://github.com/fastapi/fastapi/issues/1273"
1101
- },
1102
- {
1103
- "source_type": "issue",
1104
- "path": "issues/190.json",
1105
- "url": "https://github.com/fastapi/fastapi/issues/190"
1106
- },
1107
- {
1108
- "source_type": "issue",
1109
- "path": "issues/10180.json",
1110
- "url": "https://github.com/fastapi/fastapi/issues/10180"
1111
- },
1112
- {
1113
- "source_type": "issue",
1114
- "path": "issues/4939.json",
1115
- "url": "https://github.com/fastapi/fastapi/issues/4939"
1116
- },
1117
- {
1118
- "source_type": "issue",
1119
- "path": "issues/12402.json",
1120
- "url": "https://github.com/fastapi/fastapi/issues/12402"
1121
- },
1122
- {
1123
- "source_type": "issue",
1124
- "path": "issues/13056.json",
1125
- "url": "https://github.com/fastapi/fastapi/issues/13056"
1126
- },
1127
- {
1128
- "source_type": "issue",
1129
- "path": "issues/3920.json",
1130
- "url": "https://github.com/fastapi/fastapi/issues/3920"
1131
- },
1132
- {
1133
- "source_type": "issue",
1134
- "path": "issues/13400.json",
1135
- "url": "https://github.com/fastapi/fastapi/issues/13400"
1136
- },
1137
- {
1138
- "source_type": "issue",
1139
- "path": "issues/12313.json",
1140
- "url": "https://github.com/fastapi/fastapi/issues/12313"
1141
- },
1142
- {
1143
- "source_type": "issue",
1144
- "path": "issues/10360.json",
1145
- "url": "https://github.com/fastapi/fastapi/issues/10360"
1146
- },
1147
- {
1148
- "source_type": "issue",
1149
- "path": "issues/3163.json",
1150
- "url": "https://github.com/fastapi/fastapi/issues/3163"
1151
- },
1152
- {
1153
- "source_type": "issue",
1154
- "path": "issues/12419.json",
1155
- "url": "https://github.com/fastapi/fastapi/issues/12419"
1156
- },
1157
- {
1158
- "source_type": "issue",
1159
- "path": "issues/2008.json",
1160
- "url": "https://github.com/fastapi/fastapi/issues/2008"
1161
- },
1162
- {
1163
- "source_type": "issue",
1164
- "path": "issues/9424.json",
1165
- "url": "https://github.com/fastapi/fastapi/issues/9424"
1166
- },
1167
- {
1168
- "source_type": "issue",
1169
- "path": "issues/1476.json",
1170
- "url": "https://github.com/fastapi/fastapi/issues/1476"
1171
- },
1172
- {
1173
- "source_type": "issue",
1174
- "path": "issues/14128.json",
1175
- "url": "https://github.com/fastapi/fastapi/issues/14128"
1176
- },
1177
- {
1178
- "source_type": "issue",
1179
- "path": "issues/10177.json",
1180
- "url": "https://github.com/fastapi/fastapi/issues/10177"
1181
- },
1182
- {
1183
- "source_type": "issue",
1184
- "path": "issues/13880.json",
1185
- "url": "https://github.com/fastapi/fastapi/issues/13880"
1186
- },
1187
- {
1188
- "source_type": "issue",
1189
- "path": "issues/12245.json",
1190
- "url": "https://github.com/fastapi/fastapi/issues/12245"
1191
- },
1192
- {
1193
- "source_type": "issue",
1194
- "path": "issues/11037.json",
1195
- "url": "https://github.com/fastapi/fastapi/issues/11037"
1196
- },
1197
- {
1198
- "source_type": "issue",
1199
- "path": "issues/608.json",
1200
- "url": "https://github.com/fastapi/fastapi/issues/608"
1201
- },
1202
- {
1203
- "source_type": "issue",
1204
- "path": "issues/501.json",
1205
- "url": "https://github.com/fastapi/fastapi/issues/501"
1206
- },
1207
- {
1208
- "source_type": "issue",
1209
- "path": "issues/10999.json",
1210
- "url": "https://github.com/fastapi/fastapi/issues/10999"
1211
- },
1212
- {
1213
- "source_type": "issue",
1214
- "path": "issues/10286.json",
1215
- "url": "https://github.com/fastapi/fastapi/issues/10286"
1216
- },
1217
- {
1218
- "source_type": "issue",
1219
- "path": "issues/10259.json",
1220
- "url": "https://github.com/fastapi/fastapi/issues/10259"
1221
- },
1222
- {
1223
- "source_type": "issue",
1224
- "path": "issues/12198.json",
1225
- "url": "https://github.com/fastapi/fastapi/issues/12198"
1226
- },
1227
- {
1228
- "source_type": "issue",
1229
- "path": "issues/10424.json",
1230
- "url": "https://github.com/fastapi/fastapi/issues/10424"
1231
- },
1232
- {
1233
- "source_type": "issue",
1234
- "path": "issues/3500.json",
1235
- "url": "https://github.com/fastapi/fastapi/issues/3500"
1236
- },
1237
- {
1238
- "source_type": "issue",
1239
- "path": "issues/639.json",
1240
- "url": "https://github.com/fastapi/fastapi/issues/639"
1241
- },
1242
- {
1243
- "source_type": "issue",
1244
- "path": "issues/11134.json",
1245
- "url": "https://github.com/fastapi/fastapi/issues/11134"
1246
- },
1247
- {
1248
- "source_type": "issue",
1249
- "path": "issues/10719.json",
1250
- "url": "https://github.com/fastapi/fastapi/issues/10719"
1251
- },
1252
- {
1253
- "source_type": "issue",
1254
- "path": "issues/10236.json",
1255
- "url": "https://github.com/fastapi/fastapi/issues/10236"
1256
- },
1257
- {
1258
- "source_type": "issue",
1259
- "path": "issues/15612.json",
1260
- "url": "https://github.com/fastapi/fastapi/issues/15612"
1261
- },
1262
- {
1263
- "source_type": "issue",
1264
- "path": "issues/15401.json",
1265
- "url": "https://github.com/fastapi/fastapi/issues/15401"
1266
- },
1267
- {
1268
- "source_type": "issue",
1269
- "path": "issues/13471.json",
1270
- "url": "https://github.com/fastapi/fastapi/issues/13471"
1271
- },
1272
- {
1273
- "source_type": "issue",
1274
- "path": "issues/13067.json",
1275
- "url": "https://github.com/fastapi/fastapi/issues/13067"
1276
- },
1277
- {
1278
- "source_type": "issue",
1279
- "path": "issues/11215.json",
1280
- "url": "https://github.com/fastapi/fastapi/issues/11215"
1281
- },
1282
- {
1283
- "source_type": "issue",
1284
- "path": "issues/10787.json",
1285
- "url": "https://github.com/fastapi/fastapi/issues/10787"
1286
- },
1287
- {
1288
- "source_type": "issue",
1289
- "path": "issues/10322.json",
1290
- "url": "https://github.com/fastapi/fastapi/issues/10322"
1291
- },
1292
- {
1293
- "source_type": "issue",
1294
- "path": "issues/3317.json",
1295
- "url": "https://github.com/fastapi/fastapi/issues/3317"
1296
- },
1297
- {
1298
- "source_type": "issue",
1299
- "path": "issues/13175.json",
1300
- "url": "https://github.com/fastapi/fastapi/issues/13175"
1301
- },
1302
- {
1303
- "source_type": "issue",
1304
- "path": "issues/13150.json",
1305
- "url": "https://github.com/fastapi/fastapi/issues/13150"
1306
- },
1307
- {
1308
- "source_type": "issue",
1309
- "path": "issues/12459.json",
1310
- "url": "https://github.com/fastapi/fastapi/issues/12459"
1311
- },
1312
- {
1313
- "source_type": "issue",
1314
- "path": "issues/5060.json",
1315
- "url": "https://github.com/fastapi/fastapi/issues/5060"
1316
- },
1317
- {
1318
- "source_type": "issue",
1319
- "path": "issues/14221.json",
1320
- "url": "https://github.com/fastapi/fastapi/issues/14221"
1321
- },
1322
- {
1323
- "source_type": "issue",
1324
- "path": "issues/12426.json",
1325
- "url": "https://github.com/fastapi/fastapi/issues/12426"
1326
- },
1327
- {
1328
- "source_type": "issue",
1329
- "path": "issues/12246.json",
1330
- "url": "https://github.com/fastapi/fastapi/issues/12246"
1331
- },
1332
- {
1333
- "source_type": "issue",
1334
- "path": "issues/11251.json",
1335
- "url": "https://github.com/fastapi/fastapi/issues/11251"
1336
- },
1337
- {
1338
- "source_type": "issue",
1339
- "path": "issues/10998.json",
1340
- "url": "https://github.com/fastapi/fastapi/issues/10998"
1341
- },
1342
- {
1343
- "source_type": "issue",
1344
- "path": "issues/10997.json",
1345
- "url": "https://github.com/fastapi/fastapi/issues/10997"
1346
- },
1347
- {
1348
- "source_type": "issue",
1349
- "path": "issues/10720.json",
1350
- "url": "https://github.com/fastapi/fastapi/issues/10720"
1351
- },
1352
- {
1353
- "source_type": "issue",
1354
- "path": "issues/10127.json",
1355
- "url": "https://github.com/fastapi/fastapi/issues/10127"
1356
- },
1357
- {
1358
- "source_type": "issue",
1359
- "path": "issues/1204.json",
1360
- "url": "https://github.com/fastapi/fastapi/issues/1204"
1361
- },
1362
- {
1363
- "source_type": "issue",
1364
- "path": "issues/14680.json",
1365
- "url": "https://github.com/fastapi/fastapi/issues/14680"
1366
- },
1367
- {
1368
- "source_type": "issue",
1369
- "path": "issues/12240.json",
1370
- "url": "https://github.com/fastapi/fastapi/issues/12240"
1371
- },
1372
- {
1373
- "source_type": "issue",
1374
- "path": "issues/12239.json",
1375
- "url": "https://github.com/fastapi/fastapi/issues/12239"
1376
- },
1377
- {
1378
- "source_type": "issue",
1379
- "path": "issues/54.json",
1380
- "url": "https://github.com/fastapi/fastapi/issues/54"
1381
- },
1382
- {
1383
- "source_type": "issue",
1384
- "path": "issues/15845.json",
1385
- "url": "https://github.com/fastapi/fastapi/issues/15845"
1386
- },
1387
- {
1388
- "source_type": "issue",
1389
- "path": "issues/15503.json",
1390
- "url": "https://github.com/fastapi/fastapi/issues/15503"
1391
- },
1392
- {
1393
- "source_type": "issue",
1394
- "path": "issues/14454.json",
1395
- "url": "https://github.com/fastapi/fastapi/issues/14454"
1396
- },
1397
- {
1398
- "source_type": "issue",
1399
- "path": "issues/13019.json",
1400
- "url": "https://github.com/fastapi/fastapi/issues/13019"
1401
- },
1402
- {
1403
- "source_type": "issue",
1404
- "path": "issues/11892.json",
1405
- "url": "https://github.com/fastapi/fastapi/issues/11892"
1406
- },
1407
- {
1408
- "source_type": "issue",
1409
- "path": "issues/5642.json",
1410
- "url": "https://github.com/fastapi/fastapi/issues/5642"
1411
- },
1412
- {
1413
- "source_type": "issue",
1414
- "path": "issues/1131.json",
1415
- "url": "https://github.com/fastapi/fastapi/issues/1131"
1416
- },
1417
- {
1418
- "source_type": "issue",
1419
- "path": "issues/15448.json",
1420
- "url": "https://github.com/fastapi/fastapi/issues/15448"
1421
- },
1422
- {
1423
- "source_type": "issue",
1424
- "path": "issues/15188.json",
1425
- "url": "https://github.com/fastapi/fastapi/issues/15188"
1426
- },
1427
- {
1428
- "source_type": "issue",
1429
- "path": "issues/14888.json",
1430
- "url": "https://github.com/fastapi/fastapi/issues/14888"
1431
- },
1432
- {
1433
- "source_type": "issue",
1434
- "path": "issues/14344.json",
1435
- "url": "https://github.com/fastapi/fastapi/issues/14344"
1436
- },
1437
- {
1438
- "source_type": "issue",
1439
- "path": "issues/13606.json",
1440
- "url": "https://github.com/fastapi/fastapi/issues/13606"
1441
- },
1442
- {
1443
- "source_type": "issue",
1444
- "path": "issues/13440.json",
1445
- "url": "https://github.com/fastapi/fastapi/issues/13440"
1446
- },
1447
- {
1448
- "source_type": "issue",
1449
- "path": "issues/13116.json",
1450
- "url": "https://github.com/fastapi/fastapi/issues/13116"
1451
- },
1452
- {
1453
- "source_type": "issue",
1454
- "path": "issues/13022.json",
1455
- "url": "https://github.com/fastapi/fastapi/issues/13022"
1456
- },
1457
- {
1458
- "source_type": "issue",
1459
- "path": "issues/12780.json",
1460
- "url": "https://github.com/fastapi/fastapi/issues/12780"
1461
- },
1462
- {
1463
- "source_type": "issue",
1464
- "path": "issues/12055.json",
1465
- "url": "https://github.com/fastapi/fastapi/issues/12055"
1466
- },
1467
- {
1468
- "source_type": "issue",
1469
- "path": "issues/11580.json",
1470
- "url": "https://github.com/fastapi/fastapi/issues/11580"
1471
- },
1472
- {
1473
- "source_type": "issue",
1474
- "path": "issues/15764.json",
1475
- "url": "https://github.com/fastapi/fastapi/issues/15764"
1476
- },
1477
- {
1478
- "source_type": "issue",
1479
- "path": "issues/15762.json",
1480
- "url": "https://github.com/fastapi/fastapi/issues/15762"
1481
- },
1482
- {
1483
- "source_type": "issue",
1484
- "path": "issues/15716.json",
1485
- "url": "https://github.com/fastapi/fastapi/issues/15716"
1486
- },
1487
- {
1488
- "source_type": "issue",
1489
- "path": "issues/15715.json",
1490
- "url": "https://github.com/fastapi/fastapi/issues/15715"
1491
- },
1492
- {
1493
- "source_type": "issue",
1494
- "path": "issues/15714.json",
1495
- "url": "https://github.com/fastapi/fastapi/issues/15714"
1496
- },
1497
- {
1498
- "source_type": "issue",
1499
- "path": "issues/15713.json",
1500
- "url": "https://github.com/fastapi/fastapi/issues/15713"
1501
- },
1502
- {
1503
- "source_type": "issue",
1504
- "path": "issues/15712.json",
1505
- "url": "https://github.com/fastapi/fastapi/issues/15712"
1506
- },
1507
- {
1508
- "source_type": "issue",
1509
- "path": "issues/15268.json",
1510
- "url": "https://github.com/fastapi/fastapi/issues/15268"
1511
- },
1512
- {
1513
- "source_type": "issue",
1514
- "path": "issues/15118.json",
1515
- "url": "https://github.com/fastapi/fastapi/issues/15118"
1516
- },
1517
- {
1518
- "source_type": "issue",
1519
- "path": "issues/14810.json",
1520
- "url": "https://github.com/fastapi/fastapi/issues/14810"
1521
- },
1522
- {
1523
- "source_type": "issue",
1524
- "path": "issues/14508.json",
1525
- "url": "https://github.com/fastapi/fastapi/issues/14508"
1526
- },
1527
- {
1528
- "source_type": "issue",
1529
- "path": "issues/14496.json",
1530
- "url": "https://github.com/fastapi/fastapi/issues/14496"
1531
- },
1532
- {
1533
- "source_type": "issue",
1534
- "path": "issues/14484.json",
1535
- "url": "https://github.com/fastapi/fastapi/issues/14484"
1536
- },
1537
- {
1538
- "source_type": "issue",
1539
- "path": "issues/14483.json",
1540
- "url": "https://github.com/fastapi/fastapi/issues/14483"
1541
- },
1542
- {
1543
- "source_type": "issue",
1544
- "path": "issues/14467.json",
1545
- "url": "https://github.com/fastapi/fastapi/issues/14467"
1546
- },
1547
- {
1548
- "source_type": "issue",
1549
- "path": "issues/14466.json",
1550
- "url": "https://github.com/fastapi/fastapi/issues/14466"
1551
- },
1552
- {
1553
- "source_type": "issue",
1554
- "path": "issues/14465.json",
1555
- "url": "https://github.com/fastapi/fastapi/issues/14465"
1556
- },
1557
- {
1558
- "source_type": "issue",
1559
- "path": "issues/14444.json",
1560
- "url": "https://github.com/fastapi/fastapi/issues/14444"
1561
- },
1562
- {
1563
- "source_type": "issue",
1564
- "path": "issues/14431.json",
1565
- "url": "https://github.com/fastapi/fastapi/issues/14431"
1566
- },
1567
- {
1568
- "source_type": "issue",
1569
- "path": "issues/14316.json",
1570
- "url": "https://github.com/fastapi/fastapi/issues/14316"
1571
- },
1572
- {
1573
- "source_type": "issue",
1574
- "path": "issues/14271.json",
1575
- "url": "https://github.com/fastapi/fastapi/issues/14271"
1576
- },
1577
- {
1578
- "source_type": "issue",
1579
- "path": "issues/14247.json",
1580
- "url": "https://github.com/fastapi/fastapi/issues/14247"
1581
- },
1582
- {
1583
- "source_type": "issue",
1584
- "path": "issues/13111.json",
1585
- "url": "https://github.com/fastapi/fastapi/issues/13111"
1586
- },
1587
- {
1588
- "source_type": "issue",
1589
- "path": "issues/12901.json",
1590
- "url": "https://github.com/fastapi/fastapi/issues/12901"
1591
- },
1592
- {
1593
- "source_type": "issue",
1594
- "path": "issues/12323.json",
1595
- "url": "https://github.com/fastapi/fastapi/issues/12323"
1596
- },
1597
- {
1598
- "source_type": "issue",
1599
- "path": "issues/12290.json",
1600
- "url": "https://github.com/fastapi/fastapi/issues/12290"
1601
- },
1602
- {
1603
- "source_type": "issue",
1604
- "path": "issues/12017.json",
1605
- "url": "https://github.com/fastapi/fastapi/issues/12017"
1606
- },
1607
- {
1608
- "source_type": "issue",
1609
- "path": "issues/11993.json",
1610
- "url": "https://github.com/fastapi/fastapi/issues/11993"
1611
- },
1612
- {
1613
- "source_type": "issue",
1614
- "path": "issues/11873.json",
1615
- "url": "https://github.com/fastapi/fastapi/issues/11873"
1616
- },
1617
- {
1618
- "source_type": "issue",
1619
- "path": "issues/15855.json",
1620
- "url": "https://github.com/fastapi/fastapi/issues/15855"
1621
- },
1622
- {
1623
- "source_type": "issue",
1624
- "path": "issues/15844.json",
1625
- "url": "https://github.com/fastapi/fastapi/issues/15844"
1626
- },
1627
- {
1628
- "source_type": "issue",
1629
- "path": "issues/15738.json",
1630
- "url": "https://github.com/fastapi/fastapi/issues/15738"
1631
- },
1632
- {
1633
- "source_type": "issue",
1634
- "path": "issues/15680.json",
1635
- "url": "https://github.com/fastapi/fastapi/issues/15680"
1636
- },
1637
- {
1638
- "source_type": "issue",
1639
- "path": "issues/15578.json",
1640
- "url": "https://github.com/fastapi/fastapi/issues/15578"
1641
- },
1642
- {
1643
- "source_type": "issue",
1644
- "path": "issues/15538.json",
1645
- "url": "https://github.com/fastapi/fastapi/issues/15538"
1646
- },
1647
- {
1648
- "source_type": "issue",
1649
- "path": "issues/15535.json",
1650
- "url": "https://github.com/fastapi/fastapi/issues/15535"
1651
- },
1652
- {
1653
- "source_type": "issue",
1654
- "path": "issues/15466.json",
1655
- "url": "https://github.com/fastapi/fastapi/issues/15466"
1656
- },
1657
- {
1658
- "source_type": "issue",
1659
- "path": "issues/15325.json",
1660
- "url": "https://github.com/fastapi/fastapi/issues/15325"
1661
- },
1662
- {
1663
- "source_type": "issue",
1664
- "path": "issues/15324.json",
1665
- "url": "https://github.com/fastapi/fastapi/issues/15324"
1666
- },
1667
- {
1668
- "source_type": "issue",
1669
- "path": "issues/15322.json",
1670
- "url": "https://github.com/fastapi/fastapi/issues/15322"
1671
- },
1672
- {
1673
- "source_type": "issue",
1674
- "path": "issues/15238.json",
1675
- "url": "https://github.com/fastapi/fastapi/issues/15238"
1676
- },
1677
- {
1678
- "source_type": "issue",
1679
- "path": "issues/15237.json",
1680
- "url": "https://github.com/fastapi/fastapi/issues/15237"
1681
- },
1682
- {
1683
- "source_type": "issue",
1684
- "path": "issues/15236.json",
1685
- "url": "https://github.com/fastapi/fastapi/issues/15236"
1686
- },
1687
- {
1688
- "source_type": "issue",
1689
- "path": "issues/15197.json",
1690
- "url": "https://github.com/fastapi/fastapi/issues/15197"
1691
- },
1692
- {
1693
- "source_type": "issue",
1694
- "path": "issues/15138.json",
1695
- "url": "https://github.com/fastapi/fastapi/issues/15138"
1696
- },
1697
- {
1698
- "source_type": "issue",
1699
- "path": "issues/15111.json",
1700
- "url": "https://github.com/fastapi/fastapi/issues/15111"
1701
- },
1702
- {
1703
- "source_type": "issue",
1704
- "path": "issues/15085.json",
1705
- "url": "https://github.com/fastapi/fastapi/issues/15085"
1706
- },
1707
- {
1708
- "source_type": "issue",
1709
- "path": "issues/15049.json",
1710
- "url": "https://github.com/fastapi/fastapi/issues/15049"
1711
- },
1712
- {
1713
- "source_type": "issue",
1714
- "path": "issues/15002.json",
1715
- "url": "https://github.com/fastapi/fastapi/issues/15002"
1716
- },
1717
- {
1718
- "source_type": "issue",
1719
- "path": "issues/15000.json",
1720
- "url": "https://github.com/fastapi/fastapi/issues/15000"
1721
- },
1722
- {
1723
- "source_type": "issue",
1724
- "path": "issues/14989.json",
1725
- "url": "https://github.com/fastapi/fastapi/issues/14989"
1726
- },
1727
- {
1728
- "source_type": "issue",
1729
- "path": "issues/14988.json",
1730
- "url": "https://github.com/fastapi/fastapi/issues/14988"
1731
- },
1732
- {
1733
- "source_type": "issue",
1734
- "path": "issues/14787.json",
1735
- "url": "https://github.com/fastapi/fastapi/issues/14787"
1736
- },
1737
- {
1738
- "source_type": "issue",
1739
- "path": "issues/14503.json",
1740
- "url": "https://github.com/fastapi/fastapi/issues/14503"
1741
- },
1742
- {
1743
- "source_type": "issue",
1744
- "path": "issues/14502.json",
1745
- "url": "https://github.com/fastapi/fastapi/issues/14502"
1746
- },
1747
- {
1748
- "source_type": "issue",
1749
- "path": "issues/14501.json",
1750
- "url": "https://github.com/fastapi/fastapi/issues/14501"
1751
- },
1752
- {
1753
- "source_type": "issue",
1754
- "path": "issues/14500.json",
1755
- "url": "https://github.com/fastapi/fastapi/issues/14500"
1756
- },
1757
- {
1758
- "source_type": "issue",
1759
- "path": "issues/14499.json",
1760
- "url": "https://github.com/fastapi/fastapi/issues/14499"
1761
- },
1762
- {
1763
- "source_type": "issue",
1764
- "path": "issues/14498.json",
1765
- "url": "https://github.com/fastapi/fastapi/issues/14498"
1766
- },
1767
- {
1768
- "source_type": "issue",
1769
- "path": "issues/14497.json",
1770
- "url": "https://github.com/fastapi/fastapi/issues/14497"
1771
- },
1772
- {
1773
- "source_type": "issue",
1774
- "path": "issues/14494.json",
1775
- "url": "https://github.com/fastapi/fastapi/issues/14494"
1776
- },
1777
- {
1778
- "source_type": "issue",
1779
- "path": "issues/14493.json",
1780
- "url": "https://github.com/fastapi/fastapi/issues/14493"
1781
- },
1782
- {
1783
- "source_type": "issue",
1784
- "path": "issues/14312.json",
1785
- "url": "https://github.com/fastapi/fastapi/issues/14312"
1786
- },
1787
- {
1788
- "source_type": "issue",
1789
- "path": "issues/14225.json",
1790
- "url": "https://github.com/fastapi/fastapi/issues/14225"
1791
- },
1792
- {
1793
- "source_type": "issue",
1794
- "path": "issues/14199.json",
1795
- "url": "https://github.com/fastapi/fastapi/issues/14199"
1796
- },
1797
- {
1798
- "source_type": "issue",
1799
- "path": "issues/14114.json",
1800
- "url": "https://github.com/fastapi/fastapi/issues/14114"
1801
- },
1802
- {
1803
- "source_type": "issue",
1804
- "path": "issues/14078.json",
1805
- "url": "https://github.com/fastapi/fastapi/issues/14078"
1806
- },
1807
- {
1808
- "source_type": "issue",
1809
- "path": "issues/14010.json",
1810
- "url": "https://github.com/fastapi/fastapi/issues/14010"
1811
- },
1812
- {
1813
- "source_type": "issue",
1814
- "path": "issues/13839.json",
1815
- "url": "https://github.com/fastapi/fastapi/issues/13839"
1816
- },
1817
- {
1818
- "source_type": "issue",
1819
- "path": "issues/13715.json",
1820
- "url": "https://github.com/fastapi/fastapi/issues/13715"
1821
- },
1822
- {
1823
- "source_type": "issue",
1824
- "path": "issues/13316.json",
1825
- "url": "https://github.com/fastapi/fastapi/issues/13316"
1826
- },
1827
- {
1828
- "source_type": "issue",
1829
- "path": "issues/13119.json",
1830
- "url": "https://github.com/fastapi/fastapi/issues/13119"
1831
- },
1832
- {
1833
- "source_type": "issue",
1834
- "path": "issues/13023.json",
1835
- "url": "https://github.com/fastapi/fastapi/issues/13023"
1836
- },
1837
- {
1838
- "source_type": "issue",
1839
- "path": "issues/12987.json",
1840
- "url": "https://github.com/fastapi/fastapi/issues/12987"
1841
- },
1842
- {
1843
- "source_type": "issue",
1844
- "path": "issues/12963.json",
1845
- "url": "https://github.com/fastapi/fastapi/issues/12963"
1846
- },
1847
- {
1848
- "source_type": "issue",
1849
- "path": "issues/12936.json",
1850
- "url": "https://github.com/fastapi/fastapi/issues/12936"
1851
- },
1852
- {
1853
- "source_type": "issue",
1854
- "path": "issues/12924.json",
1855
- "url": "https://github.com/fastapi/fastapi/issues/12924"
1856
- },
1857
- {
1858
- "source_type": "issue",
1859
- "path": "issues/12765.json",
1860
- "url": "https://github.com/fastapi/fastapi/issues/12765"
1861
- },
1862
- {
1863
- "source_type": "issue",
1864
- "path": "issues/12497.json",
1865
- "url": "https://github.com/fastapi/fastapi/issues/12497"
1866
- },
1867
- {
1868
- "source_type": "issue",
1869
- "path": "issues/12425.json",
1870
- "url": "https://github.com/fastapi/fastapi/issues/12425"
1871
- },
1872
- {
1873
- "source_type": "issue",
1874
- "path": "issues/12382.json",
1875
- "url": "https://github.com/fastapi/fastapi/issues/12382"
1876
- },
1877
- {
1878
- "source_type": "issue",
1879
- "path": "issues/12111.json",
1880
- "url": "https://github.com/fastapi/fastapi/issues/12111"
1881
- },
1882
- {
1883
- "source_type": "issue",
1884
- "path": "issues/12039.json",
1885
- "url": "https://github.com/fastapi/fastapi/issues/12039"
1886
- },
1887
- {
1888
- "source_type": "issue",
1889
- "path": "issues/12010.json",
1890
- "url": "https://github.com/fastapi/fastapi/issues/12010"
1891
- },
1892
- {
1893
- "source_type": "issue",
1894
- "path": "issues/11989.json",
1895
- "url": "https://github.com/fastapi/fastapi/issues/11989"
1896
- },
1897
- {
1898
- "source_type": "issue",
1899
- "path": "issues/11941.json",
1900
- "url": "https://github.com/fastapi/fastapi/issues/11941"
1901
- },
1902
- {
1903
- "source_type": "issue",
1904
- "path": "issues/11812.json",
1905
- "url": "https://github.com/fastapi/fastapi/issues/11812"
1906
- }
1907
- ]
1908
  }
 
1
  {
2
  "repo": "fastapi/fastapi",
3
+ "ingested_at": "2026-07-03T15:24:59.452448+00:00",
4
  "files": [
5
  {
6
  "source_type": "doc",
 
832
  "path": "fastapi/_compat/v2.py",
833
  "size_bytes": 17601
834
  },
835
+ {
836
+ "source_type": "code",
837
+ "path": "fastapi/applications.py",
838
+ "size_bytes": 183452
839
+ },
840
  {
841
  "source_type": "code",
842
  "path": "fastapi/background.py",
 
962
  "path": "fastapi/responses.py",
963
  "size_bytes": 4144
964
  },
965
+ {
966
+ "source_type": "code",
967
+ "path": "fastapi/routing.py",
968
+ "size_bytes": 253241
969
+ },
970
  {
971
  "source_type": "code",
972
  "path": "fastapi/security/__init__.py",
 
1038
  "size_bytes": 222
1039
  }
1040
  ],
1041
+ "issues": []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1042
  }
src/eval.py ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Evaluate the RAG pipeline against a hand-labeled question set.
2
+
3
+ Metrics:
4
+ recall@k - did any gold source appear in the top-k retrieved chunks?
5
+ MRR - 1/rank of the first gold hit (higher = ranked better)
6
+ refusal - (with --answers) did unanswerable questions get a refusal?
7
+ faithful/correct - (with --answers) LLM-as-judge on generated answers
8
+
9
+ Gold labels are substrings matched (case-insensitive) against each retrieved
10
+ chunk's id/path/symbol, so you label "where the answer lives", not exact ids.
11
+
12
+ LLM answers and judgments are cached in data/eval_cache.json so re-runs
13
+ are free and fast (important on Groq's free-tier rate limits).
14
+
15
+ Usage:
16
+ python src/eval.py # retrieval metrics only (no LLM, fast)
17
+ python src/eval.py --answers # + generation, refusal, judge metrics
18
+ """
19
+
20
+ import argparse
21
+ import hashlib
22
+ import json
23
+ import time
24
+ from pathlib import Path
25
+
26
+ import chromadb
27
+ from sentence_transformers import SentenceTransformer
28
+
29
+ DATA_DIR = Path("data")
30
+ EVAL_SET = DATA_DIR / "eval_set.jsonl"
31
+ CACHE_FILE = DATA_DIR / "eval_cache.json"
32
+ EMBED_MODEL = "BAAI/bge-small-en-v1.5"
33
+ QUERY_PREFIX = "Represent this sentence for searching relevant passages: "
34
+ K = 5
35
+ REFUSAL_TEXT = "I couldn't find this in the indexed codebase"
36
+ SLEEP_BETWEEN_LLM_CALLS = 2 # stay under free-tier rate limits
37
+
38
+ JUDGE_PROMPT = """\
39
+ You are grading a RAG system's answer. Given the question, the context the
40
+ system retrieved, and its answer, output ONLY a JSON object:
41
+ {{"faithful": true/false, "correct": true/false}}
42
+
43
+ faithful = every claim in the answer is supported by the context
44
+ correct = the answer actually answers the question accurately
45
+
46
+ Question: {question}
47
+
48
+ Context:
49
+ {context}
50
+
51
+ Answer:
52
+ {answer}"""
53
+
54
+
55
+ def load_cache() -> dict:
56
+ if CACHE_FILE.exists():
57
+ return json.loads(CACHE_FILE.read_text())
58
+ return {}
59
+
60
+
61
+ def save_cache(cache: dict) -> None:
62
+ CACHE_FILE.write_text(json.dumps(cache, ensure_ascii=False, indent=2))
63
+
64
+
65
+ def cache_key(*parts: str) -> str:
66
+ return hashlib.sha256("||".join(parts).encode()).hexdigest()[:16]
67
+
68
+
69
+ def is_gold_hit(chunk_id: str, meta: dict, gold: list[str]) -> bool:
70
+ haystack = f"{chunk_id} {meta.get('path', '')} {meta.get('symbol', '')}".lower()
71
+ return any(g.lower() in haystack for g in gold)
72
+
73
+
74
+ def main() -> None:
75
+ parser = argparse.ArgumentParser()
76
+ parser.add_argument("--answers", action="store_true",
77
+ help="also generate answers and run the LLM judge")
78
+ parser.add_argument("--k", type=int, default=K)
79
+ args = parser.parse_args()
80
+
81
+ items = [json.loads(line)
82
+ for line in EVAL_SET.read_text().splitlines() if line.strip()]
83
+ print(f"[eval] {len(items)} questions "
84
+ f"({sum(i['answerable'] for i in items)} answerable)")
85
+
86
+ model = SentenceTransformer(EMBED_MODEL)
87
+ collection = chromadb.PersistentClient(
88
+ path=str(DATA_DIR / "chroma")).get_collection("chunks")
89
+ cache = load_cache()
90
+
91
+ # -------- retrieval metrics --------
92
+ recalls, mrrs = [], []
93
+ retrieved_per_q = [] # keep for the answer phase
94
+ for item in items:
95
+ emb = model.encode(QUERY_PREFIX + item["question"],
96
+ normalize_embeddings=True)
97
+ res = collection.query(query_embeddings=[emb.tolist()],
98
+ n_results=args.k)
99
+ hits = list(zip(res["ids"][0], res["metadatas"][0],
100
+ res["documents"][0]))
101
+ retrieved_per_q.append(hits)
102
+
103
+ if not item["answerable"]:
104
+ continue
105
+ rank = next((r for r, (cid, meta, _) in enumerate(hits, 1)
106
+ if is_gold_hit(cid, meta, item["gold"])), None)
107
+ recalls.append(1.0 if rank else 0.0)
108
+ mrrs.append(1.0 / rank if rank else 0.0)
109
+ if not rank:
110
+ print(f" [miss] {item['question']}")
111
+
112
+ print(f"\n=== Retrieval (k={args.k}) ===")
113
+ print(f"recall@{args.k}: {sum(recalls)/len(recalls):.2f} "
114
+ f"({int(sum(recalls))}/{len(recalls)})")
115
+ print(f"MRR: {sum(mrrs)/len(mrrs):.2f}")
116
+
117
+ if not args.answers:
118
+ print("\n(retrieval-only run; add --answers for generation metrics)")
119
+ return
120
+
121
+ # -------- generation + judge metrics --------
122
+ from ask import SYSTEM_PROMPT, build_prompt # reuse the real pipeline
123
+ import os
124
+ from groq import Groq
125
+ client = Groq(api_key=os.environ["GROQ_API_KEY"])
126
+ llm_model = os.environ.get("GROQ_MODEL", "openai/gpt-oss-120b")
127
+
128
+ def llm(prompt: str, system: str | None = None) -> str:
129
+ key = cache_key(llm_model, system or "", prompt)
130
+ if key in cache:
131
+ return cache[key]
132
+ messages = ([{"role": "system", "content": system}] if system else [])
133
+ messages.append({"role": "user", "content": prompt})
134
+ out = client.chat.completions.create(
135
+ model=llm_model, messages=messages,
136
+ temperature=0.1).choices[0].message.content
137
+ cache[key] = out
138
+ save_cache(cache)
139
+ time.sleep(SLEEP_BETWEEN_LLM_CALLS)
140
+ return out
141
+
142
+ refusal_ok, faithful, correct = [], [], []
143
+ for item, hits in zip(items, retrieved_per_q):
144
+ hit_dicts = [{"text": doc, "meta": meta}
145
+ for cid, meta, doc in hits]
146
+ ans = llm(build_prompt(item["question"], hit_dicts),
147
+ system=SYSTEM_PROMPT)
148
+
149
+ if not item["answerable"]:
150
+ ok = REFUSAL_TEXT.lower() in ans.lower()
151
+ refusal_ok.append(1.0 if ok else 0.0)
152
+ if not ok:
153
+ print(f" [no refusal] {item['question']}")
154
+ continue
155
+
156
+ context = "\n\n".join(h["text"][:1500] for h in hit_dicts)
157
+ verdict_raw = llm(JUDGE_PROMPT.format(
158
+ question=item["question"], context=context, answer=ans))
159
+ try:
160
+ start = verdict_raw.index("{")
161
+ end = verdict_raw.rindex("}") + 1
162
+ verdict = json.loads(verdict_raw[start:end])
163
+ except (ValueError, json.JSONDecodeError):
164
+ print(f" [judge parse fail] {item['question']}")
165
+ continue
166
+ faithful.append(1.0 if verdict.get("faithful") else 0.0)
167
+ correct.append(1.0 if verdict.get("correct") else 0.0)
168
+ if not verdict.get("correct"):
169
+ print(f" [incorrect] {item['question']}")
170
+
171
+ print("\n=== Generation ===")
172
+ if faithful:
173
+ print(f"faithful: {sum(faithful)/len(faithful):.2f}")
174
+ print(f"correct: {sum(correct)/len(correct):.2f}")
175
+ if refusal_ok:
176
+ print(f"refusal: {sum(refusal_ok)/len(refusal_ok):.2f} "
177
+ f"({int(sum(refusal_ok))}/{len(refusal_ok)})")
178
+
179
+
180
+ if __name__ == "__main__":
181
+ main()
src/ingest.py CHANGED
@@ -16,7 +16,7 @@ SKIP_DIRS = {".git", ".github", "__pycache__", "node_modules", "tests", "test",
16
  "scripts"}
17
  CODE_EXTS = {".py"}
18
  DOC_EXTS = {".md"}
19
- MAX_FILE_BYTES = 100_000 # skip generated/vendored monsters
20
  ISSUE_LOOKBACK_DAYS = 730 # ~2 years
21
 
22
 
 
16
  "scripts"}
17
  CODE_EXTS = {".py"}
18
  DOC_EXTS = {".md"}
19
+ MAX_FILE_BYTES = 400_000 # skip generated/vendored monsters
20
  ISSUE_LOOKBACK_DAYS = 730 # ~2 years
21
 
22