Skip to main content

FastAPI WebSocket bridge between a Furhat robot and the OpenAI Realtime API

Project description

Copilotten.FurhatConnection

A FastAPI-based WebSocket bridge between a Furhat robot and the OpenAI Realtime API.

Furhat microphone (PCM16 audio @ 24 kHz)
        │
        ▼
  FastAPI /ws  ──────► OpenAI Realtime API (gpt-4o-realtime-preview)
        │                      │ response.audio.delta → PCM16 audio
        │◄─────────────────────┘
        │ request_speak_audio_start/data/end
        ▼
  Furhat robot (furhat-realtime-api)

Browser (monitor UI)  ◄──── transcripts & status ────  FastAPI /ws

Installation

pip install furhat-bridge

Quick start

# Start the bridge server (binds to 0.0.0.0:8000 by default)
furhat-bridge

# Custom host/port
furhat-bridge --host 127.0.0.1 --port 9000

# Development mode with auto-reload
furhat-bridge --reload

# Or with uvicorn directly
uvicorn furhat_bridge.server:app --reload

Then open http://localhost:8000 in your browser, enter the Furhat IP address and your OpenAI API key, and click Connect.

Development (from source)

# Clone and install in editable mode
git clone https://github.com/Nedomkull-Mathematical-Modeling/Copilotten.FurhatConnection
cd Copilotten.FurhatConnection
pip install -e .

# Or install only the dependencies without packaging
pip install -r requirements.txt
uvicorn main:app --reload

Publishing to PyPI

pip install build twine
python -m build
twine upload dist/*

How it works

  1. The browser opens a WebSocket to /ws and sends a config message with the Furhat IP and OpenAI API key.
  2. The server connects to the Furhat robot using furhat-realtime-api (AsyncFurhatClient) and to the OpenAI Realtime API via WebSocket.
  3. On session.created, the server configures the OpenAI session (audio in/out, server-side VAD, Whisper transcription) and triggers an initial greeting from Copilotten.
  4. When OpenAI is generating a response, the Furhat microphone is paused. OpenAI's audio deltas are streamed directly to the Furhat robot for real-time lipsync playback.
  5. When Furhat finishes speaking (response.speak.end), the microphone resumes and the user can speak. The Furhat microphone audio (PCM16, 24 kHz, mono) is forwarded to OpenAI using input_audio_buffer.append.
  6. OpenAI's server-side VAD detects speech boundaries automatically.
  7. Transcripts (both user speech via Whisper and assistant replies) are displayed in the browser in real time.

Requirements

  • Python 3.10+
  • A Furhat robot accessible on the local network
  • An OpenAI API key with access to the Realtime API

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

furhat_bridge-0.1.0.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

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

furhat_bridge-0.1.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for furhat_bridge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 351cf765e9c12bc472d45551913fa0a82c17e7f5ac0ac491a9062ccd26730174
MD5 1e0475f34401e85e9307436b258a186d
BLAKE2b-256 21d37fb7cd43f2fc79f00e66b132126e46810d149cfb86c75d696aee80321a6b

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on Nedomkull-Mathematical-Modeling/Copilotten.FurhatConnection

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

File details

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

File metadata

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

File hashes

Hashes for furhat_bridge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 400785b5cb128f797f8a29e13ac95a6ffce9c888b5dce8e43ade784505fb349d
MD5 a9df861f8e03554dce2014a5d82e39e8
BLAKE2b-256 d2137d07dd9aefd3b6568dd154c1aa92e91b040b36d4a681fdb74e34e4fd5bbb

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on Nedomkull-Mathematical-Modeling/Copilotten.FurhatConnection

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