CoCo(Conversational Components) SDK for building modular chatbots
Project description
CoCoHub SDK to use components in python code
https://www.conversationalcomponents.com
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
Release history Release notifications | RSS feed
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.0.tar.gz
(5.0 kB
view details)
Built Distribution
File details
Details for the file coco-sdk-0.1.0.tar.gz
.
File metadata
- Download URL: coco-sdk-0.1.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3262a84b2720b7316d6fd4e31b7937e3733993e2df3ed47ce9930e1711509481 |
|
MD5 | 913559c3bcf900523aeede6fa52820a8 |
|
BLAKE2b-256 | bd57d62bea4480d4af469d7da2dc77350412b9c8d8b248abcf3756776f68c495 |
File details
Details for the file coco_sdk-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: coco_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f28e76c4c4b3c5195e5d317472a2e50bba95c924538dab349206ea060db5fc35 |
|
MD5 | e4101909f3f1652b3590e8b3d4811b3c |
|
BLAKE2b-256 | de462d45a30c1e49e29f5bbc24d0340ec543d6181799e0bfdb4472e5ce1868d7 |