id
int64
0
190k
prompt
stringlengths
21
13.4M
docstring
stringlengths
1
12k
157,920
from typing import Optional, Set from fastapi import FastAPI from pydantic import BaseModel, HttpUrl class Item(BaseModel): name: str description: Optional[str] = None price: float tax: Optional[float] = None tags: Set[str] = set() image: Optional[Image] = None async def update_item(item_id: int, item: Item): results = {"item_id": item_id, "item": item} return results
null
157,921
from typing import List, Optional, Set from fastapi import FastAPI from pydantic import BaseModel, HttpUrl class Offer(BaseModel): name: str description: Optional[str] = None price: float items: List[Item] async def create_offer(offer: Offer): return offer
null
157,922
from typing import List from fastapi import FastAPI from pydantic import BaseModel, HttpUrl class Image(BaseModel): url: HttpUrl name: str async def create_multiple_images(images: List[Image]): return images
null
157,923
from typing import List, Optional from fastapi import FastAPI from pydantic import BaseModel class Item(BaseModel): name: str description: Optional[str] = None price: float tax: Optional[float] = None tags: List[str] = [] async def update_item(item_id: int, item: Item): results = {"item_id": item_id, "item": item} return results
null
157,924
from fastapi import FastAPI from pydantic import BaseModel, HttpUrl class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None tags: set[str] = set() images: list[Image] | None = None async def update_item(item_id: int, item: Item): results = {"item_id": item_id, "item": item} return results
null
157,925
from typing import Optional from fastapi import FastAPI from pydantic import BaseModel, HttpUrl class Offer(BaseModel): name: str description: Optional[str] = None price: float items: list[Item] async def create_offer(offer: Offer): return offer
null
157,926
from fastapi import FastAPI from pydantic import BaseModel class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None tags: set[str] = set() async def update_item(item_id: int, item: Item): results = {"item_id": item_id, "item": item} return results
null
157,927
from fastapi import Cookie, FastAPI async def read_items(ads_id: str | None = Cookie(None)): return {"ads_id": ads_id}
null
157,928
from typing import Optional from fastapi import Cookie, FastAPI async def read_items(ads_id: Optional[str] = Cookie(None)): return {"ads_id": ads_id}
null
157,929
from fastapi import FastAPI async def get_users(): return [{"name": "Harry"}, {"name": "Ron"}]
null
157,930
from fastapi import FastAPI async def get_items(): return [{"name": "wand"}, {"name": "flying broom"}]
null
157,931
from fastapi import FastAPI async def read_items(): return [{"name": "Katana"}]
null
157,932
from fastapi import FastAPI async def read_items(): return [{"name": "Foo"}]
null
157,934
from fastapi import FastAPI async def read_user(username: str): return {"message": f"Hello {username}"}
null
157,935
from fastapi import FastAPI from fastapi.openapi.utils import get_openapi async def read_items(): return [{"name": "Foo"}]
null
157,936
from fastapi import FastAPI from fastapi.openapi.utils import get_openapi app = FastAPI() app.openapi = custom_openapi def get_openapi( *, title: str, version: str, openapi_version: str = "3.0.2", description: Optional[str] = None, routes: Sequence[BaseRoute], tags: Optional[List[Dict[str, Any]]] = None, servers: Optional[List[Dict[str, Union[str, Any]]]] = None, terms_of_service: Optional[str] = None, contact: Optional[Dict[str, Union[str, Any]]] = None, license_info: Optional[Dict[str, Union[str, Any]]] = None, ) -> Dict[str, Any]: # type: ignore def custom_openapi(): if app.openapi_schema: return app.openapi_schema openapi_schema = get_openapi( title="Custom title", version="2.5.0", description="This is a very custom OpenAPI schema", routes=app.routes, ) openapi_schema["info"]["x-logo"] = { "url": "https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png" } app.openapi_schema = openapi_schema return app.openapi_schema
null
157,939
from fastapi import FastAPI from fastapi.openapi.docs import ( get_redoc_html, get_swagger_ui_html, get_swagger_ui_oauth2_redirect_html, ) from fastapi.staticfiles import StaticFiles app = FastAPI(docs_url=None, redoc_url=None) app.mount("/static", StaticFiles(directory="static"), name="static") def get_swagger_ui_html( *, openapi_url: str, title: str, swagger_js_url: str = "https://cdn.jsdelivr.net/npm/swagger-ui-dist@3/swagger-ui-bundle.js", swagger_css_url: str = "https://cdn.jsdelivr.net/npm/swagger-ui-dist@3/swagger-ui.css", swagger_favicon_url: str = "https://fastapi.tiangolo.com/img/favicon.png", oauth2_redirect_url: Optional[str] = None, init_oauth: Optional[Dict[str, Any]] = None, swagger_ui_parameters: Optional[Dict[str, Any]] = None, ) -> HTMLResponse: current_swagger_ui_parameters = swagger_ui_default_parameters.copy() if swagger_ui_parameters: current_swagger_ui_parameters.update(swagger_ui_parameters) html = f""" <!DOCTYPE html> <html> <head> <link type="text/css" rel="stylesheet" href="{swagger_css_url}"> <link rel="shortcut icon" href="{swagger_favicon_url}"> <title>{title}</title> </head> <body> <div id="swagger-ui"> </div> <script src="{swagger_js_url}"></script> <!-- `SwaggerUIBundle` is now available on the page --> <script> const ui = SwaggerUIBundle({{ url: '{openapi_url}', """ for key, value in current_swagger_ui_parameters.items(): html += f"{json.dumps(key)}: {json.dumps(jsonable_encoder(value))},\n" if oauth2_redirect_url: html += f"oauth2RedirectUrl: window.location.origin + '{oauth2_redirect_url}'," html += """ presets: [ SwaggerUIBundle.presets.apis, SwaggerUIBundle.SwaggerUIStandalonePreset ], })""" if init_oauth: html += f""" ui.initOAuth({json.dumps(jsonable_encoder(init_oauth))}) """ html += """ </script> </body> </html> """ return HTMLResponse(html) async def custom_swagger_ui_html(): return get_swagger_ui_html( openapi_url=app.openapi_url, title=app.title + " - Swagger UI", oauth2_redirect_url=app.swagger_ui_oauth2_redirect_url, swagger_js_url="/static/swagger-ui-bundle.js", swagger_css_url="/static/swagger-ui.css", )
null
157,940
from fastapi import FastAPI from fastapi.openapi.docs import ( get_redoc_html, get_swagger_ui_html, get_swagger_ui_oauth2_redirect_html, ) from fastapi.staticfiles import StaticFiles def get_swagger_ui_oauth2_redirect_html() -> HTMLResponse: async def swagger_ui_redirect(): return get_swagger_ui_oauth2_redirect_html()
null
157,941
from fastapi import FastAPI from fastapi.openapi.docs import ( get_redoc_html, get_swagger_ui_html, get_swagger_ui_oauth2_redirect_html, ) from fastapi.staticfiles import StaticFiles app = FastAPI(docs_url=None, redoc_url=None) app.mount("/static", StaticFiles(directory="static"), name="static") def get_redoc_html( *, openapi_url: str, title: str, redoc_js_url: str = "https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js", redoc_favicon_url: str = "https://fastapi.tiangolo.com/img/favicon.png", with_google_fonts: bool = True, ) -> HTMLResponse: html = f""" <!DOCTYPE html> <html> <head> <title>{title}</title> <!-- needed for adaptive design --> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"> """ if with_google_fonts: html += """ <link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet"> """ html += f""" <link rel="shortcut icon" href="{redoc_favicon_url}"> <!-- ReDoc doesn't change outer page styles --> <style> body {{ margin: 0; padding: 0; }} </style> </head> <body> <redoc spec-url="{openapi_url}"></redoc> <script src="{redoc_js_url}"> </script> </body> </html> """ return HTMLResponse(html) async def redoc_html(): return get_redoc_html( openapi_url=app.openapi_url, title=app.title + " - ReDoc", redoc_js_url="/static/redoc.standalone.js", )
null
157,942
from fastapi import FastAPI from fastapi.openapi.docs import ( get_redoc_html, get_swagger_ui_html, get_swagger_ui_oauth2_redirect_html, ) from fastapi.staticfiles import StaticFiles async def read_user(username: str): return {"message": f"Hello {username}"}
null
157,943
def get_name_with_age(name: str, age: int): name_with_age = name + " is this old: " + str(age) return name_with_age
null
157,944
class Person: def __init__(self, name: str): self.name = name def get_person_name(one_person: Person): return one_person.name
null
157,945
def process_items(items: list[str]): for item in items: print(item)
null
157,946
from typing import Optional def say_hi(name: Optional[str] = None): if name is not None: print(f"Hey {name}!") else: print("Hello World")
null
157,947
from typing import List def process_items(items: List[str]): for item in items: print(item)
null
157,948
def say_hi(name: str | None = None): if name is not None: print(f"Hey {name}!") else: print("Hello World")
null
157,949
def get_full_name(first_name, last_name): full_name = first_name.title() + " " + last_name.title() return full_name
null
157,950
def process_items(prices: dict[str, float]): for item_name, item_price in prices.items(): print(item_name) print(item_price)
null
157,951
def get_name_with_age(name: str, age: int): name_with_age = name + " is this old: " + age return name_with_age
null
157,952
from typing import Union def process_item(item: Union[int, str]): print(item)
null
157,953
def get_items(item_a: str, item_b: int, item_c: float, item_d: bool, item_e: bytes): return item_a, item_b, item_c, item_d, item_d, item_e
null
157,954
from typing import Set, Tuple def process_items(items_t: Tuple[int, int, str], items_s: Set[bytes]): return items_t, items_s
null
157,955
def process_item(item: int | str): print(item)
null
157,956
from typing import Dict def process_items(prices: Dict[str, float]): for item_name, item_price in prices.items(): print(item_name) print(item_price)
null
157,957
from typing import Union def say_hi(name: Union[str, None] = None): if name is not None: print(f"Hey {name}!") else: print("Hello World")
null
157,958
def get_full_name(first_name: str, last_name: str): full_name = first_name.title() + " " + last_name.title() return full_name
null
157,959
def process_items(items_t: tuple[int, int, str], items_s: set[bytes]): return items_t, items_s
null
157,960
from fastapi import BackgroundTasks, FastAPI def write_notification(email: str, message=""): with open("log.txt", mode="w") as email_file: content = f"notification for {email}: {message}" email_file.write(content) async def send_notification(email: str, background_tasks: BackgroundTasks): background_tasks.add_task(write_notification, email, message="some notification") return {"message": "Notification sent in the background"}
null
157,961
from fastapi import BackgroundTasks, Depends, FastAPI def write_log(message: str): def get_query(background_tasks: BackgroundTasks, q: str | None = None): async def send_notification( email: str, background_tasks: BackgroundTasks, q: str = Depends(get_query) ): message = f"message to {email}\n" background_tasks.add_task(write_log, message) return {"message": "Message sent"}
null
157,962
from typing import Optional from fastapi import BackgroundTasks, Depends, FastAPI def write_log(message: str): def get_query(background_tasks: BackgroundTasks, q: Optional[str] = None): async def send_notification( email: str, background_tasks: BackgroundTasks, q: str = Depends(get_query) ): message = f"message to {email}\n" background_tasks.add_task(write_log, message) return {"message": "Message sent"}
null
157,963
from fastapi import FastAPI async def root(): return {"message": "Hello World"}
null
157,964
from fastapi import FastAPI def root(): return {"message": "Hello World"}
null
157,966
from fastapi import FastAPI async def read_file(file_path: str): return {"file_path": file_path}
null
157,967
from fastapi import FastAPI async def read_item(item_id): return {"item_id": item_id}
null
157,968
from fastapi import FastAPI async def read_user_me(): return {"user_id": "the current user"}
null
157,969
from fastapi import FastAPI async def read_user(user_id: str): return {"user_id": user_id}
null
157,970
from enum import Enum from fastapi import FastAPI class ModelName(str, Enum): alexnet = "alexnet" resnet = "resnet" lenet = "lenet" async def get_model(model_name: ModelName): if model_name == ModelName.alexnet: return {"model_name": model_name, "message": "Deep Learning FTW!"} if model_name.value == "lenet": return {"model_name": model_name, "message": "LeCNN all the images"} return {"model_name": model_name, "message": "Have some residuals"}
null
157,971
from fastapi import FastAPI async def read_item(item_id: int): return {"item_id": item_id}
null
157,972
from typing import Optional from fastapi import FastAPI async def read_user_item( user_id: int, item_id: str, q: Optional[str] = None, short: bool = False ): item = {"item_id": item_id, "owner_id": user_id} if q: item.update({"q": q}) if not short: item.update( {"description": "This is an amazing item that has a long description"} ) return item
null
157,973
from typing import Optional from fastapi import FastAPI async def read_user_item( item_id: str, needy: str, skip: int = 0, limit: Optional[int] = None ): item = {"item_id": item_id, "needy": needy, "skip": skip, "limit": limit} return item
null
157,974
from typing import Union from fastapi import FastAPI async def read_user_item( item_id: str, needy: str, skip: int = 0, limit: Union[int, None] = None ): item = {"item_id": item_id, "needy": needy, "skip": skip, "limit": limit} return item
null
157,975
from fastapi import FastAPI fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Baz"}] async def read_item(skip: int = 0, limit: int = 10): return fake_items_db[skip : skip + limit]
null
157,976
from fastapi import FastAPI async def read_item(item_id: str, q: str | None = None): if q: return {"item_id": item_id, "q": q} return {"item_id": item_id}
null
157,977
from typing import Optional from fastapi import FastAPI async def read_item(item_id: str, q: Optional[str] = None, short: bool = False): item = {"item_id": item_id} if q: item.update({"q": q}) if not short: item.update( {"description": "This is an amazing item that has a long description"} ) return item
null
157,978
from fastapi import FastAPI async def read_user_item( user_id: int, item_id: str, q: str | None = None, short: bool = False ): item = {"item_id": item_id, "owner_id": user_id} if q: item.update({"q": q}) if not short: item.update( {"description": "This is an amazing item that has a long description"} ) return item
null
157,979
from fastapi import FastAPI async def read_user_item(item_id: str, needy: str): item = {"item_id": item_id, "needy": needy} return item
null
157,980
from typing import Optional from fastapi import FastAPI async def read_item(item_id: str, q: Optional[str] = None): if q: return {"item_id": item_id, "q": q} return {"item_id": item_id}
null
157,981
from fastapi import FastAPI async def read_user_item( item_id: str, needy: str, skip: int = 0, limit: int | None = None ): item = {"item_id": item_id, "needy": needy, "skip": skip, "limit": limit} return item
null
157,982
from fastapi import FastAPI async def read_item(item_id: str, q: str | None = None, short: bool = False): item = {"item_id": item_id} if q: item.update({"q": q}) if not short: item.update( {"description": "This is an amazing item that has a long description"} ) return item
null
157,983
from typing import Optional from fastapi import FastAPI, File, UploadFile async def create_file(file: Optional[bytes] = File(None)): if not file: return {"message": "No file sent"} else: return {"file_size": len(file)}
null
157,984
from typing import Optional from fastapi import FastAPI, File, UploadFile async def create_upload_file(file: Optional[UploadFile] = None): if not file: return {"message": "No upload file sent"} else: return {"filename": file.filename}
null
157,985
from fastapi import FastAPI, File, UploadFile async def create_file(file: bytes | None = File(None)): if not file: return {"message": "No file sent"} else: return {"file_size": len(file)}
null
157,986
from fastapi import FastAPI, File, UploadFile async def create_upload_file(file: UploadFile | None = None): if not file: return {"message": "No upload file sent"} else: return {"filename": file.filename}
null
157,987
from fastapi import FastAPI, File, UploadFile async def create_file(file: bytes = File(...)): return {"file_size": len(file)}
null
157,988
from fastapi import FastAPI, File, UploadFile async def create_upload_file(file: UploadFile): return {"filename": file.filename}
null
157,989
from fastapi import FastAPI, File, UploadFile from fastapi.responses import HTMLResponse async def create_files( files: list[bytes] = File(..., description="Multiple files as bytes") ): return {"file_sizes": [len(file) for file in files]}
null
157,990
from fastapi import FastAPI, File, UploadFile from fastapi.responses import HTMLResponse async def create_upload_files( files: list[UploadFile] = File(..., description="Multiple files as UploadFile") ): return {"filenames": [file.filename for file in files]}
null
157,991
from fastapi import FastAPI, File, UploadFile from fastapi.responses import HTMLResponse async def create_files(files: list[bytes] = File(...)): return {"file_sizes": [len(file) for file in files]}
null
157,992
from fastapi import FastAPI, File, UploadFile from fastapi.responses import HTMLResponse async def create_upload_files(files: list[UploadFile]): return {"filenames": [file.filename for file in files]}
null
157,993
from typing import List from fastapi import FastAPI, File, UploadFile from fastapi.responses import HTMLResponse async def create_files( files: List[bytes] = File(..., description="Multiple files as bytes") ): return {"file_sizes": [len(file) for file in files]}
null
157,994
from typing import List from fastapi import FastAPI, File, UploadFile from fastapi.responses import HTMLResponse async def create_upload_files( files: List[UploadFile] = File(..., description="Multiple files as UploadFile") ): return {"filenames": [file.filename for file in files]}
null
157,995
from typing import List from fastapi import FastAPI, File, UploadFile from fastapi.responses import HTMLResponse async def create_files(files: List[bytes] = File(...)): return {"file_sizes": [len(file) for file in files]}
null
157,996
from typing import List from fastapi import FastAPI, File, UploadFile from fastapi.responses import HTMLResponse async def create_upload_files(files: List[UploadFile]): return {"filenames": [file.filename for file in files]}
null
157,997
from fastapi import FastAPI, File, UploadFile async def create_file(file: bytes = File(..., description="A file read as bytes")): return {"file_size": len(file)}
null
157,998
from fastapi import FastAPI, File, UploadFile async def create_upload_file( file: UploadFile = File(..., description="A file read as UploadFile") ): return {"filename": file.filename}
null
157,999
from fastapi import FastAPI, Path async def read_items( *, item_id: int = Path(..., title="The ID of the item to get", ge=1), q: str ): results = {"item_id": item_id} if q: results.update({"q": q}) return results
null
158,000
from fastapi import FastAPI, Path, Query async def read_items( *, item_id: int = Path(..., title="The ID of the item to get", ge=0, le=1000), q: str, size: float = Query(..., gt=0, lt=10.5) ): results = {"item_id": item_id} if q: results.update({"q": q}) return results
null
158,001
from fastapi import FastAPI, Path, Query async def read_items( item_id: int = Path(..., title="The ID of the item to get"), q: str | None = Query(None, alias="item-query"), ): results = {"item_id": item_id} if q: results.update({"q": q}) return results
null
158,002
from typing import Optional from fastapi import FastAPI, Path, Query async def read_items( item_id: int = Path(..., title="The ID of the item to get"), q: Optional[str] = Query(None, alias="item-query"), ): results = {"item_id": item_id} if q: results.update({"q": q}) return results
null
158,003
from fastapi import FastAPI, Path async def read_items( *, item_id: int = Path(..., title="The ID of the item to get"), q: str ): results = {"item_id": item_id} if q: results.update({"q": q}) return results
null
158,004
from fastapi import FastAPI, Path async def read_items( *, item_id: int = Path(..., title="The ID of the item to get", gt=0, le=1000), q: str, ): results = {"item_id": item_id} if q: results.update({"q": q}) return results
null
158,005
from fastapi import FastAPI, Path async def read_items( q: str, item_id: int = Path(..., title="The ID of the item to get") ): results = {"item_id": item_id} if q: results.update({"q": q}) return results
null
158,006
from typing import Optional from fastapi import FastAPI from fastapi.responses import FileResponse from pydantic import BaseModel async def read_item(item_id: str, img: Optional[bool] = None): if img: return FileResponse("image.png", media_type="image/png") else: return {"id": "foo", "value": "there goes my hero"}
null
158,007
from fastapi import FastAPI from fastapi.responses import JSONResponse from pydantic import BaseModel async def read_item(item_id: str): if item_id == "foo": return {"id": "foo", "value": "there goes my hero"} else: return JSONResponse(status_code=404, content={"message": "Item not found"})
null
158,010
from fastapi import FastAPI, Request def read_main(request: Request): return {"message": "Hello World", "root_path": request.scope.get("root_path")}
null
158,014
from fastapi import FastAPI def read_main(): return {"message": "Hello World from main app"}
null
158,015
from fastapi import FastAPI def read_sub(): return {"message": "Hello World from sub API"}
null
158,016
from dataclasses import dataclass from typing import Optional from fastapi import FastAPI class Item: async def create_item(item: Item): return item
null
158,017
from dataclasses import field from typing import List, Optional from fastapi import FastAPI from pydantic.dataclasses import dataclass class Item: name: str description: Optional[str] = None async def create_author_items(author_id: str, items: List[Item]): # (5) return {"name": author_id, "items": items} # (6)
null
158,018
from dataclasses import field from typing import List, Optional from fastapi import FastAPI from pydantic.dataclasses import dataclass def get_authors(): # (8) return [ # (9) { "name": "Breaters", "items": [ { "name": "Island In The Moon", "description": "A place to be be playin' and havin' fun", }, {"name": "Holy Buddies"}, ], }, { "name": "System of an Up", "items": [ { "name": "Salt", "description": "The kombucha mushroom people's favorite", }, {"name": "Pad Thai"}, { "name": "Lonely Night", "description": "The mostests lonliest nightiest of allest", }, ], }, ]
null
158,019
from dataclasses import dataclass, field from typing import List, Optional from fastapi import FastAPI async def read_next_item(): return { "name": "Island In The Moon", "price": 12.99, "description": "A place to be be playin' and havin' fun", "tags": ["breater"], }
null
158,020
from typing import List import databases import sqlalchemy from fastapi import FastAPI from pydantic import BaseModel database = databases.Database(DATABASE_URL) async def startup(): await database.connect()
null
158,021
from typing import List import databases import sqlalchemy from fastapi import FastAPI from pydantic import BaseModel database = databases.Database(DATABASE_URL) async def shutdown(): await database.disconnect()
null
158,022
from typing import List import databases import sqlalchemy from fastapi import FastAPI from pydantic import BaseModel database = databases.Database(DATABASE_URL) notes = sqlalchemy.Table( "notes", metadata, sqlalchemy.Column("id", sqlalchemy.Integer, primary_key=True), sqlalchemy.Column("text", sqlalchemy.String), sqlalchemy.Column("completed", sqlalchemy.Boolean), ) async def read_notes(): query = notes.select() return await database.fetch_all(query)
null
158,023
from typing import List import databases import sqlalchemy from fastapi import FastAPI from pydantic import BaseModel database = databases.Database(DATABASE_URL) notes = sqlalchemy.Table( "notes", metadata, sqlalchemy.Column("id", sqlalchemy.Integer, primary_key=True), sqlalchemy.Column("text", sqlalchemy.String), sqlalchemy.Column("completed", sqlalchemy.Boolean), ) class NoteIn(BaseModel): text: str completed: bool async def create_note(note: NoteIn): query = notes.insert().values(text=note.text, completed=note.completed) last_record_id = await database.execute(query) return {**note.dict(), "id": last_record_id}
null
158,024
from fastapi import FastAPI, Request from fastapi.responses import HTMLResponse from fastapi.staticfiles import StaticFiles from fastapi.templating import Jinja2Templates templates = Jinja2Templates(directory="templates") async def read_item(request: Request, id: str): return templates.TemplateResponse("item.html", {"request": request, "id": id})
null
158,025
from fastapi import FastAPI from fastapi.responses import JSONResponse def get_headers(): content = {"message": "Hello World"} headers = {"X-Cat-Dog": "alone in the world", "Content-Language": "en-US"} return JSONResponse(content=content, headers=headers)
null
158,026
from fastapi import FastAPI, Response def get_headers(response: Response): response.headers["X-Cat-Dog"] = "alone in the world" return {"message": "Hello World"}
null
158,027
from typing import Optional from fastapi import FastAPI from pydantic import BaseModel class Item(BaseModel): name: str description: Optional[str] = None price: float tax: Optional[float] = None async def create_item(item_id: int, item: Item, q: Optional[str] = None): result = {"item_id": item_id, **item.dict()} if q: result.update({"q": q}) return result
null
158,028
from fastapi import FastAPI from pydantic import BaseModel class Item(BaseModel): async def create_item(item: Item): return item
null