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.10.tar.gz
(7.7 kB
view details)
Built Distribution
File details
Details for the file coco-sdk-0.1.10.tar.gz
.
File metadata
- Download URL: coco-sdk-0.1.10.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.9.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf955660e33ceef2c498cb6f33b37207d3cf48f3b968c29f6c6bedcfdd2dcdd5 |
|
MD5 | ac10dd7b7070209b46c95c9f4e3b4bde |
|
BLAKE2b-256 | d8564724dace1f801bd8079abdba9f742e4cb522f1596d554635bf0289962270 |
File details
Details for the file coco_sdk-0.1.10-py3-none-any.whl
.
File metadata
- Download URL: coco_sdk-0.1.10-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.9.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae33b0f441f592bfd10f4b56c99b848cce64eceff4910e92f445aa7f1c7c6312 |
|
MD5 | a8026390173d64e210fc52f0ed8b8f41 |
|
BLAKE2b-256 | 6a1b598fc8c41c5fd02cf9c2a00a9dd2d6aa8f3318a521416e40ded5222f683a |