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
Close
Hashes for nested_chat_plugin_sdk-0.1.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1237bd089ad88305e9d25ee109b97249f94b4805be3d7a14ea7ee079ca9907f7 |
|
MD5 | 46567dc314a7a59d4ffd0369e1639355 |
|
BLAKE2b-256 | bf7cc5b822865bc0f558ff83c047b7409137f720fad5aa34ad6b1653a6814ece |
Close
Hashes for nested_chat_plugin_sdk-0.1.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d5216124a293e4a816a83b8e346828ba8412a08a3585944424bb6126c34d324 |
|
MD5 | d3cdcad3b3ca597d72ece2db7ed7347f |
|
BLAKE2b-256 | 638833fedc8db2640bdd2380e4264cf91be4f9d67719630febd946bfb40b25ab |