Skip to content

Commit 3533981

Browse files
committed
add template codes for FastAPI
1 parent 094c81c commit 3533981

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,7 @@ ci-test-docs: install-deps-docs docs ## run CI test for documentation
115115
.PHONY: langgraph-studio
116116
langgraph-studio: ## run LangGraph Studio
117117
uv run langgraph dev
118+
119+
.PHONY: fastapi-dev
120+
fastapi-dev: ## run FastAPI
121+
uv run fastapi dev ./template_langgraph/services/fastapis.py

docs/references.ja.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@
2020
- [CSVLoader](https://python.langchain.com/docs/how_to/document_loader_csv/)
2121
- [Qdrant](https://github.com/qdrant/qdrant)
2222
- [Azure Cosmos DB No SQL](https://python.langchain.com/docs/integrations/vectorstores/azure_cosmos_db_no_sql/)
23+
24+
### Services
25+
26+
- [FastAPI](https://fastapi.tiangolo.com/)

docs/references.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@
2020
- [CSVLoader](https://python.langchain.com/docs/how_to/document_loader_csv/)
2121
- [Qdrant](https://github.com/qdrant/qdrant)
2222
- [Azure Cosmos DB No SQL](https://python.langchain.com/docs/integrations/vectorstores/azure_cosmos_db_no_sql/)
23+
24+
### Services
25+
26+
- [FastAPI](https://fastapi.tiangolo.com/)

template_langgraph/services/__init__.py

Whitespace-only changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from fastapi import FastAPI
2+
3+
app = FastAPI()
4+
5+
6+
@app.get("/")
7+
def read_root():
8+
return {"Hello": "World"}
9+
10+
11+
@app.get("/items/{item_id}")
12+
def read_item(item_id: int, q: str | None = None):
13+
return {"item_id": item_id, "q": q}

0 commit comments

Comments
 (0)