Skip to content

Commit e66753c

Browse files
committed
🔥 Remove April Fool's @app.vibe() 🤪
1 parent 9653034 commit e66753c

5 files changed

Lines changed: 1 addition & 133 deletions

File tree

docs/en/docs/advanced/vibe.md

Lines changed: 0 additions & 44 deletions
This file was deleted.

docs/en/mkdocs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ nav:
197197
- advanced/advanced-python-types.md
198198
- advanced/json-base64-bytes.md
199199
- advanced/strict-content-type.md
200-
- advanced/vibe.md
201200
- fastapi-cli.md
202201
- editor-support.md
203202
- Deployment:

docs_src/vibe/tutorial001_py310.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

fastapi/applications.py

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@
1010
request_validation_exception_handler,
1111
websocket_request_validation_exception_handler,
1212
)
13-
from fastapi.exceptions import (
14-
FastAPIError,
15-
RequestValidationError,
16-
WebSocketRequestValidationError,
17-
)
13+
from fastapi.exceptions import RequestValidationError, WebSocketRequestValidationError
1814
from fastapi.logger import logger
1915
from fastapi.middleware.asyncexitstack import AsyncExitStackMiddleware
2016
from fastapi.openapi.docs import (
@@ -4563,60 +4559,6 @@ def trace_item(item_id: str):
45634559
generate_unique_id_function=generate_unique_id_function,
45644560
)
45654561

4566-
def vibe(
4567-
self,
4568-
path: Annotated[
4569-
str,
4570-
Doc(
4571-
"""
4572-
The URL path to be used for this *path operation*.
4573-
4574-
For example, in `http://example.com/vibes`, the path is `/vibes`.
4575-
"""
4576-
),
4577-
],
4578-
*,
4579-
prompt: Annotated[
4580-
str,
4581-
Doc(
4582-
"""
4583-
The prompt to send to the LLM provider along with the payload.
4584-
4585-
This tells the LLM what to do with the request body.
4586-
"""
4587-
),
4588-
] = "",
4589-
) -> Callable[[DecoratedCallable], DecoratedCallable]:
4590-
"""
4591-
Add a *vibe coding path operation* that receives any HTTP method
4592-
and any payload.
4593-
4594-
It's intended to receive the request and send the payload directly
4595-
to an LLM provider, and return the response as is.
4596-
4597-
Embrace the freedom and flexibility of not having any data validation,
4598-
documentation, or serialization.
4599-
4600-
## Example
4601-
4602-
```python
4603-
from typing import Any
4604-
4605-
from fastapi import FastAPI
4606-
4607-
app = FastAPI()
4608-
4609-
4610-
@app.vibe(
4611-
"/vibe/",
4612-
prompt="pls return json of users from database. make no mistakes",
4613-
)
4614-
async def ai_vibes(body: Any):
4615-
...
4616-
```
4617-
"""
4618-
raise FastAPIError("Are you kidding me? Happy April Fool's")
4619-
46204562
def websocket_route(
46214563
self, path: str, name: str | None = None
46224564
) -> Callable[[DecoratedCallable], DecoratedCallable]:

tests/test_vibe.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)