Skip to main content

HiCharlie conversational Python SDK (REST + realtime audio websocket).

Project description

HiCharlie Python SDK

Client-side Python SDK for HiCharlie conversational voice sessions.

Install

pip install hicharlie

Features

  • REST client:
    • list_agents()
    • get_agent(agent_id)
    • create_session(...)
    • get_transcript(session_id)
  • Realtime conversation lifecycle over WebSocket (Conversation)
  • Default PyAudio input/output with active default-device hot-swap

Quickstart

from hicharlie import Conversation, DefaultAudioInterface, HiCharlie

client = HiCharlie(api_key="hc_xxx", base_url="https://voice.hicharlie.fr")
session = client.create_session(
    system_prompt="Tu es un assistant technique.",
    first_message="Salut ! De quoi as-tu besoin ?",
    language="fr",
)

audio = DefaultAudioInterface()
conversation = Conversation(
    session=session,
    audio_interface=audio,
    callback_agent_response=lambda text: print(f"Agent: {text}"),
    callback_user_transcript=lambda text: print(f"User: {text}"),
)

conversation.start_session()
conversation.wait_for_session_end()

transcript = client.get_transcript(session.session_id)
print(transcript)
client.close()

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

hicharlie-0.1.0.tar.gz (27.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hicharlie-0.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file hicharlie-0.1.0.tar.gz.

File metadata

  • Download URL: hicharlie-0.1.0.tar.gz
  • Upload date:
  • Size: 27.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hicharlie-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5e0621d3f7715919e324151b5fb1b3325ddf0129e37c1a769e663bee029d7207
MD5 ef801f2a78d7593c7b377f5e6c9fc45c
BLAKE2b-256 618ef7e4af1fb60ee0d09c6f8aa53f874a585fb243ad631af861b6d35a3c227b

See more details on using hashes here.

Provenance

The following attestation bundles were made for hicharlie-0.1.0.tar.gz:

Publisher: publish-hicharlie-sdk-package.yml on Swarek/Peerlab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hicharlie-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hicharlie-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hicharlie-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f6688665548c1cc724a7389905cd68b8b281e601268090990f17a2ebf25f11e
MD5 225ddbe7ad776413bbcddd02802fa788
BLAKE2b-256 a817ecf1d1082b6cd9dc94abd655ee2f75cf97d6d5b01bd71b09a41c455952e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for hicharlie-0.1.0-py3-none-any.whl:

Publisher: publish-hicharlie-sdk-package.yml on Swarek/Peerlab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page