lingllm

module
v1.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2026 License: MIT

README ยถ

LingLLM

A universal Go library for building LLM applications with support for multiple providers, tools, chains, and streaming.

Features

  • Multi-Provider Support: Unified interface for OpenAI, Anthropic, and other LLM providers
  • Tool/Function Calling: Built-in support for tool execution and management
  • Streaming: Full support for streaming responses with event-based processing
  • Chain Architecture: Composable chain-based processing pipeline for complex workflows
  • Tool Chains: Automatic tool calling and result collection with configurable rounds
  • Metrics: Built-in metrics collection for monitoring API calls and performance
  • Type-Safe: Strongly typed Go interfaces and implementations
  • Embeddings: Multi-provider text embedding (OpenAI, Ollama, Nvidia, DashScope, Local)
  • Full-Text Search: Bleve-powered search with facets, highlighting, and suggestions
  • Document Retrieval: Multi-strategy retrieval (vector, keyword, hybrid) with reranking
  • Chunking: Intelligent document chunking with multiple strategies
  • Knowledge Base: Integrated knowledge management with vector databases (Qdrant, Milvus)

Installation

go get github.com/LingByte/lingllm

Quick Start

Basic Chat
package main

import (
	"context"
	"fmt"
	"github.com/LingByte/lingllm/protocol"
)

func main() {
	// Create a chat request
	req := protocol.NewChatRequest(
		"gpt-4",
		protocol.UserMessage("What is the capital of France?"),
	)

	// Call your model implementation
	// resp, err := model.Chat(context.Background(), *req)
	// if err != nil {
	//     panic(err)
	// }
	// fmt.Println(resp.FirstContent())
}
Tool Calling
package main

import (
	"context"
	"encoding/json"
	"fmt"
	"github.com/LingByte/lingllm/protocol"
	"github.com/LingByte/lingllm/tools"
)

func main() {
	// Create a tool executor
	executor := tools.NewSimpleToolExecutor()

	// Register a tool
	weatherTool := tools.WeatherTool()
	executor.RegisterTool(weatherTool, func(args json.RawMessage) (string, error) {
		// Implement weather lookup
		return "Sunny, 72ยฐF", nil
	})

	// Create a tool chain
	toolChain := tools.NewToolChain(model, executor)
	toolChain.WithMaxRounds(5)

	// Execute with tools
	req := protocol.NewChatRequest(
		"gpt-4",
		protocol.UserMessage("What's the weather in San Francisco?"),
	)
	resp, err := toolChain.ExecuteWithTools(context.Background(), *req)
	if err != nil {
		panic(err)
	}
	fmt.Println(resp.FirstContent())
}
Streaming
package main

import (
	"context"
	"fmt"
	"io"
	"github.com/LingByte/lingllm/protocol"
)

func main() {
	req := protocol.NewChatRequest(
		"gpt-4",
		protocol.UserMessage("Write a poem about Go programming"),
	)

	stream, err := model.StreamChat(context.Background(), *req)
	if err != nil {
		panic(err)
	}
	defer stream.Close()

	for {
		chunk, err := stream.Recv()
		if err == io.EOF {
			break
		}
		if err != nil {
			panic(err)
		}
		fmt.Print(chunk.Delta)
	}
}
Chains
package main

import (
	"context"
	"github.com/LingByte/lingllm/chain"
	"github.com/LingByte/lingllm/protocol"
)

func main() {
	// Build a chain with multiple models/processors
	c := chain.NewBuilder("my-chain").
		AddModel("model1", model1).
		AddProcessor("processor1", func(ctx context.Context, resp *protocol.ChatResponse) (*protocol.ChatResponse, error) {
			// Process response
			return resp, nil
		}).
		AddModel("model2", model2).
		Build()

	req := protocol.NewChatRequest(
		"gpt-4",
		protocol.UserMessage("Hello"),
	)

	resp, err := c.Invoke(context.Background(), *req)
	if err != nil {
		panic(err)
	}
	println(resp.FirstContent())
}
Embeddings
package main

