https://www.conversationalcomponents.com
pip install coco-sdk
pip install coco-sdk[async]
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")
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")