fastapi-agent-starter 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fastapi_agent_starter-0.1.0/LICENSE +17 -0
- fastapi_agent_starter-0.1.0/PKG-INFO +83 -0
- fastapi_agent_starter-0.1.0/README.md +65 -0
- fastapi_agent_starter-0.1.0/pyproject.toml +34 -0
- fastapi_agent_starter-0.1.0/src/create_agent_service/templates/agent_service/.python-version +1 -0
- fastapi_agent_starter-0.1.0/src/create_agent_service/templates/agent_service/README.md +13 -0
- fastapi_agent_starter-0.1.0/src/create_agent_service/templates/agent_service/app/__init__.py +1 -0
- fastapi_agent_starter-0.1.0/src/create_agent_service/templates/agent_service/app/main.py +30 -0
- fastapi_agent_starter-0.1.0/src/create_agent_service/templates/agent_service/pyproject.toml +19 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 FastAPI Agent Scaffold contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: fastapi-agent-starter
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Scaffold a runnable FastAPI agent service project
|
|
5
|
+
Author: Biswajit Sundara
|
|
6
|
+
License: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Keywords: agent,fastapi,project-template,starter
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Framework :: FastAPI
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# FastAPI Agent Starter
|
|
20
|
+
|
|
21
|
+
A small command-line package that creates a runnable FastAPI agent service starter. The generated service uses [uv](https://docs.astral.sh/uv/) to manage Python, dependencies, and commands.
|
|
22
|
+
|
|
23
|
+
## Use the scaffolder
|
|
24
|
+
|
|
25
|
+
Install the published package, then create a service:
|
|
26
|
+
|
|
27
|
+
```console
|
|
28
|
+
uv tool install fastapi-agent-starter
|
|
29
|
+
create-agent-service my-agent
|
|
30
|
+
cd my-agent
|
|
31
|
+
uv sync
|
|
32
|
+
uv run fastapi dev
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Open `http://127.0.0.1:8000/docs`. The starter has `/health` and `/agent/run` endpoints. Replace the example agent logic in `app/main.py` with your own model or agent framework and add dependencies with `uv add <package>`.
|
|
36
|
+
|
|
37
|
+
### Options
|
|
38
|
+
|
|
39
|
+
```console
|
|
40
|
+
create-agent-service --help
|
|
41
|
+
create-agent-service my-agent --path ./services
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The output folder is created under the current directory unless `--path` is supplied. Existing output folders are preserved; pass `--force` to replace generated files inside an existing folder.
|
|
45
|
+
|
|
46
|
+
## Develop this scaffolder
|
|
47
|
+
|
|
48
|
+
With uv installed:
|
|
49
|
+
|
|
50
|
+
```console
|
|
51
|
+
uv sync
|
|
52
|
+
uv run create-agent-service demo-agent
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Publish to PyPI
|
|
56
|
+
|
|
57
|
+
1. Choose a distribution name that is available on PyPI, update `name` and `version` in `pyproject.toml`, and review the project metadata. The import package and CLI command can keep their current names.
|
|
58
|
+
2. Create accounts on [PyPI](https://pypi.org/account/register/) and [TestPyPI](https://test.pypi.org/account/register/).
|
|
59
|
+
3. Build the artifacts and check them:
|
|
60
|
+
|
|
61
|
+
```console
|
|
62
|
+
uv build --no-sources
|
|
63
|
+
uvx twine check dist/*
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
4. Try an upload to TestPyPI:
|
|
67
|
+
|
|
68
|
+
```console
|
|
69
|
+
uv publish --publish-url https://test.pypi.org/legacy/ dist/*
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Set `UV_PUBLISH_TOKEN` to a TestPyPI token first. Then install that test release in a fresh environment to check the command and generated project.
|
|
73
|
+
5. When ready, set `UV_PUBLISH_TOKEN` to a PyPI token and publish:
|
|
74
|
+
|
|
75
|
+
```console
|
|
76
|
+
uv publish dist/*
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
For CI releases, configure PyPI Trusted Publishing for your repository and workflow; it avoids storing a long-lived token. See the [uv publishing guide](https://docs.astral.sh/uv/guides/publish/) and [PyPI publishing guide](https://docs.pypi.org/publishing/).
|
|
80
|
+
|
|
81
|
+
Each release needs a new version, and PyPI does not allow reusing an already published version. Never commit a PyPI API token to source control.
|
|
82
|
+
|
|
83
|
+
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# FastAPI Agent Starter
|
|
2
|
+
|
|
3
|
+
A small command-line package that creates a runnable FastAPI agent service starter. The generated service uses [uv](https://docs.astral.sh/uv/) to manage Python, dependencies, and commands.
|
|
4
|
+
|
|
5
|
+
## Use the scaffolder
|
|
6
|
+
|
|
7
|
+
Install the published package, then create a service:
|
|
8
|
+
|
|
9
|
+
```console
|
|
10
|
+
uv tool install fastapi-agent-starter
|
|
11
|
+
create-agent-service my-agent
|
|
12
|
+
cd my-agent
|
|
13
|
+
uv sync
|
|
14
|
+
uv run fastapi dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Open `http://127.0.0.1:8000/docs`. The starter has `/health` and `/agent/run` endpoints. Replace the example agent logic in `app/main.py` with your own model or agent framework and add dependencies with `uv add <package>`.
|
|
18
|
+
|
|
19
|
+
### Options
|
|
20
|
+
|
|
21
|
+
```console
|
|
22
|
+
create-agent-service --help
|
|
23
|
+
create-agent-service my-agent --path ./services
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The output folder is created under the current directory unless `--path` is supplied. Existing output folders are preserved; pass `--force` to replace generated files inside an existing folder.
|
|
27
|
+
|
|
28
|
+
## Develop this scaffolder
|
|
29
|
+
|
|
30
|
+
With uv installed:
|
|
31
|
+
|
|
32
|
+
```console
|
|
33
|
+
uv sync
|
|
34
|
+
uv run create-agent-service demo-agent
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Publish to PyPI
|
|
38
|
+
|
|
39
|
+
1. Choose a distribution name that is available on PyPI, update `name` and `version` in `pyproject.toml`, and review the project metadata. The import package and CLI command can keep their current names.
|
|
40
|
+
2. Create accounts on [PyPI](https://pypi.org/account/register/) and [TestPyPI](https://test.pypi.org/account/register/).
|
|
41
|
+
3. Build the artifacts and check them:
|
|
42
|
+
|
|
43
|
+
```console
|
|
44
|
+
uv build --no-sources
|
|
45
|
+
uvx twine check dist/*
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
4. Try an upload to TestPyPI:
|
|
49
|
+
|
|
50
|
+
```console
|
|
51
|
+
uv publish --publish-url https://test.pypi.org/legacy/ dist/*
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Set `UV_PUBLISH_TOKEN` to a TestPyPI token first. Then install that test release in a fresh environment to check the command and generated project.
|
|
55
|
+
5. When ready, set `UV_PUBLISH_TOKEN` to a PyPI token and publish:
|
|
56
|
+
|
|
57
|
+
```console
|
|
58
|
+
uv publish dist/*
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
For CI releases, configure PyPI Trusted Publishing for your repository and workflow; it avoids storing a long-lived token. See the [uv publishing guide](https://docs.astral.sh/uv/guides/publish/) and [PyPI publishing guide](https://docs.pypi.org/publishing/).
|
|
62
|
+
|
|
63
|
+
Each release needs a new version, and PyPI does not allow reusing an already published version. Never commit a PyPI API token to source control.
|
|
64
|
+
|
|
65
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.26"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "fastapi-agent-starter"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Scaffold a runnable FastAPI agent service project"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [{ name = "Biswajit Sundara" }]
|
|
13
|
+
keywords = ["fastapi", "agent", "starter", "project-template"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"Framework :: FastAPI",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Topic :: Software Development :: Code Generators",
|
|
22
|
+
]
|
|
23
|
+
dependencies = []
|
|
24
|
+
|
|
25
|
+
[project.scripts]
|
|
26
|
+
create-agent-service = "create_agent_service.cli:main"
|
|
27
|
+
|
|
28
|
+
[tool.hatch.build.targets.wheel]
|
|
29
|
+
packages = ["src/create_agent_service"]
|
|
30
|
+
|
|
31
|
+
[tool.hatch.build]
|
|
32
|
+
include = ["src/create_agent_service/templates/**"]
|
|
33
|
+
|
|
34
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# {{project_name}}
|
|
2
|
+
|
|
3
|
+
A starter FastAPI service for an AI agent. This project uses [uv](https://docs.astral.sh/uv/) for Python and dependency management. The `/agent/run` route is a placeholder; connect your agent framework or model provider in `app/main.py`.
|
|
4
|
+
|
|
5
|
+
## Run locally
|
|
6
|
+
|
|
7
|
+
```console
|
|
8
|
+
uv sync
|
|
9
|
+
uv run fastapi dev
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Open `http://127.0.0.1:8000/docs` for interactive API docs. The app entrypoint is configured in `pyproject.toml`, so FastAPI CLI tools can locate it. For production, use `uv run fastapi run`. Add dependencies with `uv add <package>`.
|
|
13
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""FastAPI application package."""
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""Minimal FastAPI agent service starter."""
|
|
2
|
+
|
|
3
|
+
from fastapi import FastAPI
|
|
4
|
+
from pydantic import BaseModel
|
|
5
|
+
|
|
6
|
+
app = FastAPI(title="{{project_name}}", version="0.1.0")
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class AgentRequest(BaseModel):
|
|
10
|
+
"""Input accepted by the starter agent endpoint."""
|
|
11
|
+
|
|
12
|
+
message: str
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class AgentResponse(BaseModel):
|
|
16
|
+
"""Output returned by the starter agent endpoint."""
|
|
17
|
+
|
|
18
|
+
response: str
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@app.get("/health")
|
|
22
|
+
def health() -> dict[str, str]:
|
|
23
|
+
return {"status": "ok"}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@app.post("/agent/run", response_model=AgentResponse)
|
|
27
|
+
def run_agent(request: AgentRequest) -> AgentResponse:
|
|
28
|
+
"""Replace this echo with your agent's orchestration logic."""
|
|
29
|
+
|
|
30
|
+
return AgentResponse(response=f"Agent received: {request.message}")
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "{{project_name}}"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "A FastAPI service with a starter agent endpoint"
|
|
5
|
+
requires-python = ">=3.10"
|
|
6
|
+
dependencies = [
|
|
7
|
+
"fastapi[standard]>=0.115,<1.0",
|
|
8
|
+
]
|
|
9
|
+
|
|
10
|
+
[build-system]
|
|
11
|
+
requires = ["hatchling>=1.26"]
|
|
12
|
+
build-backend = "hatchling.build"
|
|
13
|
+
|
|
14
|
+
[tool.uv]
|
|
15
|
+
package = false
|
|
16
|
+
|
|
17
|
+
[tool.fastapi]
|
|
18
|
+
entrypoint = "app.main:app"
|
|
19
|
+
|