Skip to main content

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 data
  • PUT: Update data
  • DELETE: 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

nested_chat_plugin_sdk-0.1.2.tar.gz (6.4 kB view hashes)

Uploaded Source

Built Distribution

nested_chat_plugin_sdk-0.1.2-py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page