LiveKit BlingFire Bindings

1.1.0 · active · verified Sat Apr 11

livekit-blingfire provides Python bindings for the BlingFire text processing library, specifically designed to integrate with livekit-agents. It offers efficient sentence splitting and tokenization capabilities, typically used to enhance the text processing pipeline within LiveKit's AI agents. The library is part of the broader LiveKit Agents ecosystem and sees releases that often align with major livekit-agents updates, ensuring compatibility and leveraging new features.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to configure `livekit-agents` to use `BlingFireSentenceSplitter` as its default sentence splitter for LLM-related text processing. Once set, any `livekit.agents.llm` components that rely on sentence splitting will automatically use BlingFire.

from livekit.plugins.blingfire import BlingFireSentenceSplitter
from livekit.agents import llm

# Set BlingFire as the default sentence splitter for LLM operations
llm.sentence_splitter.set_splitter(BlingFireSentenceSplitter())

# Example usage of the splitter (typically used internally by agents)
text = "Hello, world! How are you doing? This is a test."
splitter = llm.sentence_splitter.get_splitter()
sentences = splitter.split(text)

for s in sentences:
    print(f"- {s}")

view raw JSON →