Test
Project description
Plugin SDK for FastAPI
The Plugin SDK nested-chat-plugin-sdk is a FastAPI extension that provides a convenient way to handle requests for creating, updating, deleting, and executing operations.
Installation
Install dependencies using Poetry and activate the virtual environment. Learn how to install Poetry
poetry install
poetry shell
Install the SDK using Poetry:
poetry add nested-chat-plugin-sdk
Example
from fastapi import FastAPI, Request
from nested_chat_plugin_sdk.sdk import PluginRouter, SyncRequest
app = FastAPI()
plugin_router = PluginRouter(api_url="")
@plugin_router.on_create
async def handle_create(data: SyncRequest):
print("create", data)
@plugin_router.on_update
async def handle_update(data: SyncRequest):
print("update", data)
@plugin_router.on_delete
async def handle_delete(data: SyncRequest):
print("delete", data)
@plugin_router.on_execute
async def handle_execute(request: Request):
print("execute", request)
app.include_router(plugin_router)
API Routes
/sync
POST
: Create dataPUT
: Update dataDELETE
: Delete data
/execute
POST
: Execute operation
SyncRequest Schema
from nested_chat_plugin_sdk.schemes import SyncRequest
class SyncRequest(BaseModel):
project: dict[str, Any]
core: dict[str, Any]
variable: dict[str, Any]
variable_enum_item: dict[str, Any] = {}
variable_group: str | None = None
Project details
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
File details
Details for the file nested_chat_plugin_sdk-0.1.7.tar.gz
.
File metadata
- Download URL: nested_chat_plugin_sdk-0.1.7.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.15.146.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1237bd089ad88305e9d25ee109b97249f94b4805be3d7a14ea7ee079ca9907f7 |
|
MD5 | 46567dc314a7a59d4ffd0369e1639355 |
|
BLAKE2b-256 | bf7cc5b822865bc0f558ff83c047b7409137f720fad5aa34ad6b1653a6814ece |
File details
Details for the file nested_chat_plugin_sdk-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: nested_chat_plugin_sdk-0.1.7-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.15.146.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d5216124a293e4a816a83b8e346828ba8412a08a3585944424bb6126c34d324 |
|
MD5 | d3cdcad3b3ca597d72ece2db7ed7347f |
|
BLAKE2b-256 | 638833fedc8db2640bdd2380e4264cf91be4f9d67719630febd946bfb40b25ab |