import (
	"context"
	"github.com/LingByte/lingllm/embedder"
)

func main() {
	// Create embedder with OpenAI
	cfg := &embedder.Config{
		Provider: "openai",
		Model:    "text-embedding-3-small",
		APIKey:   os.Getenv("OPENAI_API_KEY"),
	}
	
	emb, err := embedder.Create(context.Background(), cfg)
	if err != nil {
		panic(err)
	}
	defer emb.Close()

	// Single embedding
	vec, err := emb.EmbedSingle(context.Background(), "Hello world")
	if err != nil {
		panic(err)
	}
	fmt.Printf("Vector dimension: %d\n", len(vec))

	// Batch embedding
	vecs, err := emb.Embed(context.Background(), []string{
		"Hello world",
		"Goodbye world",
	})
	if err != nil {
		panic(err)
	}
	fmt.Printf("Embedded %d texts\n", len(vecs))
}
package main

import (
	"context"
	"github.com/LingByte/lingllm/search"
)

func main() {
	// Create search engine
	cfg := search.Config{
		IndexPath:           "./search_index",
		DefaultAnalyzer:     "standard",
		DefaultSearchFields: []string{"title", "body"},
	}
	
	m := search.BuildIndexMapping("standard")
	engine, err := search.New(cfg, m)
	if err != nil {
		panic(err)
	}
	defer engine.Close()

	// Index documents
	docs := []search.Doc{
		{
			ID:   "1",
			Type: "article",
			Fields: map[string]interface{}{
				"title": "Go Programming",
				"body":  "Go is a fast and efficient language",
			},
		},
	}
	engine.IndexBatch(context.Background(), docs)

	// Search
	result, err := engine.Search(context.Background(), search.SearchRequest{
		Keyword: "Go",
		Size:    10,
	})
	if err != nil {
		panic(err)
	}
	
	fmt.Printf("Found %d results\n", result.Total)
	for _, hit := range result.Hits {
		fmt.Printf("- %s (score: %.2f)\n", hit.Fields["title"], hit.Score)
	}
}
Document Retrieval
package main

import (
	"context"
	"github.com/LingByte/lingllm/retrieve"
)

func main() {
	// Create hybrid retriever
	retriever, err := retrieve.New(retrieve.Config{
		Strategy:     retrieve.StrategyHybrid,
		Vector:       vectorStore,
		Search:       searchEngine,
		TopK:         10,
		VectorWeight: 0.65,
	})
	if err != nil {
		panic(err)
	}

	// Retrieve documents
	docs, err := retriever.Retrieve(context.Background(), "machine learning", 10)
	if err != nil {
		panic(err)
	}
	
	for i, doc := range docs {
		fmt.Printf("%d. %s (score: %.2f)\n", i+1, doc.Content, doc.Score)
	}
}
Knowledge Base
package main

import (
	"context"
	"github.com/LingByte/lingllm/knowledge"
	"github.com/LingByte/lingllm/embedder"
	"github.com/LingByte/lingllm/search"
)

func main() {
	// Create embedder
	emb, _ := embedder.Create(context.Background(), &embedder.Config{
		Provider: "openai",
		Model:    "text-embedding-3-small",
		APIKey:   os.Getenv("OPENAI_API_KEY"),
	})

	// Create search engine
	searchCfg := search.Config{
		IndexPath:           "./search_index",
		DefaultSearchFields: []string{"title", "content"},
	}
	m := search.BuildIndexMapping("standard")
	searcher, _ := search.New(searchCfg, m)

	// Create vector database handler
	handler, _ := knowledge.NewKnowledgeHandler(knowledge.HandlerFactoryParams{
		Provider: knowledge.ProviderQdrant,
		QdrantConfig: &knowledge.QdrantConfig{
			BaseURL: "http://localhost:6333",
			APIKey:  "your-api-key",
		},
	})

	// Create knowledge base
	kb, _ := knowledge.NewKnowledgeBase(knowledge.KnowledgeBaseConfig{
		Handler:  handler,
		Embedder: emb,
		Searcher: searcher,
	})
	defer kb.Close()

	// Add document
	kb.AddDocument(context.Background(), "doc1", "Title", "Content...", nil)

	// Query
	results, _ := kb.Query(context.Background(), "search query", 10)
	for _, result := range results {
		fmt.Printf("%s (score: %.2f)\n", result.Record.Title, result.Score)
	}
}

