-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
69 lines (56 loc) · 1.55 KB
/
__init__.py
File metadata and controls
69 lines (56 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
"""
Full-Duplex: Real-time Multimodal Streaming
A framework for bidirectional streaming communication with multimodal models (MMMs).
Provides abstractions for modeling perception and expression as concurrent streams
of symbols.
Quick Start:
from full_duplex import GeminiStream, GeminiConfig, Symbol
async with GeminiStream(GeminiConfig()) as stream:
# Send audio
await stream.send(Symbol.audio(audio_bytes))
await stream.send_end()
# Receive response
async for item in stream.receive():
if isinstance(item, Symbol):
process(item)
Core Concepts:
- Symbol: Atomic unit of perception/expression (audio chunk, text token, etc.)
- DuplexStream: Bidirectional channel for sending/receiving symbols
- StreamEvent: Lifecycle and control signals (connect, disconnect, interrupt)
Backends:
- GeminiStream: Google Gemini Live API (cloud, multimodal)
- (Future) LocalStream: Local models via llama.cpp, etc.
"""
from .stream import (
# Core types
Symbol,
StreamEvent,
StreamItem,
Modality,
# Abstract interface
DuplexStream,
DuplexSession,
# Factory type
StreamFactory,
)
from .gemini import (
GeminiStream,
GeminiConfig,
create_gemini_stream,
)
__version__ = "0.1.0"
__all__ = [
# Core types
"Symbol",
"StreamEvent",
"StreamItem",
"Modality",
# Abstract interface
"DuplexStream",
"DuplexSession",
"StreamFactory",
# Gemini backend
"GeminiStream",
"GeminiConfig",
"create_gemini_stream",
]