failed LOOP LOOP wrong_fix · 25 tool calls · 197 s · fastapi/fastapi
✨ Add support for `@app.vibe()` ✨ Add support for `@app.vibe()`
| # | Tool | Arguments | Result |
|---|---|---|---|
| 1 | run_command | {
"command": "grep -rn \"class FastAPI\" . | head -20"
} | {"status": "ok", "stdout": "./fastapi/applications.py:41:class FastAPI(Starlette):\n./fastapi/exceptions.py:161:class FastAPIError(RuntimeError):\n./fastapi/excfull{"status": "ok", "stdout": "./fastapi/applications.py:41:class FastAPI(Starlette):\n./fastapi/exceptions.py:161:class FastAPIError(RuntimeError):\n./fastapi/exceptions.py:252:class FastAPIDeprecationWarning(UserWarning):\n", "exit_code": 0} |
| 2 | read_file | {
"end_line": 100,
"filepath": "fastapi/applications.py",
"start_line": 41
} | {"status": "ok", "filepath": "fastapi/applications.py", "content": "class FastAPI(Starlette):\n \"\"\"\n `FastAPI` app class, the main entrypoint to use FastAPIfull{"status": "ok", "filepath": "fastapi/applications.py", "content": "class FastAPI(Starlette):\n \"\"\"\n `FastAPI` app class, the main entrypoint to use FastAPI.\n\n Read more in the\n [FastAPI docs for First Steps](https://fastapi.tiangolo.com/tutorial/first-steps/).\n\n ## Example\n\n ```python\n from fastapi import FastAPI\n\n app = FastAPI()\n ```\n \"\"\"\n\n def __init__(\n self: AppType,\n *,\n debug: Annotated[\n bool,\n Doc(\n \"\"\"\n Boolean indicating if debug tracebacks should be returned on server\n errors.\n\n Read more in the\n [Starlette docs for Applications](https://www.starlette.dev/applications/#instantiating-the-application).\n \"\"\"\n ),\n ] = False,\n routes: Annotated[\n list[BaseRoute] | None,\n Doc(\n \"\"\"\n **Note**: you probably shouldn't use this parameter, it is inherited\n from Starlette and supported for compatibility.\n\n ---\n\n A list of routes to serve incoming HTTP and WebSocket requests.\n \"\"\"\n ),\n deprecated(\n \"\"\"\n You normally wouldn't use this parameter with FastAPI, it is inherited\n from Starlette and supported for compatibility.\n\n In FastAPI, you normally would use the *path operation methods*,\n like `app.get()`, `app.post()`, etc.\n \"\"\"\n ),\n ] = None,\n title: Annotated[\n str,\n Doc(\n \"\"\"\n The title of the API.\n\n It will be added to the generated OpenAPI (e.g. visible at `/docs`).\n", "start_line": 41, "end_line": 100, "total_lines": 4691, "is_truncated": false} |
| 3 | run_command | {
"command": "grep -n \"def get(\" fastapi/applications.py | head -10"
} | {"status": "ok", "stdout": "1563: def get(\n", "exit_code": 0}full{"status": "ok", "stdout": "1563: def get(\n", "exit_code": 0} |
| 4 | read_file | {
"end_line": 1600,
"filepath": "fastapi/applications.py",
"start_line": 1560
} | {"status": "ok", "filepath": "fastapi/applications.py", "content": " generate_unique_id_function=generate_unique_id_function,\n )\n\n def get(\n self,\n path: Afull{"status": "ok", "filepath": "fastapi/applications.py", "content": " generate_unique_id_function=generate_unique_id_function,\n )\n\n def get(\n self,\n path: Annotated[\n str,\n Doc(\n \"\"\"\n The URL path to be used for this *path operation*.\n\n For example, in `http://example.com/items`, the path is `/items`.\n \"\"\"\n ),\n ],\n *,\n response_model: Annotated[\n Any,\n Doc(\n \"\"\"\n The type to use for the response.\n\n It could be any valid Pydantic *field* type. So, it doesn't have to\n be a Pydantic model, it could be other things, like a `list`, `dict`,\n etc.\n\n It will be used for:\n\n * Documentation: the generated OpenAPI (and the UI at `/docs`) will\n show it as the response (JSON Schema).\n * Serialization: you could return an arbitrary object and the\n `response_model` would be used to serialize that object into the\n corresponding JSON.\n * Filtering: the JSON sent to the client will only contain the data\n (fields) defined in the `response_model`. If you returned an object\n that contains an attribute `password` but the `response_model` does\n not include that field, the JSON sent to the client would not have\n that `password`.\n * Validation: whatever you return will be serialized with the\n `response_model`, converting any data as necessary to generate the\n corresponding JSON. But if the data in the object returned is not\n", "start_line": 1560, "end_line": 1600, "total_lines": 4691, "is_truncated": false} |
| 5 | read_file | {
"end_line": 1700,
"filepath": "fastapi/applications.py",
"start_line": 1650
} | {"status": "ok", "filepath": "fastapi/applications.py", "content": " Doc(\n \"\"\"\n A summary for the *path operation*.\n\n It will be added to the generated Ofull{"status": "ok", "filepath": "fastapi/applications.py", "content": " Doc(\n \"\"\"\n A summary for the *path operation*.\n\n It will be added to the generated OpenAPI (e.g. visible at `/docs`).\n\n Read more about it in the\n [FastAPI docs for Path Operation Configuration](https://fastapi.tiangolo.com/tutorial/path-operation-configuration/).\n \"\"\"\n ),\n ] = None,\n description: Annotated[\n str | None,\n Doc(\n \"\"\"\n A description for the *path operation*.\n\n If not provided, it will be extracted automatically from the docstring\n of the *path operation function*.\n\n It can contain Markdown.\n\n It will be added to the generated OpenAPI (e.g. visible at `/docs`).\n\n Read more about it in the\n [FastAPI docs for Path Operation Configuration](https://fastapi.tiangolo.com/tutorial/path-operation-configuration/).\n \"\"\"\n ),\n ] = None,\n response_description: Annotated[\n str,\n Doc(\n \"\"\"\n The description for the default response.\n\n It will be added to the generated OpenAPI (e.g. visible at `/docs`).\n \"\"\"\n ),\n ] = \"Successful Response\",\n responses: Annotated[\n dict[int | str, dict[str, Any]] | None,\n Doc(\n \"\"\"\n Additional responses that could be returned by this *path operation*.\n\n It will be added to the generated OpenAPI (e.g. visible at `/docs`).\n \"\"\"\n ),\n ] = None,\n deprecated: Annotated[\n bool | None,\n", "start_line": 1650, "end_line": 1700, "total_lines": 4691, "is_truncated": false} |
| 6 | run_command | {
"command": "grep -n \"def api_route\" fastapi/applications.py"
} | {"status": "ok", "stdout": "1218: def api_route(\n", "exit_code": 0}full{"status": "ok", "stdout": "1218: def api_route(\n", "exit_code": 0} |
| 7 | read_file | {
"end_line": 1260,
"filepath": "fastapi/applications.py",
"start_line": 1218
} | {"status": "ok", "filepath": "fastapi/applications.py", "content": " def api_route(\n self,\n path: str,\n *,\n response_model: Any = Default(None),\n status_cofull{"status": "ok", "filepath": "fastapi/applications.py", "content": " def api_route(\n self,\n path: str,\n *,\n response_model: Any = Default(None),\n status_code: int | None = None,\n tags: list[str | Enum] | None = None,\n dependencies: Sequence[Depends] | None = None,\n summary: str | None = None,\n description: str | None = None,\n response_description: str = \"Successful Response\",\n responses: dict[int | str, dict[str, Any]] | None = None,\n deprecated: bool | None = None,\n methods: list[str] | None = None,\n operation_id: str | None = None,\n response_model_include: IncEx | None = None,\n response_model_exclude: IncEx | None = None,\n response_model_by_alias: bool = True,\n response_model_exclude_unset: bool = False,\n response_model_exclude_defaults: bool = False,\n response_model_exclude_none: bool = False,\n include_in_schema: bool = True,\n response_class: type[Response] = Default(JSONResponse),\n name: str | None = None,\n openapi_extra: dict[str, Any] | None = None,\n generate_unique_id_function: Callable[[routing.APIRoute], str] = Default(\n generate_unique_id\n ),\n ) -> Callable[[DecoratedCallable], DecoratedCallable]:\n def decorator(func: DecoratedCallable) -> DecoratedCallable:\n self.router.add_api_route(\n path,\n func,\n response_model=response_model,\n status_code=status_code,\n tags=tags,\n dependencies=dependencies,\n summary=summary,\n description=description,\n response_description=response_description,\n responses=responses,\n deprecated=deprecated,\n methods=methods,\n", "start_line": 1218, "end_line": 1260, "total_lines": 4691, "is_truncated": f |
| 8 | read_file | {
"filepath": "fastapi/applications.py",
"start_line": 1200,
"end_line": 1300
} | {"status": "ok", "filepath": "fastapi/applications.py", "content": " response_description=response_description,\n responses=responses,\n deprecated=deprecated,\full{"status": "ok", "filepath": "fastapi/applications.py", "content": " response_description=response_description,\n responses=responses,\n deprecated=deprecated,\n methods=methods,\n operation_id=operation_id,\n response_model_include=response_model_include,\n response_model_exclude=response_model_exclude,\n response_model_by_alias=response_model_by_alias,\n response_model_exclude_unset=response_model_exclude_unset,\n response_model_exclude_defaults=response_model_exclude_defaults,\n response_model_exclude_none=response_model_exclude_none,\n include_in_schema=include_in_schema,\n response_class=response_class,\n name=name,\n openapi_extra=openapi_extra,\n generate_unique_id_function=generate_unique_id_function,\n )\n\n def api_route(\n self,\n path: str,\n *,\n response_model: Any = Default(None),\n status_code: int | None = None,\n tags: list[str | Enum] | None = None,\n dependencies: Sequence[Depends] | None = None,\n summary: str | None = None,\n description: str | None = None,\n response_description: str = \"Successful Response\",\n responses: dict[int | str, dict[str, Any]] | None = None,\n deprecated: bool | None = None,\n methods: list[str] | None = None,\n operation_id: str | None = None,\n response_model_include: IncEx | None = None,\n response_model_exclude: IncEx | None = None,\n response_model_by_alias: bool = True,\n response_model_exclude_unset: bool = False,\n response_model_exclude_defaults: bool = False,\n response_model_exclude_none: bool = False,\n include_in_schema: bool = True,\n response_class: type[Response] = Default(JSONResponse),\n name: str | None = None,\n openapi_extra: dict[str, Any] | None |
| 9-11 ×3 | read_file | {
"end_line": 1200,
"filepath": "fastapi/applications.py",
"start_line": 1100
} | {"status": "ok", "filepath": "fastapi/applications.py", "content": "\n def setup(self) -> None:\n if self.openapi_url:\n\n async def openapi(req: Request) -> JSfull{"status": "ok", "filepath": "fastapi/applications.py", "content": "\n def setup(self) -> None:\n if self.openapi_url:\n\n async def openapi(req: Request) -> JSONResponse:\n root_path = req.scope.get(\"root_path\", \"\").rstrip(\"/\")\n schema = self.openapi()\n if root_path and self.root_path_in_servers:\n server_urls = {s.get(\"url\") for s in schema.get(\"servers\", [])}\n if root_path not in server_urls:\n schema = dict(schema)\n schema[\"servers\"] = [{\"url\": root_path}] + schema.get(\n \"servers\", []\n )\n return JSONResponse(schema)\n\n self.add_route(self.openapi_url, openapi, include_in_schema=False)\n if self.openapi_url and self.docs_url:\n\n async def swagger_ui_html(req: Request) -> HTMLResponse:\n root_path = req.scope.get(\"root_path\", \"\").rstrip(\"/\")\n openapi_url = root_path + self.openapi_url\n oauth2_redirect_url = self.swagger_ui_oauth2_redirect_url\n if oauth2_redirect_url:\n oauth2_redirect_url = root_path + oauth2_redirect_url\n return get_swagger_ui_html(\n openapi_url=openapi_url,\n title=f\"{self.title} - Swagger UI\",\n oauth2_redirect_url=oauth2_redirect_url,\n init_oauth=self.swagger_ui_init_oauth,\n swagger_ui_parameters=self.swagger_ui_parameters,\n )\n\n self.add_route(self.docs_url, swagger_ui_html, include_in_schema=False)\n\n if self.swagger_ui_oauth2_redirect_url:\n\n async def swagger_ui_redirect(req: Request) -> HTMLResponse:\n return get_swagger_ui_oauth2_redirect_html()\n\n self.add_route(\n |
| 12 | read_file | {
"end_line": 1250,
"filepath": "fastapi/applications.py",
"start_line": 1210
} | {"status": "ok", "filepath": "fastapi/applications.py", "content": " response_model_exclude_none=response_model_exclude_none,\n include_in_schema=include_in_schfull{"status": "ok", "filepath": "fastapi/applications.py", "content": " response_model_exclude_none=response_model_exclude_none,\n include_in_schema=include_in_schema,\n response_class=response_class,\n name=name,\n openapi_extra=openapi_extra,\n generate_unique_id_function=generate_unique_id_function,\n )\n\n def api_route(\n self,\n path: str,\n *,\n response_model: Any = Default(None),\n status_code: int | None = None,\n tags: list[str | Enum] | None = None,\n dependencies: Sequence[Depends] | None = None,\n summary: str | None = None,\n description: str | None = None,\n response_description: str = \"Successful Response\",\n responses: dict[int | str, dict[str, Any]] | None = None,\n deprecated: bool | None = None,\n methods: list[str] | None = None,\n operation_id: str | None = None,\n response_model_include: IncEx | None = None,\n response_model_exclude: IncEx | None = None,\n response_model_by_alias: bool = True,\n response_model_exclude_unset: bool = False,\n response_model_exclude_defaults: bool = False,\n response_model_exclude_none: bool = False,\n include_in_schema: bool = True,\n response_class: type[Response] = Default(JSONResponse),\n name: str | None = None,\n openapi_extra: dict[str, Any] | None = None,\n generate_unique_id_function: Callable[[routing.APIRoute], str] = Default(\n generate_unique_id\n ),\n ) -> Callable[[DecoratedCallable], DecoratedCallable]:\n def decorator(func: DecoratedCallable) -> DecoratedCallable:\n self.router.add_api_route(\n path,\n func,\n", "start_line": 1210, "end_line": 1250, "total_lines": 4691, "is_truncated": false} |
| 13-14 ×2 | read_file | {
"end_line": 1200,
"filepath": "fastapi/applications.py",
"start_line": 1100
} | {"status": "ok", "filepath": "fastapi/applications.py", "content": "\n def setup(self) -> None:\n if self.openapi_url:\n\n async def openapi(req: Request) -> JSfull{"status": "ok", "filepath": "fastapi/applications.py", "content": "\n def setup(self) -> None:\n if self.openapi_url:\n\n async def openapi(req: Request) -> JSONResponse:\n root_path = req.scope.get(\"root_path\", \"\").rstrip(\"/\")\n schema = self.openapi()\n if root_path and self.root_path_in_servers:\n server_urls = {s.get(\"url\") for s in schema.get(\"servers\", [])}\n if root_path not in server_urls:\n schema = dict(schema)\n schema[\"servers\"] = [{\"url\": root_path}] + schema.get(\n \"servers\", []\n )\n return JSONResponse(schema)\n\n self.add_route(self.openapi_url, openapi, include_in_schema=False)\n if self.openapi_url and self.docs_url:\n\n async def swagger_ui_html(req: Request) -> HTMLResponse:\n root_path = req.scope.get(\"root_path\", \"\").rstrip(\"/\")\n openapi_url = root_path + self.openapi_url\n oauth2_redirect_url = self.swagger_ui_oauth2_redirect_url\n if oauth2_redirect_url:\n oauth2_redirect_url = root_path + oauth2_redirect_url\n return get_swagger_ui_html(\n openapi_url=openapi_url,\n title=f\"{self.title} - Swagger UI\",\n oauth2_redirect_url=oauth2_redirect_url,\n init_oauth=self.swagger_ui_init_oauth,\n swagger_ui_parameters=self.swagger_ui_parameters,\n )\n\n self.add_route(self.docs_url, swagger_ui_html, include_in_schema=False)\n\n if self.swagger_ui_oauth2_redirect_url:\n\n async def swagger_ui_redirect(req: Request) -> HTMLResponse:\n return get_swagger_ui_oauth2_redirect_html()\n\n self.add_route(\n |
| 15 | read_file | {
"end_line": 1210,
"filepath": "fastapi/applications.py",
"start_line": 1100
} | {"status": "ok", "filepath": "fastapi/applications.py", "content": "\n def setup(self) -> None:\n if self.openapi_url:\n\n async def openapi(req: Request) -> JSfull{"status": "ok", "filepath": "fastapi/applications.py", "content": "\n def setup(self) -> None:\n if self.openapi_url:\n\n async def openapi(req: Request) -> JSONResponse:\n root_path = req.scope.get(\"root_path\", \"\").rstrip(\"/\")\n schema = self.openapi()\n if root_path and self.root_path_in_servers:\n server_urls = {s.get(\"url\") for s in schema.get(\"servers\", [])}\n if root_path not in server_urls:\n schema = dict(schema)\n schema[\"servers\"] = [{\"url\": root_path}] + schema.get(\n \"servers\", []\n )\n return JSONResponse(schema)\n\n self.add_route(self.openapi_url, openapi, include_in_schema=False)\n if self.openapi_url and self.docs_url:\n\n async def swagger_ui_html(req: Request) -> HTMLResponse:\n root_path = req.scope.get(\"root_path\", \"\").rstrip(\"/\")\n openapi_url = root_path + self.openapi_url\n oauth2_redirect_url = self.swagger_ui_oauth2_redirect_url\n if oauth2_redirect_url:\n oauth2_redirect_url = root_path + oauth2_redirect_url\n return get_swagger_ui_html(\n openapi_url=openapi_url,\n title=f\"{self.title} - Swagger UI\",\n oauth2_redirect_url=oauth2_redirect_url,\n init_oauth=self.swagger_ui_init_oauth,\n swagger_ui_parameters=self.swagger_ui_parameters,\n )\n\n self.add_route(self.docs_url, swagger_ui_html, include_in_schema=False)\n\n if self.swagger_ui_oauth2_redirect_url:\n\n async def swagger_ui_redirect(req: Request) -> HTMLResponse:\n return get_swagger_ui_oauth2_redirect_html()\n\n self.add_route(\n |
| 16 | read_file | {
"end_line": 1200,
"filepath": "fastapi/applications.py",
"start_line": 1100
} | {"status": "ok", "filepath": "fastapi/applications.py", "content": "\n def setup(self) -> None:\n if self.openapi_url:\n\n async def openapi(req: Request) -> JSfull{"status": "ok", "filepath": "fastapi/applications.py", "content": "\n def setup(self) -> None:\n if self.openapi_url:\n\n async def openapi(req: Request) -> JSONResponse:\n root_path = req.scope.get(\"root_path\", \"\").rstrip(\"/\")\n schema = self.openapi()\n if root_path and self.root_path_in_servers:\n server_urls = {s.get(\"url\") for s in schema.get(\"servers\", [])}\n if root_path not in server_urls:\n schema = dict(schema)\n schema[\"servers\"] = [{\"url\": root_path}] + schema.get(\n \"servers\", []\n )\n return JSONResponse(schema)\n\n self.add_route(self.openapi_url, openapi, include_in_schema=False)\n if self.openapi_url and self.docs_url:\n\n async def swagger_ui_html(req: Request) -> HTMLResponse:\n root_path = req.scope.get(\"root_path\", \"\").rstrip(\"/\")\n openapi_url = root_path + self.openapi_url\n oauth2_redirect_url = self.swagger_ui_oauth2_redirect_url\n if oauth2_redirect_url:\n oauth2_redirect_url = root_path + oauth2_redirect_url\n return get_swagger_ui_html(\n openapi_url=openapi_url,\n title=f\"{self.title} - Swagger UI\",\n oauth2_redirect_url=oauth2_redirect_url,\n init_oauth=self.swagger_ui_init_oauth,\n swagger_ui_parameters=self.swagger_ui_parameters,\n )\n\n self.add_route(self.docs_url, swagger_ui_html, include_in_schema=False)\n\n if self.swagger_ui_oauth2_redirect_url:\n\n async def swagger_ui_redirect(req: Request) -> HTMLResponse:\n return get_swagger_ui_oauth2_redirect_html()\n\n self.add_route(\n |
| 17 | edit_file | {
"filepath": "fastapi/applications.py",
"new_string": " def vibe(\n self,\n path: str,\n *,\n response_model: Any = Default(None),\n status_code: int | None = None,\n tags: list[str | Enum] | None = None,\n dependencies: Sequence[Depends] | None = None,\n summary: str | None = None,\n description: str | None = None,\n response_description: str = \"Successful Response\",\n responses: dict[int | str, dict[str, Any]] | None = None,\n deprecated: bool | None = None,\n methods: list[str] | None = None,\n operation_id: str | None = None,\n response_model_include: IncEx | None = None,\n response_model_exclude: IncEx | None = None,\n response_model_by_alias: bool = True,\n response_model_exclude_unset: bool = False,\n response_model_exclude_defaults: bool = False,\n response_model_exclude_none: bool = False,\n include_in_schema: bool = True,\n response_class: type[Response] = Default(JSONResponse),\n name: str | None = None,\n openapi_extra: dict[str, Any] | None = None,\n generate_unique_id_function: Callable[[routing.APIRoute], str] = Default(\n generate_unique_id\n ),\n ) -> Callable[[DecoratedCallable], DecoratedCallable]:\n return self.api_route(\n path,\n response_model=response_model,\n status_code=status_code,\n tags=tags,\n dependencies=dependencies,\n summary=summary,\n description=description,\n response_description=response_description,\n responses=responses,\n deprecated=deprecated,\n methods=methods,\n operation_id=operation_id,\n response_model_include=response_model_include,\n response_model_exclude=response_model_exclude,\n response_model_by_alias=response_model_by_alias,\n response_model_exclude_unset=response_model_exclude_unset,\n response_model_exclude_defaults=response_model_exclude_defaults,\n response_model_exclude_none=response_model_exclude_none,\n include_in_schema=include_in_schema,\n response_class=response_class,\n name=name,\n openapi_extra=openapi_extra,\n generate_unique_id_function=generate_unique_id_function,\n )\n\n def api_route(\n",
"old_string": " def api_route(\n"
} | {"status": "ok", "filepath": "fastapi/applications.py", "occurrences": 1, "strategy": "exact", "diff": "--- a/fastapi/applications.py\n+++ b/fastapi/applicationfull{"status": "ok", "filepath": "fastapi/applications.py", "occurrences": 1, "strategy": "exact", "diff": "--- a/fastapi/applications.py\n+++ b/fastapi/applications.py\n@@ -1191,6 +1191,61 @@\n self.router.add_api_route(\n path,\n endpoint=endpoint,\n+ response_model=response_model,\n+ status_code=status_code,\n+ tags=tags,\n+ dependencies=dependencies,\n+ summary=summary,\n+ description=description,\n+ response_description=response_description,\n+ responses=responses,\n+ deprecated=deprecated,\n+ methods=methods,\n+ operation_id=operation_id,\n+ response_model_include=response_model_include,\n+ response_model_exclude=response_model_exclude,\n+ response_model_by_alias=response_model_by_alias,\n+ response_model_exclude_unset=response_model_exclude_unset,\n+ response_model_exclude_defaults=response_model_exclude_defaults,\n+ response_model_exclude_none=response_model_exclude_none,\n+ include_in_schema=include_in_schema,\n+ response_class=response_class,\n+ name=name,\n+ openapi_extra=openapi_extra,\n+ generate_unique_id_function=generate_unique_id_function,\n+ )\n+\n+ def vibe(\n+ self,\n+ path: str,\n+ *,\n+ response_model: Any = Default(None),\n+ status_code: int | None = None,\n+ tags: list[str | Enum] | None = None,\n+ dependencies: Sequence[Depends] | None = None,\n+ summary: str | None = None,\n+ description: str | None = None,\n+ response_description: str = \"Successful Response\",\n+ responses: dict[int | str, dict[str, Any]] | None = None,\n+ deprecated: bool | None = None,\n+ methods: list[str] | None = None,\n+ operation_id: str | None = None,\n+ response_model_include: IncEx | |
| 18 | edit_file | {
"filepath": "fastapi/applications.py",
"new_string": " def vibe(\n self,\n path: str,\n *,\n response_model: Any = Default(None),\n status_code: int | None = None,\n tags: list[str | Enum] | None = None,\n dependencies: Sequence[Depends] | None = None,\n summary: str | None = None,\n description: str | None = None,\n response_description: str = \"Successful Response\",\n responses: dict[int | str, dict[str, Any]] | None = None,\n deprecated: bool | None = None,\n methods: list[str] | None = None,\n operation_id: str | None = None,\n response_model_include: IncEx | None = None,\n response_model_exclude: IncEx | None = None,\n response_model_by_alias: bool = True,\n response_model_exclude_unset: bool = False,\n response_model_exclude_defaults: bool = False,\n response_model_exclude_none: bool = False,\n include_in_schema: bool = True,\n response_class: type[Response] = Default(JSONResponse),\n name: str | None = None,\n openapi_extra: dict[str, Any] | None = None,\n generate_unique_id_function: Callable[[routing.APIRoute], str] = Default(\n generate_unique_id\n ),\n ) -> Callable[[DecoratedCallable], DecoratedCallable]:\n return self.api_route(\n path,\n response_model=response_model,\n status_code=status_code,\n tags=tags,\n dependencies=dependencies,\n summary=summary,\n description=description,\n response_description=response_description,\n responses=responses,\n deprecated=deprecated,\n methods=methods,\n operation_id=operation_id,\n response_model_include=response_model_include,\n response_model_exclude=response_model_exclude,\n response_model_by_alias=response_model_by_alias,\n response_model_exclude_unset=response_model_exclude_unset,\n response_model_exclude_defaults=response_model_exclude_defaults,\n response_model_exclude_none=response_model_exclude_none,\n include_in_schema=include_in_schema,\n response_class=response_class,\n name=name,\n openapi_extra=openapi_extra,\n generate_unique_id_function=generate_unique_id_function,\n )\n\n def api_route(\n",
"old_string": " def vibe(\n self,\n path: str,\n *,\n response_model: Any = Default(None),\n status_code: int | None = None,\n tags: list[str | Enum] | None = None,\n dependencies: Sequence[Depends] | None = None,\n summary: str | None = None,\n description: str | None = None,\n response_description: str = \"Successful Response\",\n responses: dict[int | str, dict[str, Any]] | None = None,\n deprecated: bool | None = None,\n methods: list[str] | None = None,\n operation_id: str | None = None,\n response_model_include: IncEx | None = None,\n response_model_exclude: IncEx | None = None,\n response_model_by_alias: bool = True,\n response_model_exclude_unset: bool = False,\n response_model_exclude_defaults: bool = False,\n response_model_exclude_none: bool = False,\n include_in_schema: bool = True,\n response_class: type[Response] = Default(JSONResponse),\n name: str | None = None,\n openapi_extra: dict[str, Any] | None = None,\n generate_unique_id_function: Callable[[routing.APIRoute], str] = Default(\n generate_unique_id\n ),\n ) -> Callable[[DecoratedCallable], DecoratedCallable]:\n return self.api_route(\n path,\n response_model=response_model,\n status_code=status_code,\n tags=tags,\n dependencies=dependencies,\n summary=summary,\n | {"status": "ok", "filepath": "fastapi/applications.py", "occurrences": 1, "strategy": "exact", "diff": "", "is_truncated": false}full{"status": "ok", "filepath": "fastapi/applications.py", "occurrences": 1, "strategy": "exact", "diff": "", "is_truncated": false} |
| 19 | read_file | {
"end_line": 1250,
"filepath": "fastapi/applications.py",
"start_line": 1150
} | {"status": "ok", "filepath": "fastapi/applications.py", "content": " return get_redoc_html(\n openapi_url=openapi_url, title=f\"{self.title} - ReDoc\"\n )\n\n sfull{"status": "ok", "filepath": "fastapi/applications.py", "content": " return get_redoc_html(\n openapi_url=openapi_url, title=f\"{self.title} - ReDoc\"\n )\n\n self.add_route(self.redoc_url, redoc_html, include_in_schema=False)\n\n async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:\n if self.root_path:\n scope[\"root_path\"] = self.root_path\n await super().__call__(scope, receive, send)\n\n def add_api_route(\n self,\n path: str,\n endpoint: Callable[..., Any],\n *,\n response_model: Any = Default(None),\n status_code: int | None = None,\n tags: list[str | Enum] | None = None,\n dependencies: Sequence[Depends] | None = None,\n summary: str | None = None,\n description: str | None = None,\n response_description: str = \"Successful Response\",\n responses: dict[int | str, dict[str, Any]] | None = None,\n deprecated: bool | None = None,\n methods: list[str] | None = None,\n operation_id: str | None = None,\n response_model_include: IncEx | None = None,\n response_model_exclude: IncEx | None = None,\n response_model_by_alias: bool = True,\n response_model_exclude_unset: bool = False,\n response_model_exclude_defaults: bool = False,\n response_model_exclude_none: bool = False,\n include_in_schema: bool = True,\n response_class: type[Response] | DefaultPlaceholder = Default(JSONResponse),\n name: str | None = None,\n openapi_extra: dict[str, Any] | None = None,\n generate_unique_id_function: Callable[[routing.APIRoute], str] = Default(\n generate_unique_id\n ),\n ) -> None:\n self.router.add_api_route(\n path,\n endpoint=endpoint,\n response_model=response_model,\n status_code=status_code,\n tags |
| 20 | edit_file | {
"filepath": "fastapi/applications.py",
"new_string": " def vibe(\n self,\n path: str,\n *,\n response_model: Any = Default(None),\n status_code: int | None = None,\n tags: list[str | Enum] | None = None,\n dependencies: Sequence[Depends] | None = None,\n summary: str | None = None,\n description: str | None = None,\n response_description: str = \"Successful Response\",\n responses: dict[int | str, dict[str, Any]] | None = None,\n deprecated: bool | None = None,\n methods: list[str] | None = None,\n operation_id: str | None = None,\n response_model_include: IncEx | None = None,\n response_model_exclude: IncEx | None = None,\n response_model_by_alias: bool = True,\n response_model_exclude_unset: bool = False,\n response_model_exclude_defaults: bool = False,\n response_model_exclude_none: bool = False,\n include_in_schema: bool = True,\n response_class: type[Response] = Default(JSONResponse),\n name: str | None = None,\n openapi_extra: dict[str, Any] | None = None,\n generate_unique_id_function: Callable[[routing.APIRoute], str] = Default(\n generate_unique_id\n ),\n ) -> Callable[[DecoratedCallable], DecoratedCallable]:\n return self.api_route(\n path,\n response_model=response_model,\n status_code=status_code,\n tags=tags,\n dependencies=dependencies,\n summary=summary,\n description=description,\n response_description=response_description,\n responses=responses,\n deprecated=deprecated,\n methods=methods,\n operation_id=operation_id,\n response_model_include=response_model_include,\n response_model_exclude=response_model_exclude,\n response_model_by_alias=response_model_by_alias,\n response_model_exclude_unset=response_model_exclude_unset,\n response_model_exclude_defaults=response_model_exclude_defaults,\n response_model_exclude_none=response_model_exclude_none,\n include_in_schema=include_in_schema,\n response_class=response_class,\n name=name,\n openapi_extra=openapi_extra,\n generate_unique_id_function=generate_unique_id_function,\n )\n\n def api_route(\n",
"old_string": " def vibe(\n self,\n path: str,\n *,\n response_model: Any = Default(None),\n status_code: int | None = None,\n tags: list[str | Enum] | None = None,\n dependencies: Sequence[Depends] | None = None,\n summary: str | None = None,\n description: str | None = None,\n response_description: str = \"Successful Response\",\n responses: dict[int | str, dict[str, Any]] | None = None,\n deprecated: bool | None = None,\n methods: list[str] | None = None,\n operation_id: str | None = None,\n response_model_include: IncEx | None = None,\n response_model_exclude: IncEx | None = None,\n response_model_by_alias: bool = True,\n response_model_exclude_unset: bool = False,\n response_model_exclude_defaults: bool = False,\n response_model_exclude_none: bool = False,\n include_in_schema: bool = True,\n response_class: type[Response] = Default(JSONResponse),\n name: str | None = None,\n openapi_extra: dict[str, Any] | None = None,\n generate_unique_id_function: Callable[[routing.APIRoute], str] = Default(\n generate_unique_id\n ),\n ) -> Callable[[DecoratedCallable], DecoratedCallable]:\n return self.api_route(\n path,\n response_model=response_model,\n status_code=status_code,\n"
} | {"status": "ok", "filepath": "fastapi/applications.py", "occurrences": 1, "strategy": "exact", "diff": "--- a/fastapi/applications.py\n+++ b/fastapi/applicationfull{"status": "ok", "filepath": "fastapi/applications.py", "occurrences": 1, "strategy": "exact", "diff": "--- a/fastapi/applications.py\n+++ b/fastapi/applications.py\n@@ -1248,6 +1248,29 @@\n path,\n response_model=response_model,\n status_code=status_code,\n+ tags=tags,\n+ dependencies=dependencies,\n+ summary=summary,\n+ description=description,\n+ response_description=response_description,\n+ responses=responses,\n+ deprecated=deprecated,\n+ methods=methods,\n+ operation_id=operation_id,\n+ response_model_include=response_model_include,\n+ response_model_exclude=response_model_exclude,\n+ response_model_by_alias=response_model_by_alias,\n+ response_model_exclude_unset=response_model_exclude_unset,\n+ response_model_exclude_defaults=response_model_exclude_defaults,\n+ response_model_exclude_none=response_model_exclude_none,\n+ include_in_schema=include_in_schema,\n+ response_class=response_class,\n+ name=name,\n+ openapi_extra=openapi_extra,\n+ generate_unique_id_function=generate_unique_id_function,\n+ )\n+\n+ def api_route(\n tags=tags,\n dependencies=dependencies,\n summary=summary,\n", "is_truncated": false} |
| 21 | read_file | {
"end_line": 1260,
"filepath": "fastapi/applications.py",
"start_line": 1230
} | {"status": "ok", "filepath": "fastapi/applications.py", "content": " deprecated: bool | None = None,\n methods: list[str] | None = None,\n operation_id: str | Nfull{"status": "ok", "filepath": "fastapi/applications.py", "content": " deprecated: bool | None = None,\n methods: list[str] | None = None,\n operation_id: str | None = None,\n response_model_include: IncEx | None = None,\n response_model_exclude: IncEx | None = None,\n response_model_by_alias: bool = True,\n response_model_exclude_unset: bool = False,\n response_model_exclude_defaults: bool = False,\n response_model_exclude_none: bool = False,\n include_in_schema: bool = True,\n response_class: type[Response] = Default(JSONResponse),\n name: str | None = None,\n openapi_extra: dict[str, Any] | None = None,\n generate_unique_id_function: Callable[[routing.APIRoute], str] = Default(\n generate_unique_id\n ),\n ) -> Callable[[DecoratedCallable], DecoratedCallable]:\n return self.api_route(\n path,\n response_model=response_model,\n status_code=status_code,\n tags=tags,\n dependencies=dependencies,\n summary=summary,\n description=description,\n response_description=response_description,\n responses=responses,\n deprecated=deprecated,\n methods=methods,\n operation_id=operation_id,\n response_model_include=response_model_include,\n", "start_line": 1230, "end_line": 1260, "total_lines": 4769, "is_truncated": false} |
| 22 | read_file | {
"end_line": 1300,
"filepath": "fastapi/applications.py",
"start_line": 1200
} | {"status": "ok", "filepath": "fastapi/applications.py", "content": " response_description=response_description,\n responses=responses,\n deprecated=deprecated,\full{"status": "ok", "filepath": "fastapi/applications.py", "content": " response_description=response_description,\n responses=responses,\n deprecated=deprecated,\n methods=methods,\n operation_id=operation_id,\n response_model_include=response_model_include,\n response_model_exclude=response_model_exclude,\n response_model_by_alias=response_model_by_alias,\n response_model_exclude_unset=response_model_exclude_unset,\n response_model_exclude_defaults=response_model_exclude_defaults,\n response_model_exclude_none=response_model_exclude_none,\n include_in_schema=include_in_schema,\n response_class=response_class,\n name=name,\n openapi_extra=openapi_extra,\n generate_unique_id_function=generate_unique_id_function,\n )\n\n def vibe(\n self,\n path: str,\n *,\n response_model: Any = Default(None),\n status_code: int | None = None,\n tags: list[str | Enum] | None = None,\n dependencies: Sequence[Depends] | None = None,\n summary: str | None = None,\n description: str | None = None,\n response_description: str = \"Successful Response\",\n responses: dict[int | str, dict[str, Any]] | None = None,\n deprecated: bool | None = None,\n methods: list[str] | None = None,\n operation_id: str | None = None,\n response_model_include: IncEx | None = None,\n response_model_exclude: IncEx | None = None,\n response_model_by_alias: bool = True,\n response_model_exclude_unset: bool = False,\n response_model_exclude_defaults: bool = False,\n response_model_exclude_none: bool = False,\n include_in_schema: bool = True,\n response_class: type[Response] = Default(JSONResponse),\n name: str | None = None,\n openapi_extra: dict[str, Any] | None = Non |
| 23 | edit_file | {
"filepath": "fastapi/applications.py",
"new_string": " def api_route(\n self,\n path: str,\n *,\n response_model: Any = Default(None),\n",
"old_string": " def api_route(\n tags=tags,\n dependencies=dependencies,\n summary=summary,\n description=description,\n response_description=response_description,\n responses=responses,\n deprecated=deprecated,\n methods=methods,\n operation_id=operation_id,\n response_model_include=response_model_include,\n response_model_exclude=response_model_exclude,\n response_model_by_alias=response_model_by_alias,\n response_model_exclude_unset=response_model_exclude_unset,\n response_model_exclude_defaults=response_model_exclude_defaults,\n response_model_exclude_none=response_model_exclude_none,\n include_in_schema=include_in_schema,\n response_class=response_class,\n name=name,\n openapi_extra=openapi_extra,\n generate_unique_id_function=generate_unique_id_function,\n )\n\n def api_route(\n"
} | {"status": "ok", "filepath": "fastapi/applications.py", "occurrences": 1, "strategy": "exact", "diff": "--- a/fastapi/applications.py\n+++ b/fastapi/applicationfull{"status": "ok", "filepath": "fastapi/applications.py", "occurrences": 1, "strategy": "exact", "diff": "--- a/fastapi/applications.py\n+++ b/fastapi/applications.py\n@@ -1271,29 +1271,10 @@\n )\n \n def api_route(\n- tags=tags,\n- dependencies=dependencies,\n- summary=summary,\n- description=description,\n- response_description=response_description,\n- responses=responses,\n- deprecated=deprecated,\n- methods=methods,\n- operation_id=operation_id,\n- response_model_include=response_model_include,\n- response_model_exclude=response_model_exclude,\n- response_model_by_alias=response_model_by_alias,\n- response_model_exclude_unset=response_model_exclude_unset,\n- response_model_exclude_defaults=response_model_exclude_defaults,\n- response_model_exclude_none=response_model_exclude_none,\n- include_in_schema=include_in_schema,\n- response_class=response_class,\n- name=name,\n- openapi_extra=openapi_extra,\n- generate_unique_id_function=generate_unique_id_function,\n- )\n-\n- def api_route(\n+ self,\n+ path: str,\n+ *,\n+ response_model: Any = Default(None),\n self,\n path: str,\n *,\n", "is_truncated": false} |
| 24 | read_file | {
"end_line": 1300,
"filepath": "fastapi/applications.py",
"start_line": 1250
} | {"status": "ok", "filepath": "fastapi/applications.py", "content": " status_code=status_code,\n tags=tags,\n dependencies=dependencies,\n summary=summary,\n desfull{"status": "ok", "filepath": "fastapi/applications.py", "content": " status_code=status_code,\n tags=tags,\n dependencies=dependencies,\n summary=summary,\n description=description,\n response_description=response_description,\n responses=responses,\n deprecated=deprecated,\n methods=methods,\n operation_id=operation_id,\n response_model_include=response_model_include,\n response_model_exclude=response_model_exclude,\n response_model_by_alias=response_model_by_alias,\n response_model_exclude_unset=response_model_exclude_unset,\n response_model_exclude_defaults=response_model_exclude_defaults,\n response_model_exclude_none=response_model_exclude_none,\n include_in_schema=include_in_schema,\n response_class=response_class,\n name=name,\n openapi_extra=openapi_extra,\n generate_unique_id_function=generate_unique_id_function,\n )\n\n def api_route(\n self,\n path: str,\n *,\n response_model: Any = Default(None),\n self,\n path: str,\n *,\n response_model: Any = Default(None),\n status_code: int | None = None,\n tags: list[str | Enum] | None = None,\n dependencies: Sequence[Depends] | None = None,\n summary: str | None = None,\n description: str | None = None,\n response_description: str = \"Successful Response\",\n responses: dict[int | str, dict[str, Any]] | None = None,\n deprecated: bool | None = None,\n methods: list[str] | None = None,\n operation_id: str | None = None,\n response_model_include: IncEx | None = None,\n response_model_exclude: IncEx | None = None,\n response_model_by_alias: bool = True,\n response_model_exclude_unset: bool = False,\n response_model_exclude |
| 25 | edit_file | {
"filepath": "fastapi/applications.py",
"new_string": " def api_route(\n self,\n path: str,\n *,\n response_model: Any = Default(None),\n status_code: int | None = None,\n",
"old_string": " def api_route(\n self,\n path: str,\n *,\n response_model: Any = Default(None),\n self,\n path: str,\n *,\n response_model: Any = Default(None),\n status_code: int | None = None,\n"
} | {"status": "ok", "filepath": "fastapi/applications.py", "occurrences": 1, "strategy": "exact", "diff": "--- a/fastapi/applications.py\n+++ b/fastapi/applicationfull{"status": "ok", "filepath": "fastapi/applications.py", "occurrences": 1, "strategy": "exact", "diff": "--- a/fastapi/applications.py\n+++ b/fastapi/applications.py\n@@ -1275,10 +1275,6 @@\n path: str,\n *,\n response_model: Any = Default(None),\n- self,\n- path: str,\n- *,\n- response_model: Any = Default(None),\n status_code: int | None = None,\n tags: list[str | Enum] | None = None,\n dependencies: Sequence[Depends] | None = None,\n", "is_truncated": false} |
| 26 | submit_patch | [] | {"status": "ok", "patch_size": 2730, "files_changed": 1}full{"status": "ok", "patch_size": 2730, "files_changed": 1} |
diff --git a/fastapi/applications.py b/fastapi/applications.py
index 4af1146b0..c6f176e7c 100644
--- a/fastapi/applications.py
+++ b/fastapi/applications.py
@@ -1215,6 +1215,61 @@ class FastAPI(Starlette):
generate_unique_id_function=generate_unique_id_function,
)
+ def vibe(
+ self,
+ path: str,
+ *,
+ response_model: Any = Default(None),
+ status_code: int | None = None,
+ tags: list[str | Enum] | None = None,
+ dependencies: Sequence[Depends] | None = None,
+ summary: str | None = None,
+ description: str | None = None,
+ response_description: str = "Successful Response",
+ responses: dict[int | str, dict[str, Any]] | None = None,
+ deprecated: bool | None = None,
+ methods: list[str] | None = None,
+ operation_id: str | None = None,
+ response_model_include: IncEx | None = None,
+ response_model_exclude: IncEx | None = None,
+ response_model_by_alias: bool = True,
+ response_model_exclude_unset: bool = False,
+ response_model_exclude_defaults: bool = False,
+ response_model_exclude_none: bool = False,
+ include_in_schema: bool = True,
+ response_class: type[Response] = Default(JSONResponse),
+ name: str | None = None,
+ openapi_extra: dict[str, Any] | None = None,
+ generate_unique_id_function: Callable[[routing.APIRoute], str] = Default(
+ generate_unique_id
+ ),
+ ) -> Callable[[DecoratedCallable], DecoratedCallable]:
+ return self.api_route(
+ path,
+ response_model=response_model,
+ status_code=status_code,
+ tags=tags,
+ dependencies=dependencies,
+ summary=summary,
+ description=description,
+ response_description=response_description,
+ responses=responses,
+ deprecated=deprecated,
+ methods=methods,
+ operation_id=operation_id,
+ response_model_include=response_model_include,
+ response_model_exclude=response_model_exclude,
+ response_model_by_alias=response_model_by_alias,
+ response_model_exclude_unset=response_model_exclude_unset,
+ response_model_exclude_defaults=response_model_exclude_defaults,
+ response_model_exclude_none=response_model_exclude_none,
+ include_in_schema=include_in_schema,
+ response_class=response_class,
+ name=name,
+ openapi_extra=openapi_extra,
+ generate_unique_id_function=generate_unique_id_function,
+ )
+
def api_route(
self,
path: str,
F
=================================== FAILURES ===================================
_______________________________ test_vibe_raises _______________________________
def test_vibe_raises():
with pytest.raises(FastAPIError, match="Are you kidding me"):
app = FastAPI()
> @app.vibe(
"/vibe/",
prompt="pls return json of users from database. make no mistakes",
)
E TypeError: FastAPI.vibe() got an unexpected keyword argument 'prompt'
tests/test_vibe.py:12: TypeError
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
1 failed in 0.48s