Project Structure

lingllm/
โ”œโ”€โ”€ protocol/          # Core protocol definitions and interfaces
โ”‚   โ”œโ”€โ”€ types.go       # ChatRequest, ChatResponse, Message, Tool definitions
โ”‚   โ”œโ”€โ”€ factory.go     # Provider factory for creating clients
โ”‚   โ”œโ”€โ”€ stream.go      # Streaming utilities and transformers
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ tools/             # Tool execution and management
โ”‚   โ”œโ”€โ”€ tools.go       # Tool definitions, executors, and chains
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ chain/             # Chain-based processing pipeline
โ”‚   โ”œโ”€โ”€ chain.go       # Chain composition and execution
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ metrics/           # Metrics collection
โ”‚   โ””โ”€โ”€ metrics.go     # Call metrics and monitoring
โ”œโ”€โ”€ embedder/          # Text embedding providers
โ”‚   โ”œโ”€โ”€ types.go       # Core types and interfaces
โ”‚   โ”œโ”€โ”€ local.go       # Local MD5-based embedder
โ”‚   โ”œโ”€โ”€ openai.go      # OpenAI embeddings
โ”‚   โ”œโ”€โ”€ ollama.go      # Ollama local embeddings
โ”‚   โ”œโ”€โ”€ nvidia.go      # Nvidia enterprise embeddings
โ”‚   โ”œโ”€โ”€ dashscope.go   # Alibaba DashScope embeddings
โ”‚   โ”œโ”€โ”€ factory.go     # Embedder factory pattern
โ”‚   โ””โ”€โ”€ *_test.go      # Comprehensive tests (80%+ coverage)
โ”œโ”€โ”€ search/            # Full-text search engine
โ”‚   โ”œโ”€โ”€ types.go       # Search types and interfaces
โ”‚   โ”œโ”€โ”€ engine.go      # Bleve-based search engine
โ”‚   โ”œโ”€โ”€ mapping.go     # Index mapping configuration
โ”‚   โ”œโ”€โ”€ query_builder.go # Query construction
โ”‚   โ””โ”€โ”€ *_test.go      # Tests (96.1% coverage)
โ”œโ”€โ”€ retrieve/          # Multi-strategy document retrieval
โ”‚   โ”œโ”€โ”€ types.go       # Retrieval types
โ”‚   โ”œโ”€โ”€ config.go      # Configuration and factory
โ”‚   โ”œโ”€โ”€ retriever.go   # Retrieval logic
โ”‚   โ””โ”€โ”€ *_test.go      # Tests (80.6% coverage)
โ”œโ”€โ”€ chunk/             # Document chunking strategies
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ knowledge/         # Knowledge base management
โ”‚   โ”œโ”€โ”€ types.go       # Core types and interfaces
โ”‚   โ”œโ”€โ”€ integration.go # KnowledgeBase integration
โ”‚   โ”œโ”€โ”€ qdrant.go      # Qdrant vector database handler
โ”‚   โ”œโ”€โ”€ milvus.go      # Milvus vector database handler
โ”‚   โ”œโ”€โ”€ embedding.go   # Embedding client (Nvidia)
โ”‚   โ”œโ”€โ”€ doc_type_detector.go # Document type detection
โ”‚   โ”œโ”€โ”€ README.md      # Knowledge base documentation
โ”‚   โ””โ”€โ”€ *_test.go      # Tests (40+ tests)
โ”œโ”€โ”€ utils/             # Shared utilities
โ”‚   โ”œโ”€โ”€ clean.go       # Text cleaning utilities
โ”‚   โ””โ”€โ”€ *_test.go      # Tests
โ”œโ”€โ”€ shared/            # Shared utilities
โ”œโ”€โ”€ examples/          # Example implementations
โ”‚   โ”œโ”€โ”€ embedder-demo/ # Multi-provider embedding demo
โ”‚   โ”œโ”€โ”€ search-demo/   # Full-text search demo
โ”‚   โ””โ”€โ”€ ...
โ””โ”€โ”€ go.mod

Core Concepts

Protocol

The protocol package defines the core interfaces and types:

  • ChatModel: Interface for language models
  • ChatRequest: Unified request format
  • ChatResponse: Normalized response format
  • ChatStream: Streaming interface
  • Tool: Tool/function definitions
Tools

The tools package provides:

  • ToolExecutor: Interface for executing tools
  • SimpleToolExecutor: Basic implementation using function maps
  • ToolChain: Automatic tool calling with conversation management
  • ToolCallParser: Parse tool calls from model responses (ReAct, JSON formats)
Chains

The chain package enables:

  • Chain: Sequential composition of nodes
  • Node: Composable units (models, processors, stream processors)
  • Builder: Fluent API for building chains
  • ProcessingStream: Stream transformation pipeline
Metrics

The metrics package tracks:

  • API call latency
  • Token usage
  • Error rates
  • Provider-specific metrics
Embeddings

The embedder package provides multi-provider text embeddings:

  • OpenAI: High-quality embeddings (1536 dimensions)
  • Ollama: Local deployment support (384 dimensions)
  • Nvidia: Enterprise-grade embeddings (1024+ dimensions)
  • DashScope: Alibaba's native API (64-2048 dimensions)
  • Local: MD5-based deterministic embeddings (384 dimensions)

Features:

  • Unified interface across providers
  • Batch processing support
  • Configurable dimensions
  • Vector normalization
  • Factory pattern for easy provider switching

The search package provides full-text search powered by Bleve:

  • Full-Text Search: Keyword and phrase matching
  • Advanced Queries: Match, phrase, prefix, wildcard, regex, fuzzy
  • Faceted Search: Category aggregation and counting
  • Highlighting: Query term highlighting with HTML formatting
  • Suggestions: Autocomplete and search suggestions
  • Pagination: Offset-based result pagination
  • Sorting: Multi-field sorting support
Retrieval

The retrieve package implements multi-strategy document retrieval:

  • Vector Strategy: Dense vector similarity search
  • Keyword Strategy: Full-text search
  • Hybrid Strategy: Combines vector and keyword with configurable weights
  • Reranking: Optional document re-scoring
  • Min Score Filtering: Quality control for results
Knowledge Base

The knowledge package provides integrated knowledge management:

  • Multi-Backend Support: Qdrant and Milvus vector databases
  • Intelligent Chunking: Automatic document type detection and optimal chunking
  • Semantic Search: Vector-based similarity with embeddings
  • Full-Text Search: Keyword-based search integration
  • Hybrid Retrieval: Combine vector and keyword search
  • Document Management: Add, query, delete, and list documents
  • Metadata Support: Flexible metadata storage and filtering
  • Document Type Detection: Structured, Table/KV, Unstructured

Features:

  • Automatic document chunking based on type
  • Embedding generation for semantic search
  • Integration with search engines
  • Multi-tenancy with namespaces
  • Health checks and monitoring

Supported Providers

The library provides a unified interface for:

  • OpenAI (GPT-4, GPT-3.5, etc.)
  • Anthropic (Claude)
  • Local models (via compatible APIs)
  • Custom implementations

Message Types

// Create messages
msg := protocol.UserMessage("Hello")
msg := protocol.SystemMessage("You are a helpful assistant")
msg := protocol.AssistantMessage("Hi there!")
msg := protocol.ToolMessage("Result", "tool_call_id")

// Build requests
req := protocol.NewChatRequest("gpt-4", msg1, msg2, msg3)
req.WithMaxTokens(1000).
    WithTemperature(0.7).
    WithTopP(0.9).
    WithStop("END")

Error Handling

resp, err := model.Chat(ctx, req)
if err != nil {
	// Handle error
	fmt.Printf("Error: %v\n", err)
}

Configuration

Configure clients using provider-specific implementations:

// Example with environment variables
apiKey := os.Getenv("OPENAI_API_KEY")
// Create your provider-specific client

Testing

Run tests:

go test ./...

Run tests with coverage:

go test -cover ./...

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Submit a pull request

License

MIT License - see LICENSE file for details

Modules Status

โœ… Completed
  • Embedder Module (80%+ coverage)

    • 5 providers: OpenAI, Ollama, Nvidia, DashScope, Local
    • Batch processing, vector normalization
    • Comprehensive tests and demo
  • Search Module (96.1% coverage)

    • Bleve-powered full-text search
    • Advanced query types
    • Facets, highlighting, suggestions
    • 60+ tests
  • Retrieve Module (80.6% coverage)

    • 3 strategies: Vector, Keyword, Hybrid
    • Reranking support
    • 26 tests
  • Knowledge Base Module (40+ tests)

    • Multi-backend support (Qdrant, Milvus)
    • Intelligent document chunking
    • Semantic and keyword search
    • Document type detection
    • Metadata support
    • Health checks
  • Chunk Module

    • Multiple chunking strategies
    • Configurable chunk sizes
    • Overlap support
๐Ÿ“‹ Roadmap
  • Official OpenAI provider implementation
  • Official Anthropic provider implementation
  • MCP (Model Context Protocol) integration
  • Caching layer for responses and embeddings
  • Advanced prompt engineering utilities
  • Evaluation framework
  • More tool examples and templates
  • Vector database integration (Qdrant, Milvus)
  • Knowledge base management utilities
  • RAG (Retrieval-Augmented Generation) pipeline

Support

For issues, questions, or suggestions, please open an issue on GitHub.

Directories ยถ

Path Synopsis
examples
anthropic-demo command
Basic Anthropic Claude chat demo (sync + stream).
Basic Anthropic Claude chat demo (sync + stream).
chain-demo command
chunk-demo command
embedder-demo command
exutil
Package exutil provides shared helpers for example programs.
Package exutil provides shared helpers for example programs.
knowledge-demo command
memory-demo command
ollama-demo command
Basic Ollama local chat demo (sync + stream).
Basic Ollama local chat demo (sync + stream).
openai-demo command
Basic OpenAI chat demo (sync + stream).
Basic OpenAI chat demo (sync + stream).
prompt-demo command
qdrant-demo command
response-demo command
Basic OpenAI-compatible gateway chat demo (sync + stream).
Basic OpenAI-compatible gateway chat demo (sync + stream).
search-demo command
sip-outbound-demo command
SIP outbound (UAC) demo: dial a remote UAS, wait for 200 OK + ACK, then BYE.
SIP outbound (UAC) demo: dial a remote UAS, wait for 200 OK + ACK, then BYE.
sip-rtp-server command
SIP RTP media server โ€” runs separately from the signaling server.
SIP RTP media server โ€” runs separately from the signaling server.
sip-signaling-server command
SIP signaling-only server โ€” no local RTP socket.
SIP signaling-only server โ€” no local RTP socket.
sip-split/controlapi
Package controlapi defines the HTTP contract between the split SIP signaling server and one or more RTP media servers.
Package controlapi defines the HTTP contract between the split SIP signaling server and one or more RTP media servers.
sip-split/rtppool
Package rtppool routes signaling control requests across multiple RTP media nodes.
Package rtppool routes signaling control requests across multiple RTP media nodes.
sip-uas-demo command
Minimal SIP UAS demo: OPTIONS, INVITE (SDP answer), ACK, BYE over UDP.
Minimal SIP UAS demo: OPTIONS, INVITE (SDP answer), ACK, BYE over UDP.
tools-demo command
voice-demo/asr-denoise-demo command
ASR Denoiser Demo: ๆผ”็คบๅฆ‚ไฝ•ๅœจ ASR ็ฎก้“ไธญไฝฟ็”จ้™ๅ™ชๅ™จ
ASR Denoiser Demo: ๆผ”็คบๅฆ‚ไฝ•ๅœจ ASR ็ฎก้“ไธญไฝฟ็”จ้™ๅ™ชๅ™จ
voice-demo/dialogue command
Dialog WebSocket server: receives voice-plane events and streams LLM replies.
Dialog WebSocket server: receives voice-plane events and streams LLM replies.
voice-demo/realtime command
Realtime voice demo: browser (web1) or xiaozhi device โ†’ xiaozhi WS โ†’ multimodal agent.
Realtime voice demo: browser (web1) or xiaozhi device โ†’ xiaozhi WS โ†’ multimodal agent.
voice-demo/voice command
Voice media server: WebRTC browser client + xiaozhi WebSocket.
Voice media server: WebRTC browser client + xiaozhi WebSocket.
voice-demo/voiceutil
Package voiceutil wires ASR/TTS/realtime factories for voice-demo examples.
Package voiceutil wires ASR/TTS/realtime factories for voice-demo examples.
rnnoise
By default the package builds as a stub.
By default the package builds as a stub.
Package prompt provides comprehensive prompt template management for LLM applications.
Package prompt provides comprehensive prompt template management for LLM applications.
sip
Package sip provides a pure SIP/2.0 signaling stack (no RTP, no AI).
Package sip provides a pure SIP/2.0 signaling stack (no RTP, no AI).
sip/dialog
Package dialog tracks minimal SIP dialog state for pkg/sip1 (Call-ID, tags, early/confirmed).
Package dialog tracks minimal SIP dialog state for pkg/sip1 (Call-ID, tags, early/confirmed).
sip/gateway
Package gateway wires the pure SIP stack (stack + transaction + uas) into a ready-to-run UDP UAS with logrus logging.
Package gateway wires the pure SIP stack (stack + transaction + uas) into a ready-to-run UDP UAS with logrus logging.
sip/historyinfo
Package historyinfo implements RFC 7044 History-Info and RFC 5806 Diversion header processing for the SIP call-transfer / retargeting path.
Package historyinfo implements RFC 7044 History-Info and RFC 5806 Diversion header processing for the SIP call-transfer / retargeting path.
sip/hooks
Package hooks defines optional callbacks for call lifecycle and recording delivery.
Package hooks defines optional callbacks for call lifecycle and recording delivery.
sip/identity
Package identity implements RFC 3325 P-Asserted-Identity (PAI) and Privacy header processing for both outbound (UAC) and inbound (UAS) signaling paths.
Package identity implements RFC 3325 P-Asserted-Identity (PAI) and Privacy header processing for both outbound (UAC) and inbound (UAS) signaling paths.
sip/internal/siplog
Package siplog provides the shared logrus logger for protocol/sip subpackages.
Package siplog provides the shared logrus logger for protocol/sip subpackages.
sip/metrics
Package metrics is the SIP-signaling-layer observability surface.
Package metrics is the SIP-signaling-layer observability surface.
sip/observability
Package metrics is a tiny, dependency-free Prometheus exposition backend tailored to VoiceServer's needs.
Package metrics is a tiny, dependency-free Prometheus exposition backend tailored to VoiceServer's needs.
sip/outbound
Package outbound implements SIP UAC (outbound) signaling without media binding.
Package outbound implements SIP UAC (outbound) signaling without media binding.
sip/sdp
Package sdp parses and generates minimal audio SDP bodies for SIP/VoIP.
Package sdp parses and generates minimal audio SDP bodies for SIP/VoIP.
sip/session_timer
Package session_timer implements RFC 4028 Session Timers in SIP.
Package session_timer implements RFC 4028 Session Timers in SIP.
sip/signalinglog
Package signalinglog provides optional logrus hooks for SIP signaling audit trails.
Package signalinglog provides optional logrus hooks for SIP signaling audit trails.
sip/stack
Package stack is the SIP/2.0 signaling layer for pkg/sip.
Package stack is the SIP/2.0 signaling layer for pkg/sip.
sip/transaction
Package transaction provides SIP UDP transaction helpers layered under pkg/sip/stack.Endpoint.
Package transaction provides SIP UDP transaction helpers layered under pkg/sip/stack.Endpoint.
sip/transfer
Package transfer implements B2BUA-style call transfer signaling (RFC 3515 REFER + NOTIFY).
Package transfer implements B2BUA-style call transfer signaling (RFC 3515 REFER + NOTIFY).
sip/uas
Package uas registers inbound (UAS-side) SIP method handlers on stack.Endpoint using typed callbacks.
Package uas registers inbound (UAS-side) SIP method handlers on stack.Endpoint using typed callbacks.
sipmedia
Package sipmedia is the SIP RTP/audio plane, separate from pure signaling (protocol/sip).
Package sipmedia is the SIP RTP/audio plane, separate from pure signaling (protocol/sip).
sipmedia/codecreg
Package codecreg holds the SIP audio codec negotiation registry.
Package codecreg holds the SIP audio codec negotiation registry.
sipmedia/dtmf
Package dtmf decodes SIP RTP out-of-band DTMF (RFC 2833 / RFC 4733 telephone-event).
Package dtmf decodes SIP RTP out-of-band DTMF (RFC 2833 / RFC 4733 telephone-event).
sipmedia/internal/siplog
Package siplog provides the shared logrus logger for protocol/sipmedia subpackages.
Package siplog provides the shared logrus logger for protocol/sipmedia subpackages.
sipmedia/session
Package session binds pkg/sip1/rtp to pkg/media using pkg/sip1/sdp negotiation (no duplicate codec math).
Package session binds pkg/sip1/rtp to pkg/media using pkg/sip1/sdp negotiation (no duplicate codec math).
sipmedia/transferbridge
Package transferbridge wires two SIP media legs (protocol/sipmedia/session) after a signaling-only transfer (protocol/sip/transfer) completes.
Package transferbridge wires two SIP media legs (protocol/sipmedia/session) after a signaling-only transfer (protocol/sip/transfer) completes.
sse
voice
Package voice provides transport-agnostic voice capabilities for AI calls.
Package voice provides transport-agnostic voice capabilities for AI calls.
voice/siprealtime
Package siprealtime wires pkg/realtime agents into SIP RTP call legs.
Package siprealtime wires pkg/realtime agents into SIP RTP call legs.
voice/webrtc
Package webrtc terminates 1v1 WebRTC AI voice calls over HTTP SDP signaling.
Package webrtc terminates 1v1 WebRTC AI voice calls over HTTP SDP signaling.
voice/xiaozhi
Package xiaozhi implements the xiaozhi-esp32 WebSocket voice protocol.
Package xiaozhi implements the xiaozhi-esp32 WebSocket voice protocol.
shared
models
Package models defines commonly used LLM model identifier constants, grouped by vendor.
Package models defines commonly used LLM model identifier constants, grouped by vendor.
Package vad provides unified voice activity detection (VAD) interface supporting multiple providers (HTTP, WebSocket) with session management and health checks.
Package vad provides unified voice activity detection (VAD) interface supporting multiple providers (HTTP, WebSocket) with session management and health checks.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL