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.3.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

nested_chat_plugin_sdk-0.1.3-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file nested_chat_plugin_sdk-0.1.3.tar.gz.

File metadata

  • Download URL: nested_chat_plugin_sdk-0.1.3.tar.gz
  • Upload date:
  • Size: 6.5 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

Hashes for nested_chat_plugin_sdk-0.1.3.tar.gz
Algorithm Hash digest
SHA256 270539631e915092306e64559c5bbb10d7594add0d8a5bb84fc30aea80bffb20
MD5 14995738b4a146055a3349ab39b82567
BLAKE2b-256 543641ce7dfd742cdfde6dd2b6f35886aaa9e624064cd565bd9a8f9302202387

See more details on using hashes here.

Provenance

File details

Details for the file nested_chat_plugin_sdk-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: nested_chat_plugin_sdk-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.1 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

Hashes for nested_chat_plugin_sdk-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ab95d5aef631fceda28d348ba814dedf17792ea7c6d72881e4f180b16fca2c3d
MD5 492847dd6e274269c3e7826cd68891cc
BLAKE2b-256 16b2817917f06e806d0c532f4b8c3ba761d1e81716028e07bd0da7530f850328

See more details on using hashes here.

Provenance

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