Genkit FastAPI Plugin
Project description
Genkit FastAPI Plugin
Serve Genkit flows as FastAPI endpoints.
Installation
pip install genkit-plugin-fastapi
Usage
from fastapi import FastAPI from genkit import Genkit from genkit.plugins.fastapi import genkit_fastapi_handler from genkit.plugins.google_genai import GoogleAI
ai = Genkit(plugins=[GoogleAI()]) app = FastAPI()
@ai.flow() async def chat_flow(prompt: str) -> str: response = await ai.generate(prompt=prompt) return response.text
@app.post('/chat') @genkit_fastapi_handler(ai) async def chat(): return chat_flow
Running
# With Genkit Dev UI
genkit start -- uvicorn main:app --reload
# Production (no Dev UI)
uvicorn main:app
Streaming
The handler automatically supports streaming when the client sends Accept: text/event-stream:
curl -X POST http://localhost:8000/chat \
-H "Content-Type: application/json" \
-H "Accept: text/event-stream" \
-d '{"data": "Tell me a joke"}'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file genkit_plugin_fastapi-0.6.0.tar.gz.
File metadata
- Download URL: genkit_plugin_fastapi-0.6.0.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d561754e0bf2d7a76d3d985f893cadb1c9530aad823311efed381ce8ba51da7
|
|
| MD5 |
390955f49c917633847ca0813ee6d390
|
|
| BLAKE2b-256 |
9484b624f7cc186099b48365217fd1cf51b261dc0198c478688bd52eda3a6b23
|
Provenance
The following attestation bundles were made for genkit_plugin_fastapi-0.6.0.tar.gz:
Publisher:
publish_python.yml on genkit-ai/genkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
genkit_plugin_fastapi-0.6.0.tar.gz -
Subject digest:
7d561754e0bf2d7a76d3d985f893cadb1c9530aad823311efed381ce8ba51da7 - Sigstore transparency entry: 1593878667
- Sigstore integration time:
-
Permalink:
genkit-ai/genkit@58e97221eca37fd496d377122b8031e83b8eb56a -
Branch / Tag:
refs/tags/py/v0.6.0 - Owner: https://github.com/genkit-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_python.yml@58e97221eca37fd496d377122b8031e83b8eb56a -
Trigger Event:
push
-
Statement type:
File details
Details for the file genkit_plugin_fastapi-0.6.0-py3-none-any.whl.
File metadata
- Download URL: genkit_plugin_fastapi-0.6.0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b6f6d4b3d5bd3da14d3649b2c5d13d9b2891ae806e0bfd007bf298d9965e88c
|
|
| MD5 |
39eedc277fc9fbd82e6624cb14a74425
|
|
| BLAKE2b-256 |
2c3de1d93cb5d2a7e07787d505f54e31c59fc66d2712ef2662b2098cdcab69dc
|
Provenance
The following attestation bundles were made for genkit_plugin_fastapi-0.6.0-py3-none-any.whl:
Publisher:
publish_python.yml on genkit-ai/genkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
genkit_plugin_fastapi-0.6.0-py3-none-any.whl -
Subject digest:
8b6f6d4b3d5bd3da14d3649b2c5d13d9b2891ae806e0bfd007bf298d9965e88c - Sigstore transparency entry: 1593878962
- Sigstore integration time:
-
Permalink:
genkit-ai/genkit@58e97221eca37fd496d377122b8031e83b8eb56a -
Branch / Tag:
refs/tags/py/v0.6.0 - Owner: https://github.com/genkit-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_python.yml@58e97221eca37fd496d377122b8031e83b8eb56a -
Trigger Event:
push
-
Statement type: