Skip to main content

CoCo(Conversational Components) SDK for building modular chatbots

Project description

CoCoHub SDK to use components in python code

https://www.conversationalcomponents.com

asciicast

Installation

pip install coco-sdk

With async support

pip install coco-sdk[async]

Usage

import coco
import uuid

session_id = str(uuid.uuid4()) # generate a random session id

# directly calling exchange:
response = coco.exchange("namer_vp3", session_id, user_input="hello") # namer_vp3 is CoCoHub component

# using ConversationalComponent API
comp = coco.ConversationalComponent("namer_vp3")
response = comp(session_id, "hello")

# using ComponentSession API
session_with_component = coco.ComponentSession("namer_vp3") 
response = session_with_component("hello")

Async

import coco.async_api as coco

# directly calling exchange:
response = await coco.exchange("namer_vp3", session_id, user_input="hello") # namer_vp3 is CoCoHub component

# using ConversationalComponent API
comp = coco.ConversationalComponent("namer_vp3")
response = await comp(session_id, "hello")

# using ComponentSession API
session_with_component = coco.ComponentSession("namer_vp3") 
response = await session_with_component("hello")

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

coco-sdk-0.1.12.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

coco_sdk-0.1.12-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file coco-sdk-0.1.12.tar.gz.

File metadata

  • Download URL: coco-sdk-0.1.12.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for coco-sdk-0.1.12.tar.gz
Algorithm Hash digest
SHA256 8aafad0b8954c1e77f3d828767f613da49ad3ecdc4942663fb62c4b7024aa8e2
MD5 621f97401c72309d060c6316a9ff15f1
BLAKE2b-256 dd1cacc40488e46a66257b1281545f21a044c15dd5cb0693b111f7651cf5ee84

See more details on using hashes here.

File details

Details for the file coco_sdk-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: coco_sdk-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for coco_sdk-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 c0875ca375bc8d30f755bc7fdb95e99aae0f4bc6be640af9cf3e66d408a9fdcb
MD5 248e9eb1679c5a4151f12a81ca807aa7
BLAKE2b-256 6ed2c25f51bab36898ddf0cbc69449ef89de9cac9c82cc3db863a8e930748d98

See more details on using hashes here.

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