Skip to main content

Fixie.ai SDK for Python. Enables you to build AI-powered voice applications.

Project description

fixie-sdk-python

Fixie SDK for Python

Quickstart

pip install fixie

Hello Agent

To start a voice session with a Fixie agent, create a VoiceSession object and call session.start().

from fixie_sdk.voice import audio_local
from fixie_sdk.voice import types
from fixie_sdk.voice.session import VoiceSession
from fixie_sdk.voice.session import VoiceSessionParams


async def main():
    source = audio_local.LocalAudioSource()
    sink = audio_local.LocalAudioSink()
    params = VoiceSessionParams(agent_id=<your agent uuid>)
    client = VoiceSession(source, sink, params)
    await client.warmup()
    await client.start()
    await asyncio.Event().wait()


asyncio.run(main())

Hello Santa

For a more complete example, see the command-line client included with the Fixie SDK: https://github.com/fixie-ai/fixie-sdk-python/blob/main/fixie_sdk/examples/voice_example.py

Installing & Running from Source

  1. Install
poetry install
  1. Run included voice example
poetry run python examples/voice_example.py

Use Ctrl-C to terminate the program.

The example program will use the default microphone and output device (i.e. speaker) for your computer. These are set in this code:

# Get the default microphone and audio output device.
source = audio_local.LocalAudioSource()
sink = audio_local.LocalAudioSink()

You can find more information in the file voice/audio_local.py.

Using Your Own Agent

You can pass in the --agent (or -a) input parameter followed by a space and then the ID of your agent.

Using a Different Voice

Adding more voices is a WIP. For now you can use the default voice or can pick any of the voices that are defined here. Pass in the desired voiceID with the --tts-voice (-tv) parameter.

Using Your Own Audio Devices

Typically you will want to supply your own audio source and sink (e.g., to pipe the data to the phone network rather than the local audio devices). To do this, simply create your own classes derived from AudioSource and AudioSink and pass them in to the VoiceSession constructor.

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

fixie-0.0.8.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

fixie-0.0.8-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file fixie-0.0.8.tar.gz.

File metadata

  • Download URL: fixie-0.0.8.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.9.13 Darwin/23.2.0

File hashes

Hashes for fixie-0.0.8.tar.gz
Algorithm Hash digest
SHA256 173315ac54fbf1b997ae010441186c4d13120d357596fd2afb6f4e71d945c937
MD5 dbf82cbe88549220e3fc09a5aca83d6a
BLAKE2b-256 9dfcd6102bed67f884f9b2b62babb66f533b444d3e62f837336b0b1368673033

See more details on using hashes here.

File details

Details for the file fixie-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: fixie-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.9.13 Darwin/23.2.0

File hashes

Hashes for fixie-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 47da48ffd6a972751a809f76abb9179815b82d26c36eb8d9528eef58eefd14bd
MD5 8180d0cef76ff22a42adc0281e5b5eb8
BLAKE2b-256 916ebd99636ce01c45f56d2d3baaf287a03f960c7b4afe89f764067015c9e9e2

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