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

Uploaded Source

Built Distribution

coco_sdk-0.0.6-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: coco-sdk-0.0.6.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.2

File hashes

Hashes for coco-sdk-0.0.6.tar.gz
Algorithm Hash digest
SHA256 a7f75f6c08f6918681bbc599aa309073fe48209c854b2b2c8cce98fa4ebece29
MD5 06d00cb758273fb5913acdb1220c23cf
BLAKE2b-256 b8a7c13c7d0514dce25c745b39fdb75fa564efa81114740ef6bf4979230327e2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: coco_sdk-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.2

File hashes

Hashes for coco_sdk-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e45af2167b52d9de31156192ba56e52f32692eec7e161032fc71a12341768c34
MD5 a60459fa3da921a3f09f3dfd375ecb10
BLAKE2b-256 152989a0af51889c8d5a101477570426b1e9e150ff3c305d6a53deceeee20f45

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