@pipedog/core 0.0.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +25 -0
- package/NOTICE +9 -0
- package/dist/adapters/base_llm_adapter.d.ts +266 -0
- package/dist/adapters/base_llm_adapter.js +489 -0
- package/dist/adapters/index.d.ts +2 -0
- package/dist/adapters/index.js +8 -0
- package/dist/adapters/schemas/direct_function.d.ts +202 -0
- package/dist/adapters/schemas/direct_function.js +302 -0
- package/dist/adapters/schemas/function_schema.d.ts +67 -0
- package/dist/adapters/schemas/function_schema.js +72 -0
- package/dist/adapters/schemas/index.d.ts +2 -0
- package/dist/adapters/schemas/index.js +8 -0
- package/dist/adapters/schemas/tools_schema.d.ts +57 -0
- package/dist/adapters/schemas/tools_schema.js +79 -0
- package/dist/adapters/services/index.d.ts +2 -0
- package/dist/adapters/services/index.js +8 -0
- package/dist/adapters/services/open_ai_adapter.d.ts +147 -0
- package/dist/adapters/services/open_ai_adapter.js +250 -0
- package/dist/audio/dtmf/dtmf_data.d.ts +3 -0
- package/dist/audio/dtmf/dtmf_data.js +22 -0
- package/dist/audio/dtmf/index.d.ts +2 -0
- package/dist/audio/dtmf/index.js +8 -0
- package/dist/audio/dtmf/types.d.ts +31 -0
- package/dist/audio/dtmf/types.js +35 -0
- package/dist/audio/dtmf/utils.d.ts +13 -0
- package/dist/audio/dtmf/utils.js +62 -0
- package/dist/audio/filters/base_audio_filter.d.ts +51 -0
- package/dist/audio/filters/base_audio_filter.js +17 -0
- package/dist/audio/filters/index.d.ts +2 -0
- package/dist/audio/filters/index.js +8 -0
- package/dist/audio/index.d.ts +2 -0
- package/dist/audio/index.js +8 -0
- package/dist/audio/krisp_instance.d.ts +95 -0
- package/dist/audio/krisp_instance.js +229 -0
- package/dist/audio/mixers/base_audio_mixer.d.ts +56 -0
- package/dist/audio/mixers/base_audio_mixer.js +16 -0
- package/dist/audio/mixers/index.d.ts +2 -0
- package/dist/audio/mixers/index.js +8 -0
- package/dist/audio/resamplers/base_audio_resampler.d.ts +46 -0
- package/dist/audio/resamplers/base_audio_resampler.js +35 -0
- package/dist/audio/resamplers/index.d.ts +2 -0
- package/dist/audio/resamplers/index.js +8 -0
- package/dist/audio/resamplers/resampy_resampler.d.ts +10 -0
- package/dist/audio/resamplers/resampy_resampler.js +15 -0
- package/dist/audio/resamplers/soxr_resampler.d.ts +54 -0
- package/dist/audio/resamplers/soxr_resampler.js +69 -0
- package/dist/audio/resamplers/soxr_stream_resampler.d.ts +75 -0
- package/dist/audio/resamplers/soxr_stream_resampler.js +146 -0
- package/dist/audio/turn/base_turn_analyzer.d.ts +84 -0
- package/dist/audio/turn/base_turn_analyzer.js +61 -0
- package/dist/audio/turn/index.d.ts +2 -0
- package/dist/audio/turn/index.js +8 -0
- package/dist/audio/turn/smart_turn/_whisper_features.d.ts +30 -0
- package/dist/audio/turn/smart_turn/_whisper_features.js +225 -0
- package/dist/audio/turn/smart_turn/base_smart_turn.d.ts +94 -0
- package/dist/audio/turn/smart_turn/base_smart_turn.js +239 -0
- package/dist/audio/turn/smart_turn/local_smart_turn_v3.d.ts +76 -0
- package/dist/audio/turn/smart_turn/local_smart_turn_v3.js +143 -0
- package/dist/audio/utils.d.ts +224 -0
- package/dist/audio/utils.js +634 -0
- package/dist/audio/vad/data/index.d.ts +2 -0
- package/dist/audio/vad/data/index.js +8 -0
- package/dist/audio/vad/index.d.ts +2 -0
- package/dist/audio/vad/index.js +8 -0
- package/dist/audio/vad/vad_analyzer.d.ts +126 -0
- package/dist/audio/vad/vad_analyzer.js +211 -0
- package/dist/audio/vad/vad_controller.d.ts +143 -0
- package/dist/audio/vad/vad_controller.js +228 -0
- package/dist/audio/volume.d.ts +38 -0
- package/dist/audio/volume.js +75 -0
- package/dist/bus/adapters/base.d.ts +35 -0
- package/dist/bus/adapters/base.js +19 -0
- package/dist/bus/adapters/index.d.ts +10 -0
- package/dist/bus/adapters/index.js +15 -0
- package/dist/bus/adapters/llm_context_adapter.d.ts +36 -0
- package/dist/bus/adapters/llm_context_adapter.js +82 -0
- package/dist/bus/adapters/tools_schema_adapter.d.ts +25 -0
- package/dist/bus/adapters/tools_schema_adapter.js +70 -0
- package/dist/bus/bridge_processor.d.ts +111 -0
- package/dist/bus/bridge_processor.js +166 -0
- package/dist/bus/bus.d.ts +110 -0
- package/dist/bus/bus.js +200 -0
- package/dist/bus/index.d.ts +22 -0
- package/dist/bus/index.js +27 -0
- package/dist/bus/local/async_queue.d.ts +12 -0
- package/dist/bus/local/async_queue.js +21 -0
- package/dist/bus/local/index.d.ts +3 -0
- package/dist/bus/local/index.js +8 -0
- package/dist/bus/messages.d.ts +378 -0
- package/dist/bus/messages.js +357 -0
- package/dist/bus/network/index.d.ts +16 -0
- package/dist/bus/network/index.js +21 -0
- package/dist/bus/queue.d.ts +27 -0
- package/dist/bus/queue.js +51 -0
- package/dist/bus/serializers/base.d.ts +25 -0
- package/dist/bus/serializers/base.js +14 -0
- package/dist/bus/serializers/index.d.ts +9 -0
- package/dist/bus/serializers/index.js +14 -0
- package/dist/bus/serializers/json.d.ts +77 -0
- package/dist/bus/serializers/json.js +367 -0
- package/dist/bus/subscriber.d.ts +46 -0
- package/dist/bus/subscriber.js +27 -0
- package/dist/bus/ui/index.d.ts +3 -0
- package/dist/bus/ui/index.js +8 -0
- package/dist/bus/ui/messages.d.ts +186 -0
- package/dist/bus/ui/messages.js +171 -0
- package/dist/classifiers/base_classifier.d.ts +263 -0
- package/dist/classifiers/base_classifier.js +346 -0
- package/dist/classifiers/cloudflare/clef/classifier.d.ts +70 -0
- package/dist/classifiers/cloudflare/clef/classifier.js +204 -0
- package/dist/classifiers/cloudflare/clef/client.d.ts +104 -0
- package/dist/classifiers/cloudflare/clef/client.js +234 -0
- package/dist/classifiers/cloudflare/clef/index.d.ts +2 -0
- package/dist/classifiers/cloudflare/clef/index.js +8 -0
- package/dist/classifiers/cloudflare/index.d.ts +2 -0
- package/dist/classifiers/cloudflare/index.js +8 -0
- package/dist/classifiers/http_client.d.ts +70 -0
- package/dist/classifiers/http_client.js +161 -0
- package/dist/classifiers/index.d.ts +2 -0
- package/dist/classifiers/index.js +8 -0
- package/dist/classifiers/jev/classifier.d.ts +8 -0
- package/dist/classifiers/jev/classifier.js +13 -0
- package/dist/classifiers/jev/client.d.ts +8 -0
- package/dist/classifiers/jev/client.js +13 -0
- package/dist/classifiers/jev/index.d.ts +2 -0
- package/dist/classifiers/jev/index.js +8 -0
- package/dist/classifiers/llm/classifier.d.ts +72 -0
- package/dist/classifiers/llm/classifier.js +304 -0
- package/dist/classifiers/llm/index.d.ts +2 -0
- package/dist/classifiers/llm/index.js +8 -0
- package/dist/classifiers/openai/decisions/classifier.d.ts +77 -0
- package/dist/classifiers/openai/decisions/classifier.js +241 -0
- package/dist/classifiers/openai/decisions/client.d.ts +108 -0
- package/dist/classifiers/openai/decisions/client.js +234 -0
- package/dist/classifiers/openai/decisions/index.d.ts +2 -0
- package/dist/classifiers/openai/decisions/index.js +8 -0
- package/dist/classifiers/openai/index.d.ts +2 -0
- package/dist/classifiers/openai/index.js +8 -0
- package/dist/classifiers/typesafe/index.d.ts +2 -0
- package/dist/classifiers/typesafe/index.js +8 -0
- package/dist/classifiers/typesafe/jev/classifier.d.ts +70 -0
- package/dist/classifiers/typesafe/jev/classifier.js +220 -0
- package/dist/classifiers/typesafe/jev/client.d.ts +105 -0
- package/dist/classifiers/typesafe/jev/client.js +233 -0
- package/dist/classifiers/typesafe/jev/index.d.ts +2 -0
- package/dist/classifiers/typesafe/jev/index.js +8 -0
- package/dist/clocks/base_clock.d.ts +13 -0
- package/dist/clocks/base_clock.js +14 -0
- package/dist/clocks/index.d.ts +2 -0
- package/dist/clocks/index.js +8 -0
- package/dist/clocks/system_clock.d.ts +15 -0
- package/dist/clocks/system_clock.js +25 -0
- package/dist/frames/frames.d.ts +2533 -0
- package/dist/frames/frames.js +2485 -0
- package/dist/frames/index.d.ts +2 -0
- package/dist/frames/index.js +8 -0
- package/dist/frames/protobufs/frames_pb2.d.ts +229 -0
- package/dist/frames/protobufs/frames_pb2.js +466 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +56 -0
- package/dist/metrics/index.d.ts +2 -0
- package/dist/metrics/index.js +8 -0
- package/dist/metrics/metrics.d.ts +276 -0
- package/dist/metrics/metrics.js +254 -0
- package/dist/observers/base_observer.d.ts +173 -0
- package/dist/observers/base_observer.js +151 -0
- package/dist/observers/error_observer.d.ts +75 -0
- package/dist/observers/error_observer.js +87 -0
- package/dist/observers/function_call_observer.d.ts +157 -0
- package/dist/observers/function_call_observer.js +222 -0
- package/dist/observers/index.d.ts +2 -0
- package/dist/observers/index.js +8 -0
- package/dist/observers/loggers/debug_log_observer.d.ts +91 -0
- package/dist/observers/loggers/debug_log_observer.js +228 -0
- package/dist/observers/loggers/index.d.ts +2 -0
- package/dist/observers/loggers/index.js +8 -0
- package/dist/observers/loggers/llm_log_observer.d.ts +24 -0
- package/dist/observers/loggers/llm_log_observer.js +110 -0
- package/dist/observers/loggers/metrics_log_observer.d.ts +85 -0
- package/dist/observers/loggers/metrics_log_observer.js +186 -0
- package/dist/observers/loggers/transcription_log_observer.d.ts +23 -0
- package/dist/observers/loggers/transcription_log_observer.js +74 -0
- package/dist/observers/service_metrics_observer.d.ts +168 -0
- package/dist/observers/service_metrics_observer.js +236 -0
- package/dist/observers/speaking_observer.d.ts +104 -0
- package/dist/observers/speaking_observer.js +150 -0
- package/dist/observers/startup_timing_observer.d.ts +221 -0
- package/dist/observers/startup_timing_observer.js +365 -0
- package/dist/observers/turn_tracking_observer.d.ts +78 -0
- package/dist/observers/turn_tracking_observer.js +189 -0
- package/dist/observers/user_bot_latency_observer.d.ts +411 -0
- package/dist/observers/user_bot_latency_observer.js +974 -0
- package/dist/pipeline/base_pipeline.d.ts +49 -0
- package/dist/pipeline/base_pipeline.js +101 -0
- package/dist/pipeline/capabilities.d.ts +76 -0
- package/dist/pipeline/capabilities.js +97 -0
- package/dist/pipeline/index.d.ts +2 -0
- package/dist/pipeline/index.js +8 -0
- package/dist/pipeline/job_context.d.ts +317 -0
- package/dist/pipeline/job_context.js +450 -0
- package/dist/pipeline/job_decorator.d.ts +54 -0
- package/dist/pipeline/job_decorator.js +92 -0
- package/dist/pipeline/llm_switcher.d.ts +84 -0
- package/dist/pipeline/llm_switcher.js +107 -0
- package/dist/pipeline/llm_with_backend.d.ts +435 -0
- package/dist/pipeline/llm_with_backend.js +806 -0
- package/dist/pipeline/parallel_pipeline.d.ts +83 -0
- package/dist/pipeline/parallel_pipeline.js +200 -0
- package/dist/pipeline/pipeline.d.ts +126 -0
- package/dist/pipeline/pipeline.js +196 -0
- package/dist/pipeline/service_switcher.d.ts +287 -0
- package/dist/pipeline/service_switcher.js +509 -0
- package/dist/pipeline/sync_parallel_pipeline.d.ts +192 -0
- package/dist/pipeline/sync_parallel_pipeline.js +387 -0
- package/dist/pipeline/worker.d.ts +814 -0
- package/dist/pipeline/worker.js +1639 -0
- package/dist/pipeline/worker_observer.d.ts +131 -0
- package/dist/pipeline/worker_observer.js +274 -0
- package/dist/pipeline/worker_ready_decorator.d.ts +45 -0
- package/dist/pipeline/worker_ready_decorator.js +76 -0
- package/dist/processors/aggregators/async_tool_messages.d.ts +146 -0
- package/dist/processors/aggregators/async_tool_messages.js +291 -0
- package/dist/processors/aggregators/dtmf_aggregator.d.ts +61 -0
- package/dist/processors/aggregators/dtmf_aggregator.js +144 -0
- package/dist/processors/aggregators/gated.d.ts +43 -0
- package/dist/processors/aggregators/gated.js +86 -0
- package/dist/processors/aggregators/gated_llm_context.d.ts +42 -0
- package/dist/processors/aggregators/gated_llm_context.js +86 -0
- package/dist/processors/aggregators/index.d.ts +2 -0
- package/dist/processors/aggregators/index.js +8 -0
- package/dist/processors/aggregators/llm_context.d.ts +370 -0
- package/dist/processors/aggregators/llm_context.js +580 -0
- package/dist/processors/aggregators/llm_context_summarizer.d.ts +219 -0
- package/dist/processors/aggregators/llm_context_summarizer.js +447 -0
- package/dist/processors/aggregators/llm_response.d.ts +37 -0
- package/dist/processors/aggregators/llm_response.js +71 -0
- package/dist/processors/aggregators/llm_response_universal.d.ts +966 -0
- package/dist/processors/aggregators/llm_response_universal.js +2394 -0
- package/dist/processors/aggregators/llm_text_processor.d.ts +53 -0
- package/dist/processors/aggregators/llm_text_processor.js +102 -0
- package/dist/processors/aggregators/sentence.d.ts +39 -0
- package/dist/processors/aggregators/sentence.js +69 -0
- package/dist/processors/async_generator.d.ts +42 -0
- package/dist/processors/async_generator.js +76 -0
- package/dist/processors/audio/audio_buffer_processor.d.ts +241 -0
- package/dist/processors/audio/audio_buffer_processor.js +565 -0
- package/dist/processors/audio/index.d.ts +2 -0
- package/dist/processors/audio/index.js +8 -0
- package/dist/processors/audio/vad_processor.d.ts +67 -0
- package/dist/processors/audio/vad_processor.js +103 -0
- package/dist/processors/consumer_processor.d.ts +49 -0
- package/dist/processors/consumer_processor.js +85 -0
- package/dist/processors/filters/frame_filter.d.ts +39 -0
- package/dist/processors/filters/frame_filter.js +52 -0
- package/dist/processors/filters/function_filter.d.ts +59 -0
- package/dist/processors/filters/function_filter.js +78 -0
- package/dist/processors/filters/identity_filter.d.ts +33 -0
- package/dist/processors/filters/identity_filter.js +37 -0
- package/dist/processors/filters/index.d.ts +2 -0
- package/dist/processors/filters/index.js +8 -0
- package/dist/processors/filters/null_filter.d.ts +34 -0
- package/dist/processors/filters/null_filter.js +47 -0
- package/dist/processors/filters/wake_notifier_filter.d.ts +48 -0
- package/dist/processors/filters/wake_notifier_filter.js +49 -0
- package/dist/processors/frame_processor.d.ts +360 -0
- package/dist/processors/frame_processor.js +932 -0
- package/dist/processors/frameworks/index.d.ts +2 -0
- package/dist/processors/frameworks/index.js +8 -0
- package/dist/processors/frameworks/rtvi/frames.d.ts +241 -0
- package/dist/processors/frameworks/rtvi/frames.js +259 -0
- package/dist/processors/frameworks/rtvi/index.d.ts +6 -0
- package/dist/processors/frameworks/rtvi/index.js +11 -0
- package/dist/processors/frameworks/rtvi/models.d.ts +1741 -0
- package/dist/processors/frameworks/rtvi/models.js +1807 -0
- package/dist/processors/frameworks/rtvi/observer.d.ts +340 -0
- package/dist/processors/frameworks/rtvi/observer.js +1113 -0
- package/dist/processors/frameworks/rtvi/processor.d.ts +182 -0
- package/dist/processors/frameworks/rtvi/processor.js +676 -0
- package/dist/processors/idle_frame_processor.d.ts +44 -0
- package/dist/processors/idle_frame_processor.js +86 -0
- package/dist/processors/index.d.ts +2 -0
- package/dist/processors/index.js +8 -0
- package/dist/processors/logger.d.ts +42 -0
- package/dist/processors/logger.js +87 -0
- package/dist/processors/metrics/frame_processor_metrics.d.ts +172 -0
- package/dist/processors/metrics/frame_processor_metrics.js +372 -0
- package/dist/processors/metrics/index.d.ts +2 -0
- package/dist/processors/metrics/index.js +8 -0
- package/dist/processors/producer_processor.d.ts +68 -0
- package/dist/processors/producer_processor.js +78 -0
- package/dist/processors/text_transformer.d.ts +30 -0
- package/dist/processors/text_transformer.js +48 -0
- package/dist/registry/index.d.ts +3 -0
- package/dist/registry/index.js +8 -0
- package/dist/registry/registry.d.ts +69 -0
- package/dist/registry/registry.js +149 -0
- package/dist/registry/types.d.ts +47 -0
- package/dist/registry/types.js +39 -0
- package/dist/serializers/base_serializer.d.ts +94 -0
- package/dist/serializers/base_serializer.js +82 -0
- package/dist/serializers/index.d.ts +2 -0
- package/dist/serializers/index.js +8 -0
- package/dist/services/ai_service.d.ts +145 -0
- package/dist/services/ai_service.js +262 -0
- package/dist/services/anthropic/index.d.ts +2 -0
- package/dist/services/anthropic/index.js +7 -0
- package/dist/services/assemblyai/index.d.ts +2 -0
- package/dist/services/assemblyai/index.js +7 -0
- package/dist/services/asyncai/index.d.ts +2 -0
- package/dist/services/asyncai/index.js +7 -0
- package/dist/services/aws/index.d.ts +2 -0
- package/dist/services/aws/index.js +7 -0
- package/dist/services/azure/index.d.ts +2 -0
- package/dist/services/azure/index.js +7 -0
- package/dist/services/baseten/index.d.ts +2 -0
- package/dist/services/baseten/index.js +7 -0
- package/dist/services/bland/index.d.ts +2 -0
- package/dist/services/bland/index.js +7 -0
- package/dist/services/camb/index.d.ts +2 -0
- package/dist/services/camb/index.js +7 -0
- package/dist/services/cartesia/index.d.ts +2 -0
- package/dist/services/cartesia/index.js +7 -0
- package/dist/services/cerebras/index.d.ts +2 -0
- package/dist/services/cerebras/index.js +7 -0
- package/dist/services/crusoe/index.d.ts +2 -0
- package/dist/services/crusoe/index.js +7 -0
- package/dist/services/deepgram/index.d.ts +2 -0
- package/dist/services/deepgram/index.js +7 -0
- package/dist/services/deepseek/index.d.ts +2 -0
- package/dist/services/deepseek/index.js +7 -0
- package/dist/services/elevenlabs/index.d.ts +2 -0
- package/dist/services/elevenlabs/index.js +7 -0
- package/dist/services/fal/index.d.ts +2 -0
- package/dist/services/fal/index.js +7 -0
- package/dist/services/fireworks/index.d.ts +2 -0
- package/dist/services/fireworks/index.js +7 -0
- package/dist/services/fish/index.d.ts +2 -0
- package/dist/services/fish/index.js +7 -0
- package/dist/services/funasr/index.d.ts +3 -0
- package/dist/services/funasr/index.js +8 -0
- package/dist/services/gladia/index.d.ts +2 -0
- package/dist/services/gladia/index.js +7 -0
- package/dist/services/google/index.d.ts +2 -0
- package/dist/services/google/index.js +7 -0
- package/dist/services/gradium/index.d.ts +2 -0
- package/dist/services/gradium/index.js +7 -0
- package/dist/services/grok/index.d.ts +2 -0
- package/dist/services/grok/index.js +7 -0
- package/dist/services/groq/index.d.ts +2 -0
- package/dist/services/groq/index.js +7 -0
- package/dist/services/heygen/index.d.ts +2 -0
- package/dist/services/heygen/index.js +7 -0
- package/dist/services/hume/index.d.ts +2 -0
- package/dist/services/hume/index.js +7 -0
- package/dist/services/image_service.d.ts +52 -0
- package/dist/services/image_service.js +60 -0
- package/dist/services/inception/index.d.ts +2 -0
- package/dist/services/inception/index.js +7 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.js +8 -0
- package/dist/services/inworld/index.d.ts +2 -0
- package/dist/services/inworld/index.js +7 -0
- package/dist/services/keenable/index.d.ts +2 -0
- package/dist/services/keenable/index.js +7 -0
- package/dist/services/kokoro/index.d.ts +2 -0
- package/dist/services/kokoro/index.js +7 -0
- package/dist/services/llm_service.d.ts +1106 -0
- package/dist/services/llm_service.js +2231 -0
- package/dist/services/mem0/index.d.ts +2 -0
- package/dist/services/mem0/index.js +7 -0
- package/dist/services/meta/index.d.ts +2 -0
- package/dist/services/meta/index.js +7 -0
- package/dist/services/minimax/index.d.ts +2 -0
- package/dist/services/minimax/index.js +7 -0
- package/dist/services/mistral/index.d.ts +2 -0
- package/dist/services/mistral/index.js +7 -0
- package/dist/services/moondream/index.d.ts +2 -0
- package/dist/services/moondream/index.js +7 -0
- package/dist/services/moonshine/index.d.ts +2 -0
- package/dist/services/moonshine/index.js +7 -0
- package/dist/services/nebius/index.d.ts +2 -0
- package/dist/services/nebius/index.js +7 -0
- package/dist/services/neuphonic/index.d.ts +2 -0
- package/dist/services/neuphonic/index.js +7 -0
- package/dist/services/novita/index.d.ts +2 -0
- package/dist/services/novita/index.js +7 -0
- package/dist/services/nvidia/index.d.ts +2 -0
- package/dist/services/nvidia/index.js +11 -0
- package/dist/services/ollama/index.d.ts +2 -0
- package/dist/services/ollama/index.js +7 -0
- package/dist/services/openai/index.d.ts +2 -0
- package/dist/services/openai/index.js +7 -0
- package/dist/services/openclaw/index.d.ts +14 -0
- package/dist/services/openclaw/index.js +19 -0
- package/dist/services/openrouter/index.d.ts +2 -0
- package/dist/services/openrouter/index.js +7 -0
- package/dist/services/perplexity/index.d.ts +2 -0
- package/dist/services/perplexity/index.js +7 -0
- package/dist/services/piper/index.d.ts +2 -0
- package/dist/services/piper/index.js +7 -0
- package/dist/services/pocket_tts/index.d.ts +2 -0
- package/dist/services/pocket_tts/index.js +7 -0
- package/dist/services/qwen/index.d.ts +2 -0
- package/dist/services/qwen/index.js +7 -0
- package/dist/services/resembleai/index.d.ts +2 -0
- package/dist/services/resembleai/index.js +7 -0
- package/dist/services/rime/index.d.ts +2 -0
- package/dist/services/rime/index.js +7 -0
- package/dist/services/sambanova/index.d.ts +2 -0
- package/dist/services/sambanova/index.js +7 -0
- package/dist/services/sarvam/index.d.ts +2 -0
- package/dist/services/sarvam/index.js +7 -0
- package/dist/services/settings.d.ts +356 -0
- package/dist/services/settings.js +437 -0
- package/dist/services/simli/index.d.ts +2 -0
- package/dist/services/simli/index.js +7 -0
- package/dist/services/smallest/index.d.ts +2 -0
- package/dist/services/smallest/index.js +7 -0
- package/dist/services/soniox/index.d.ts +2 -0
- package/dist/services/soniox/index.js +7 -0
- package/dist/services/speechify/index.d.ts +2 -0
- package/dist/services/speechify/index.js +7 -0
- package/dist/services/speechmatics/index.d.ts +2 -0
- package/dist/services/speechmatics/index.js +7 -0
- package/dist/services/stt_latency.d.ts +62 -0
- package/dist/services/stt_latency.js +71 -0
- package/dist/services/stt_service.d.ts +601 -0
- package/dist/services/stt_service.js +1044 -0
- package/dist/services/tavus/index.d.ts +2 -0
- package/dist/services/tavus/index.js +7 -0
- package/dist/services/together/index.d.ts +2 -0
- package/dist/services/together/index.js +7 -0
- package/dist/services/tts_service.d.ts +909 -0
- package/dist/services/tts_service.js +2018 -0
- package/dist/services/ultravox/index.d.ts +2 -0
- package/dist/services/ultravox/index.js +9 -0
- package/dist/services/vision_service.d.ts +56 -0
- package/dist/services/vision_service.js +62 -0
- package/dist/services/websocket_service.d.ts +213 -0
- package/dist/services/websocket_service.js +654 -0
- package/dist/services/whisper/index.d.ts +2 -0
- package/dist/services/whisper/index.js +9 -0
- package/dist/services/xai/index.d.ts +2 -0
- package/dist/services/xai/index.js +9 -0
- package/dist/services/xtts/index.d.ts +2 -0
- package/dist/services/xtts/index.js +9 -0
- package/dist/tests/index.d.ts +2 -0
- package/dist/tests/index.js +8 -0
- package/dist/tests/utils.d.ts +123 -0
- package/dist/tests/utils.js +212 -0
- package/dist/transcriptions/index.d.ts +2 -0
- package/dist/transcriptions/index.js +8 -0
- package/dist/transcriptions/language.d.ts +376 -0
- package/dist/transcriptions/language.js +543 -0
- package/dist/transports/base_input.d.ts +149 -0
- package/dist/transports/base_input.js +338 -0
- package/dist/transports/base_output.d.ts +432 -0
- package/dist/transports/base_output.js +1231 -0
- package/dist/transports/base_transport.d.ts +223 -0
- package/dist/transports/base_transport.js +167 -0
- package/dist/transports/daily/index.d.ts +2 -0
- package/dist/transports/daily/index.js +9 -0
- package/dist/transports/heygen/index.d.ts +2 -0
- package/dist/transports/heygen/index.js +9 -0
- package/dist/transports/index.d.ts +2 -0
- package/dist/transports/index.js +8 -0
- package/dist/transports/lemonslice/index.d.ts +2 -0
- package/dist/transports/lemonslice/index.js +9 -0
- package/dist/transports/livekit/index.d.ts +2 -0
- package/dist/transports/livekit/index.js +9 -0
- package/dist/transports/local/index.d.ts +2 -0
- package/dist/transports/local/index.js +9 -0
- package/dist/transports/moq/index.d.ts +2 -0
- package/dist/transports/moq/index.js +9 -0
- package/dist/transports/smallwebrtc/index.d.ts +2 -0
- package/dist/transports/smallwebrtc/index.js +9 -0
- package/dist/transports/tavus/index.d.ts +2 -0
- package/dist/transports/tavus/index.js +9 -0
- package/dist/transports/video_in_sampler.d.ts +157 -0
- package/dist/transports/video_in_sampler.js +258 -0
- package/dist/transports/vonage/index.d.ts +2 -0
- package/dist/transports/vonage/index.js +9 -0
- package/dist/transports/websocket/index.d.ts +2 -0
- package/dist/transports/websocket/index.js +9 -0
- package/dist/transports/whatsapp/index.d.ts +2 -0
- package/dist/transports/whatsapp/index.js +9 -0
- package/dist/turns/eager_end_of_turn_mixin.d.ts +70 -0
- package/dist/turns/eager_end_of_turn_mixin.js +122 -0
- package/dist/turns/empty_user_turn.d.ts +55 -0
- package/dist/turns/empty_user_turn.js +53 -0
- package/dist/turns/index.d.ts +2 -0
- package/dist/turns/index.js +8 -0
- package/dist/turns/speculation_gate.d.ts +169 -0
- package/dist/turns/speculation_gate.js +294 -0
- package/dist/turns/types.d.ts +33 -0
- package/dist/turns/types.js +35 -0
- package/dist/turns/user_idle_controller.d.ts +94 -0
- package/dist/turns/user_idle_controller.js +187 -0
- package/dist/turns/user_mute/always_user_mute_strategy.d.ts +15 -0
- package/dist/turns/user_mute/always_user_mute_strategy.js +29 -0
- package/dist/turns/user_mute/base_user_mute_strategy.d.ts +39 -0
- package/dist/turns/user_mute/base_user_mute_strategy.js +45 -0
- package/dist/turns/user_mute/first_speech_user_mute_strategy.d.ts +28 -0
- package/dist/turns/user_mute/first_speech_user_mute_strategy.js +52 -0
- package/dist/turns/user_mute/function_call_user_mute_strategy.d.ts +25 -0
- package/dist/turns/user_mute/function_call_user_mute_strategy.js +50 -0
- package/dist/turns/user_mute/index.d.ts +6 -0
- package/dist/turns/user_mute/index.js +11 -0
- package/dist/turns/user_mute/mute_until_first_bot_complete_user_mute_strategy.d.ts +43 -0
- package/dist/turns/user_mute/mute_until_first_bot_complete_user_mute_strategy.js +76 -0
- package/dist/turns/user_start/base_user_turn_start_strategy.d.ts +135 -0
- package/dist/turns/user_start/base_user_turn_start_strategy.js +134 -0
- package/dist/turns/user_start/external_user_turn_start_strategy.d.ts +45 -0
- package/dist/turns/user_start/external_user_turn_start_strategy.js +64 -0
- package/dist/turns/user_start/index.d.ts +8 -0
- package/dist/turns/user_start/index.js +16 -0
- package/dist/turns/user_start/krisp_viva_ip_user_turn_start_strategy.d.ts +133 -0
- package/dist/turns/user_start/krisp_viva_ip_user_turn_start_strategy.js +243 -0
- package/dist/turns/user_start/min_words_user_turn_start_strategy.d.ts +60 -0
- package/dist/turns/user_start/min_words_user_turn_start_strategy.js +102 -0
- package/dist/turns/user_start/transcription_user_turn_start_strategy.d.ts +29 -0
- package/dist/turns/user_start/transcription_user_turn_start_strategy.js +43 -0
- package/dist/turns/user_start/vad_user_turn_start_strategy.d.ts +20 -0
- package/dist/turns/user_start/vad_user_turn_start_strategy.js +31 -0
- package/dist/turns/user_start/wake_phrase_user_turn_start_strategy.d.ts +141 -0
- package/dist/turns/user_start/wake_phrase_user_turn_start_strategy.js +238 -0
- package/dist/turns/user_stop/base_user_turn_stop_strategy.d.ts +174 -0
- package/dist/turns/user_stop/base_user_turn_stop_strategy.js +170 -0
- package/dist/turns/user_stop/deferred_user_turn_stop_strategy.d.ts +81 -0
- package/dist/turns/user_stop/deferred_user_turn_stop_strategy.js +107 -0
- package/dist/turns/user_stop/eager_match_policy.d.ts +36 -0
- package/dist/turns/user_stop/eager_match_policy.js +50 -0
- package/dist/turns/user_stop/eager_user_turn_stop_strategy.d.ts +84 -0
- package/dist/turns/user_stop/eager_user_turn_stop_strategy.js +154 -0
- package/dist/turns/user_stop/external_user_turn_completion_stop_strategy.d.ts +45 -0
- package/dist/turns/user_stop/external_user_turn_completion_stop_strategy.js +55 -0
- package/dist/turns/user_stop/external_user_turn_stop_strategy.d.ts +115 -0
- package/dist/turns/user_stop/external_user_turn_stop_strategy.js +205 -0
- package/dist/turns/user_stop/index.d.ts +10 -0
- package/dist/turns/user_stop/index.js +15 -0
- package/dist/turns/user_stop/llm_turn_completion_user_turn_stop_strategy.d.ts +44 -0
- package/dist/turns/user_stop/llm_turn_completion_user_turn_stop_strategy.js +59 -0
- package/dist/turns/user_stop/speech_timeout_user_turn_stop_strategy.d.ts +140 -0
- package/dist/turns/user_stop/speech_timeout_user_turn_stop_strategy.js +303 -0
- package/dist/turns/user_stop/turn_analyzer_user_turn_stop_strategy.d.ts +135 -0
- package/dist/turns/user_stop/turn_analyzer_user_turn_stop_strategy.js +332 -0
- package/dist/turns/user_turn_completion_mixin.d.ts +147 -0
- package/dist/turns/user_turn_completion_mixin.js +591 -0
- package/dist/turns/user_turn_controller.d.ts +134 -0
- package/dist/turns/user_turn_controller.js +335 -0
- package/dist/turns/user_turn_processor.d.ts +87 -0
- package/dist/turns/user_turn_processor.js +180 -0
- package/dist/turns/user_turn_strategies.d.ts +187 -0
- package/dist/turns/user_turn_strategies.js +222 -0
- package/dist/utils/async_tool_cancellation.d.ts +35 -0
- package/dist/utils/async_tool_cancellation.js +78 -0
- package/dist/utils/asyncio/index.d.ts +2 -0
- package/dist/utils/asyncio/index.js +7 -0
- package/dist/utils/asyncio/task_manager.d.ts +49 -0
- package/dist/utils/asyncio/task_manager.js +105 -0
- package/dist/utils/base_object.d.ts +76 -0
- package/dist/utils/base_object.js +154 -0
- package/dist/utils/context/aggregated_frame_sequencer.d.ts +491 -0
- package/dist/utils/context/aggregated_frame_sequencer.js +803 -0
- package/dist/utils/context/audio_context_manager.d.ts +131 -0
- package/dist/utils/context/audio_context_manager.js +233 -0
- package/dist/utils/context/index.d.ts +2 -0
- package/dist/utils/context/index.js +7 -0
- package/dist/utils/context/llm_context_summarization.d.ts +258 -0
- package/dist/utils/context/llm_context_summarization.js +511 -0
- package/dist/utils/context/text_segment_map.d.ts +611 -0
- package/dist/utils/context/text_segment_map.js +1132 -0
- package/dist/utils/context/word_completion_tracker.d.ts +273 -0
- package/dist/utils/context/word_completion_tracker.js +441 -0
- package/dist/utils/context/word_timestamp_tracker.d.ts +72 -0
- package/dist/utils/context/word_timestamp_tracker.js +98 -0
- package/dist/utils/deprecation.d.ts +28 -0
- package/dist/utils/deprecation.js +75 -0
- package/dist/utils/env.d.ts +38 -0
- package/dist/utils/env.js +62 -0
- package/dist/utils/errors.d.ts +75 -0
- package/dist/utils/errors.js +202 -0
- package/dist/utils/file_resolver.d.ts +126 -0
- package/dist/utils/file_resolver.js +314 -0
- package/dist/utils/file_storage.d.ts +99 -0
- package/dist/utils/file_storage.js +100 -0
- package/dist/utils/frame_queue.d.ts +36 -0
- package/dist/utils/frame_queue.js +66 -0
- package/dist/utils/http.d.ts +39 -0
- package/dist/utils/http.js +53 -0
- package/dist/utils/image.d.ts +15 -0
- package/dist/utils/image.js +30 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +8 -0
- package/dist/utils/log_config.d.ts +34 -0
- package/dist/utils/log_config.js +76 -0
- package/dist/utils/logger.d.ts +40 -0
- package/dist/utils/logger.js +91 -0
- package/dist/utils/mixin.d.ts +14 -0
- package/dist/utils/mixin.js +63 -0
- package/dist/utils/network.d.ts +73 -0
- package/dist/utils/network.js +90 -0
- package/dist/utils/security/allowed_origins.d.ts +16 -0
- package/dist/utils/security/allowed_origins.js +34 -0
- package/dist/utils/security/index.d.ts +2 -0
- package/dist/utils/security/index.js +7 -0
- package/dist/utils/security/redaction.d.ts +27 -0
- package/dist/utils/security/redaction.js +123 -0
- package/dist/utils/security/ssrf.d.ts +79 -0
- package/dist/utils/security/ssrf.js +327 -0
- package/dist/utils/shared.d.ts +35 -0
- package/dist/utils/shared.js +136 -0
- package/dist/utils/startup.d.ts +17 -0
- package/dist/utils/startup.js +130 -0
- package/dist/utils/string.d.ts +116 -0
- package/dist/utils/string.js +460 -0
- package/dist/utils/sync/base_notifier.d.ts +25 -0
- package/dist/utils/sync/base_notifier.js +16 -0
- package/dist/utils/sync/event_notifier.d.ts +38 -0
- package/dist/utils/sync/event_notifier.js +51 -0
- package/dist/utils/sync/index.d.ts +2 -0
- package/dist/utils/sync/index.js +7 -0
- package/dist/utils/text/alnum_utils.d.ts +109 -0
- package/dist/utils/text/alnum_utils.js +262 -0
- package/dist/utils/text/base_text_aggregator.d.ts +146 -0
- package/dist/utils/text/base_text_aggregator.js +102 -0
- package/dist/utils/text/base_text_filter.d.ts +54 -0
- package/dist/utils/text/base_text_filter.js +50 -0
- package/dist/utils/text/index.d.ts +2 -0
- package/dist/utils/text/index.js +7 -0
- package/dist/utils/text/markdown_text_filter.d.ts +147 -0
- package/dist/utils/text/markdown_text_filter.js +522 -0
- package/dist/utils/text/markup_utils.d.ts +54 -0
- package/dist/utils/text/markup_utils.js +156 -0
- package/dist/utils/text/pattern_pair_aggregator.d.ts +251 -0
- package/dist/utils/text/pattern_pair_aggregator.js +478 -0
- package/dist/utils/text/phonemes.d.ts +60 -0
- package/dist/utils/text/phonemes.js +172 -0
- package/dist/utils/text/simple_text_aggregator.d.ts +135 -0
- package/dist/utils/text/simple_text_aggregator.js +254 -0
- package/dist/utils/text/skip_tags_aggregator.d.ts +85 -0
- package/dist/utils/text/skip_tags_aggregator.js +147 -0
- package/dist/utils/text/transforms/pronunciations.d.ts +65 -0
- package/dist/utils/text/transforms/pronunciations.js +111 -0
- package/dist/utils/text/word_timestamp_utils.d.ts +26 -0
- package/dist/utils/text/word_timestamp_utils.js +52 -0
- package/dist/utils/time.d.ts +13 -0
- package/dist/utils/time.js +31 -0
- package/dist/utils/tracing/index.d.ts +3 -0
- package/dist/utils/tracing/index.js +8 -0
- package/dist/utils/tracing/service_attributes.d.ts +198 -0
- package/dist/utils/tracing/service_attributes.js +434 -0
- package/dist/utils/tracing/service_decorators.d.ts +214 -0
- package/dist/utils/tracing/service_decorators.js +1662 -0
- package/dist/utils/tracing/setup.d.ts +95 -0
- package/dist/utils/tracing/setup.js +110 -0
- package/dist/utils/tracing/tracing_context.d.ts +55 -0
- package/dist/utils/tracing/tracing_context.js +97 -0
- package/dist/utils/tracing/turn_trace_observer.d.ts +90 -0
- package/dist/utils/tracing/turn_trace_observer.js +219 -0
- package/dist/utils/types.d.ts +80 -0
- package/dist/utils/types.js +108 -0
- package/dist/utils/utils.d.ts +5 -0
- package/dist/utils/utils.js +22 -0
- package/dist/utils/yaml.d.ts +64 -0
- package/dist/utils/yaml.js +41 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.js +7 -0
- package/dist/workers/base_worker.d.ts +772 -0
- package/dist/workers/base_worker.js +1298 -0
- package/dist/workers/index.d.ts +2 -0
- package/dist/workers/index.js +8 -0
- package/dist/workers/llm/backend_llm_worker.d.ts +552 -0
- package/dist/workers/llm/backend_llm_worker.js +1055 -0
- package/dist/workers/llm/index.d.ts +6 -0
- package/dist/workers/llm/index.js +11 -0
- package/dist/workers/llm/llm_context_worker.d.ts +66 -0
- package/dist/workers/llm/llm_context_worker.js +72 -0
- package/dist/workers/llm/llm_worker.d.ts +180 -0
- package/dist/workers/llm/llm_worker.js +323 -0
- package/dist/workers/llm/tool_decorator.d.ts +68 -0
- package/dist/workers/llm/tool_decorator.js +60 -0
- package/dist/workers/runner.d.ts +268 -0
- package/dist/workers/runner.js +489 -0
- package/dist/workers/ui/index.d.ts +22 -0
- package/dist/workers/ui/index.js +27 -0
- package/dist/workers/ui/ui_event_decorator.d.ts +43 -0
- package/dist/workers/ui/ui_event_decorator.js +75 -0
- package/dist/workers/ui/ui_job_context.d.ts +12 -0
- package/dist/workers/ui/ui_job_context.js +17 -0
- package/dist/workers/ui/ui_prompts.d.ts +21 -0
- package/dist/workers/ui/ui_prompts.js +41 -0
- package/dist/workers/ui/ui_tools.d.ts +32 -0
- package/dist/workers/ui/ui_tools.js +112 -0
- package/dist/workers/ui/ui_worker.d.ts +571 -0
- package/dist/workers/ui/ui_worker.js +1156 -0
- package/package.json +46 -3
- package/README.md +0 -5
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
// Copyright (c) 2024-2026, Daily
|
|
2
|
+
// Copyright (c) 2026, pipedog contributors
|
|
3
|
+
// SPDX-License-Identifier: BSD-2-Clause
|
|
4
|
+
//
|
|
5
|
+
// Ported from pipecat: src/pipecat/observers/function_call_observer.py
|
|
6
|
+
/**
|
|
7
|
+
* Observer reporting the function calls a conversation makes.
|
|
8
|
+
*
|
|
9
|
+
* A function call is the one thing a bot does rather than says, and the part
|
|
10
|
+
* of a turn whose duration belongs to the application's own code. This
|
|
11
|
+
* observer reports a call when it starts, when it goes in progress, and when
|
|
12
|
+
* it settles, so a call that stops short of any of those reads as one still
|
|
13
|
+
* waiting rather than one that quietly stopped mattering.
|
|
14
|
+
*/
|
|
15
|
+
import { time } from "@pipedog/asyncio";
|
|
16
|
+
import { FunctionCallCancelFrame, FunctionCallInProgressFrame, FunctionCallResultFrame, FunctionCallsStartedFrame, } from "../frames/frames.js";
|
|
17
|
+
import { FrameDirection } from "../processors/frame_processor.js";
|
|
18
|
+
import { BaseObserver } from "./base_observer.js";
|
|
19
|
+
/**
|
|
20
|
+
* Where a function call has got to.
|
|
21
|
+
*
|
|
22
|
+
* A call starts when the LLM asks for it and is in progress once it is
|
|
23
|
+
* running, which are two moments rather than one: calls run one at a time
|
|
24
|
+
* unless the service was built to run them in parallel, so a call can wait
|
|
25
|
+
* in between, and a call still waiting when the conversation moves on never
|
|
26
|
+
* runs at all. A call settles in one of four ways: it returned, its handler
|
|
27
|
+
* raised, it ran past its deadline, or it was cancelled — by an
|
|
28
|
+
* interruption, or by the LLM asking for it.
|
|
29
|
+
*/
|
|
30
|
+
export const FunctionCallEventKind = {
|
|
31
|
+
STARTED: "function_call_started",
|
|
32
|
+
IN_PROGRESS: "function_call_in_progress",
|
|
33
|
+
COMPLETED: "function_call_completed",
|
|
34
|
+
FAILED: "function_call_failed",
|
|
35
|
+
TIMED_OUT: "function_call_timed_out",
|
|
36
|
+
CANCELLED: "function_call_cancelled",
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* One moment in the life of a function call.
|
|
40
|
+
*
|
|
41
|
+
* The moments that open a call describe it; the moment that settles it
|
|
42
|
+
* describes what became of it. Each names the call, so they read as a
|
|
43
|
+
* sequence without any of them repeating the others.
|
|
44
|
+
*/
|
|
45
|
+
export class FunctionCallEvent {
|
|
46
|
+
kind;
|
|
47
|
+
functionName;
|
|
48
|
+
toolCallId;
|
|
49
|
+
timestamp;
|
|
50
|
+
groupId;
|
|
51
|
+
blocking;
|
|
52
|
+
arguments;
|
|
53
|
+
startedAt;
|
|
54
|
+
inProgressAt;
|
|
55
|
+
result;
|
|
56
|
+
error;
|
|
57
|
+
constructor(options) {
|
|
58
|
+
this.kind = options.kind;
|
|
59
|
+
this.functionName = options.functionName;
|
|
60
|
+
this.toolCallId = options.toolCallId;
|
|
61
|
+
this.timestamp = options.timestamp;
|
|
62
|
+
this.groupId = options.groupId ?? null;
|
|
63
|
+
this.blocking = options.blocking ?? null;
|
|
64
|
+
this.arguments = options.arguments ?? null;
|
|
65
|
+
this.startedAt = options.startedAt ?? null;
|
|
66
|
+
this.inProgressAt = options.inProgressAt ?? null;
|
|
67
|
+
this.result = options.result ?? null;
|
|
68
|
+
this.error = options.error ?? null;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/** Remove `key` from `map` and return its value, or null (Python's `dict.pop(key, None)`). */
|
|
72
|
+
function pop(map, key) {
|
|
73
|
+
const value = map.get(key);
|
|
74
|
+
map.delete(key);
|
|
75
|
+
return value ?? null;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Reports each function call a conversation makes, from start to outcome.
|
|
79
|
+
*
|
|
80
|
+
* A call is reported at each moment it reaches rather than summarized once
|
|
81
|
+
* it is over, because the moments can be far apart and a call need not reach
|
|
82
|
+
* all of them: one waiting its turn to run is dropped if the conversation
|
|
83
|
+
* moves on, and one the conversation doesn't wait for can settle long after
|
|
84
|
+
* the turn that asked for it.
|
|
85
|
+
*
|
|
86
|
+
* Arguments and results are where a call holds whatever the conversation was
|
|
87
|
+
* about, so each is a choice: arguments travel by default, being small and
|
|
88
|
+
* the reason a call is worth reading at all, and results do not, being
|
|
89
|
+
* whatever a provider decided to return.
|
|
90
|
+
*
|
|
91
|
+
* Events:
|
|
92
|
+
*
|
|
93
|
+
* - on_function_call_event(observer, event): Emitted for each moment, as a
|
|
94
|
+
* `FunctionCallEvent`.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* const observer = new FunctionCallObserver();
|
|
98
|
+
*
|
|
99
|
+
* observer.eventHandler("on_function_call_event", async (observer, event: FunctionCallEvent) => {
|
|
100
|
+
* logger.info(JSON.stringify(event));
|
|
101
|
+
* });
|
|
102
|
+
*/
|
|
103
|
+
export class FunctionCallObserver extends BaseObserver {
|
|
104
|
+
_includeArguments;
|
|
105
|
+
_includeResults;
|
|
106
|
+
_now;
|
|
107
|
+
// When each call started and when it went in progress, so the moment that
|
|
108
|
+
// follows either can carry it.
|
|
109
|
+
_startedAt = new Map();
|
|
110
|
+
_inProgressAt = new Map();
|
|
111
|
+
constructor(options = {}) {
|
|
112
|
+
super({ ...options, observeEveryPush: false });
|
|
113
|
+
this._includeArguments = options.includeArguments ?? true;
|
|
114
|
+
this._includeResults = options.includeResults ?? false;
|
|
115
|
+
this._now = options.timeSource ?? time;
|
|
116
|
+
this._registerEventHandler("on_function_call_event");
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Report the moment a frame represents.
|
|
120
|
+
*
|
|
121
|
+
* @param data Frame push event containing the frame and direction.
|
|
122
|
+
*/
|
|
123
|
+
async onPushFrame(data) {
|
|
124
|
+
const frame = data.frame;
|
|
125
|
+
// These frames are broadcast, arriving as two frames, each pushed for the
|
|
126
|
+
// first time once. Read the downstream one.
|
|
127
|
+
if (frame.broadcastSiblingId !== null && data.direction !== FrameDirection.DOWNSTREAM) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const events = this._asEvents(frame);
|
|
131
|
+
if (events.length === 0) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
for (const event of events) {
|
|
135
|
+
await this._callEventHandler("on_function_call_event", event);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Build the moments a frame represents.
|
|
140
|
+
*
|
|
141
|
+
* One frame reports one moment, except the frame starting the calls an LLM
|
|
142
|
+
* response asked for, which reports one for each of them.
|
|
143
|
+
*
|
|
144
|
+
* @param frame The frame being pushed.
|
|
145
|
+
* @returns The moments, or an empty list if this frame is not part of a
|
|
146
|
+
* function call's life.
|
|
147
|
+
*/
|
|
148
|
+
_asEvents(frame) {
|
|
149
|
+
if (frame instanceof FunctionCallsStartedFrame) {
|
|
150
|
+
const at = this._now();
|
|
151
|
+
const events = [];
|
|
152
|
+
for (const call of frame.functionCalls) {
|
|
153
|
+
this._startedAt.set(call.toolCallId, at);
|
|
154
|
+
events.push(new FunctionCallEvent({
|
|
155
|
+
kind: FunctionCallEventKind.STARTED,
|
|
156
|
+
functionName: call.functionName,
|
|
157
|
+
toolCallId: call.toolCallId,
|
|
158
|
+
timestamp: at,
|
|
159
|
+
arguments: this._includeArguments ? call.arguments : null,
|
|
160
|
+
}));
|
|
161
|
+
}
|
|
162
|
+
return events;
|
|
163
|
+
}
|
|
164
|
+
else if (frame instanceof FunctionCallInProgressFrame) {
|
|
165
|
+
const at = this._now();
|
|
166
|
+
this._inProgressAt.set(frame.toolCallId, at);
|
|
167
|
+
return [
|
|
168
|
+
new FunctionCallEvent({
|
|
169
|
+
kind: FunctionCallEventKind.IN_PROGRESS,
|
|
170
|
+
functionName: frame.functionName,
|
|
171
|
+
toolCallId: frame.toolCallId,
|
|
172
|
+
timestamp: at,
|
|
173
|
+
groupId: frame.groupId,
|
|
174
|
+
// A call that survives an interruption is one the conversation was
|
|
175
|
+
// never waiting on.
|
|
176
|
+
blocking: frame.cancelOnInterruption,
|
|
177
|
+
arguments: this._includeArguments ? frame.arguments : null,
|
|
178
|
+
startedAt: pop(this._startedAt, frame.toolCallId),
|
|
179
|
+
}),
|
|
180
|
+
];
|
|
181
|
+
}
|
|
182
|
+
else if (frame instanceof FunctionCallResultFrame) {
|
|
183
|
+
// A call that doesn't block may report progress before it is done, and
|
|
184
|
+
// only its final result settles it.
|
|
185
|
+
if (frame.properties && !frame.properties.isFinal) {
|
|
186
|
+
return [];
|
|
187
|
+
}
|
|
188
|
+
return this._settles(frame.error ? FunctionCallEventKind.FAILED : FunctionCallEventKind.COMPLETED, frame.functionName, frame.toolCallId, {
|
|
189
|
+
result: this._includeResults && !frame.error ? frame.result : null,
|
|
190
|
+
error: frame.error,
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
else if (frame instanceof FunctionCallCancelFrame) {
|
|
194
|
+
// Inference is asked for by the deadline that settled the call, and by
|
|
195
|
+
// nothing else that cancels one.
|
|
196
|
+
const kind = frame.runLlm ? FunctionCallEventKind.TIMED_OUT : FunctionCallEventKind.CANCELLED;
|
|
197
|
+
return this._settles(kind, frame.functionName, frame.toolCallId);
|
|
198
|
+
}
|
|
199
|
+
return [];
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Record the end of a call, naming when it began running if that is known.
|
|
203
|
+
*
|
|
204
|
+
* A call that began before the observer was watching settles without that
|
|
205
|
+
* moment rather than borrowing one from another call.
|
|
206
|
+
*/
|
|
207
|
+
_settles(kind, functionName, toolCallId, options = {}) {
|
|
208
|
+
this._startedAt.delete(toolCallId);
|
|
209
|
+
return [
|
|
210
|
+
new FunctionCallEvent({
|
|
211
|
+
kind,
|
|
212
|
+
functionName,
|
|
213
|
+
toolCallId,
|
|
214
|
+
timestamp: this._now(),
|
|
215
|
+
inProgressAt: pop(this._inProgressAt, toolCallId),
|
|
216
|
+
result: options.result ?? null,
|
|
217
|
+
error: options.error ?? null,
|
|
218
|
+
}),
|
|
219
|
+
];
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
//# sourceMappingURL=function_call_observer.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Copyright (c) 2024-2026, Daily
|
|
2
|
+
// Copyright (c) 2026, pipedog contributors
|
|
3
|
+
// SPDX-License-Identifier: BSD-2-Clause
|
|
4
|
+
//
|
|
5
|
+
// Ported from pipecat: src/pipecat/observers/__init__.py
|
|
6
|
+
// Upstream's `__init__.py` is empty: import the package's modules directly.
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug logging observer for frame activity monitoring.
|
|
3
|
+
*
|
|
4
|
+
* This module provides a debug observer that logs detailed frame activity to
|
|
5
|
+
* the console, making it useful for debugging pipeline behavior and
|
|
6
|
+
* understanding frame flow between processors.
|
|
7
|
+
*/
|
|
8
|
+
import type { Frame } from "../../frames/frames.ts";
|
|
9
|
+
import { BaseObserver, type BaseObserverOptions, type FramePushed } from "../base_observer.ts";
|
|
10
|
+
/**
|
|
11
|
+
* Specifies which endpoint (source or destination) to filter on.
|
|
12
|
+
*
|
|
13
|
+
* - SOURCE: filter on the source component that is pushing the frame.
|
|
14
|
+
* - DESTINATION: filter on the destination component receiving the frame.
|
|
15
|
+
*/
|
|
16
|
+
export declare const FrameEndpoint: {
|
|
17
|
+
readonly SOURCE: 1;
|
|
18
|
+
readonly DESTINATION: 2;
|
|
19
|
+
};
|
|
20
|
+
export type FrameEndpoint = (typeof FrameEndpoint)[keyof typeof FrameEndpoint];
|
|
21
|
+
type AnyClass = abstract new (...args: any[]) => unknown;
|
|
22
|
+
export type FrameType = abstract new (...args: any[]) => Frame;
|
|
23
|
+
/** A filter configuration: null logs every instance, or `[serviceType, endpoint]`. */
|
|
24
|
+
export type FrameFilterConfig = readonly [AnyClass, FrameEndpoint] | null;
|
|
25
|
+
export interface DebugLogObserverOptions extends BaseObserverOptions {
|
|
26
|
+
/**
|
|
27
|
+
* Frame types to log. Can be:
|
|
28
|
+
*
|
|
29
|
+
* - An array of frame types to log all instances
|
|
30
|
+
* - A Map from frame types to filter configurations
|
|
31
|
+
* - null to log all frames
|
|
32
|
+
*
|
|
33
|
+
* Filter configurations can be null (log all instances) or a tuple of
|
|
34
|
+
* `[serviceType, endpoint]` to filter on specific services.
|
|
35
|
+
*/
|
|
36
|
+
frameTypes?: readonly FrameType[] | ReadonlyMap<FrameType, FrameFilterConfig> | null;
|
|
37
|
+
/**
|
|
38
|
+
* Field names to exclude from logging. Defaults to excluding binary data
|
|
39
|
+
* fields like 'audio', 'image', 'images'.
|
|
40
|
+
*/
|
|
41
|
+
excludeFields?: ReadonlySet<string> | null;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Observer that logs frame activity with detailed content to the console.
|
|
45
|
+
*
|
|
46
|
+
* Automatically extracts and formats data from any frame type, making it
|
|
47
|
+
* useful for debugging pipeline behavior without needing frame-specific
|
|
48
|
+
* observers.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* // Log all frames from all services
|
|
52
|
+
* const observers = [new DebugLogObserver()];
|
|
53
|
+
*
|
|
54
|
+
* // Log specific frame types from any source/destination
|
|
55
|
+
* const observers = [new DebugLogObserver({ frameTypes: [LLMTextFrame, TranscriptionFrame] })];
|
|
56
|
+
*
|
|
57
|
+
* // Log frames with specific source/destination filters
|
|
58
|
+
* const observers = [
|
|
59
|
+
* new DebugLogObserver({
|
|
60
|
+
* frameTypes: new Map([
|
|
61
|
+
* // Only log InterruptionFrame when source is BaseOutputTransport
|
|
62
|
+
* [InterruptionFrame, [BaseOutputTransport, FrameEndpoint.SOURCE]],
|
|
63
|
+
* // Only log UserStartedSpeakingFrame when destination is STTService
|
|
64
|
+
* [UserStartedSpeakingFrame, [STTService, FrameEndpoint.DESTINATION]],
|
|
65
|
+
* // Log LLMTextFrame regardless of source or destination type
|
|
66
|
+
* [LLMTextFrame, null],
|
|
67
|
+
* ]),
|
|
68
|
+
* }),
|
|
69
|
+
* ];
|
|
70
|
+
*/
|
|
71
|
+
export declare class DebugLogObserver extends BaseObserver {
|
|
72
|
+
frameFilters: Map<FrameType, FrameFilterConfig>;
|
|
73
|
+
excludeFields: ReadonlySet<string>;
|
|
74
|
+
/** Initialize the debug log observer. */
|
|
75
|
+
constructor(options?: DebugLogObserverOptions);
|
|
76
|
+
/** Format a value for logging. */
|
|
77
|
+
protected _formatValue(value: unknown): string;
|
|
78
|
+
/** Determine if a frame should be logged based on filters. */
|
|
79
|
+
protected _shouldLogFrame(frame: Frame, src: unknown, dst: unknown): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Process a frame being pushed into the pipeline.
|
|
82
|
+
*
|
|
83
|
+
* Logs frame details to the console with all relevant fields and values.
|
|
84
|
+
*
|
|
85
|
+
* @param data Event data containing the frame, source, destination,
|
|
86
|
+
* direction, and timestamp.
|
|
87
|
+
*/
|
|
88
|
+
onPushFrame(data: FramePushed): Promise<void>;
|
|
89
|
+
}
|
|
90
|
+
export {};
|
|
91
|
+
//# sourceMappingURL=debug_log_observer.d.ts.map
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
// Copyright (c) 2024-2026, Daily
|
|
2
|
+
// Copyright (c) 2026, pipedog contributors
|
|
3
|
+
// SPDX-License-Identifier: BSD-2-Clause
|
|
4
|
+
//
|
|
5
|
+
// Ported from pipecat: src/pipecat/observers/loggers/debug_log_observer.py
|
|
6
|
+
import { FrameDirection } from "../../processors/frame_processor.js";
|
|
7
|
+
import { logger } from "../../utils/logger.js";
|
|
8
|
+
import { BaseObserver } from "../base_observer.js";
|
|
9
|
+
/**
|
|
10
|
+
* Specifies which endpoint (source or destination) to filter on.
|
|
11
|
+
*
|
|
12
|
+
* - SOURCE: filter on the source component that is pushing the frame.
|
|
13
|
+
* - DESTINATION: filter on the destination component receiving the frame.
|
|
14
|
+
*/
|
|
15
|
+
export const FrameEndpoint = {
|
|
16
|
+
SOURCE: 1,
|
|
17
|
+
DESTINATION: 2,
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Observer that logs frame activity with detailed content to the console.
|
|
21
|
+
*
|
|
22
|
+
* Automatically extracts and formats data from any frame type, making it
|
|
23
|
+
* useful for debugging pipeline behavior without needing frame-specific
|
|
24
|
+
* observers.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* // Log all frames from all services
|
|
28
|
+
* const observers = [new DebugLogObserver()];
|
|
29
|
+
*
|
|
30
|
+
* // Log specific frame types from any source/destination
|
|
31
|
+
* const observers = [new DebugLogObserver({ frameTypes: [LLMTextFrame, TranscriptionFrame] })];
|
|
32
|
+
*
|
|
33
|
+
* // Log frames with specific source/destination filters
|
|
34
|
+
* const observers = [
|
|
35
|
+
* new DebugLogObserver({
|
|
36
|
+
* frameTypes: new Map([
|
|
37
|
+
* // Only log InterruptionFrame when source is BaseOutputTransport
|
|
38
|
+
* [InterruptionFrame, [BaseOutputTransport, FrameEndpoint.SOURCE]],
|
|
39
|
+
* // Only log UserStartedSpeakingFrame when destination is STTService
|
|
40
|
+
* [UserStartedSpeakingFrame, [STTService, FrameEndpoint.DESTINATION]],
|
|
41
|
+
* // Log LLMTextFrame regardless of source or destination type
|
|
42
|
+
* [LLMTextFrame, null],
|
|
43
|
+
* ]),
|
|
44
|
+
* }),
|
|
45
|
+
* ];
|
|
46
|
+
*/
|
|
47
|
+
export class DebugLogObserver extends BaseObserver {
|
|
48
|
+
frameFilters = new Map();
|
|
49
|
+
excludeFields;
|
|
50
|
+
/** Initialize the debug log observer. */
|
|
51
|
+
constructor(options = {}) {
|
|
52
|
+
super(options);
|
|
53
|
+
// Process frame filters
|
|
54
|
+
const frameTypes = options.frameTypes ?? null;
|
|
55
|
+
if (frameTypes !== null) {
|
|
56
|
+
if (Array.isArray(frameTypes)) {
|
|
57
|
+
// Array of frame types - log all instances
|
|
58
|
+
this.frameFilters = new Map(frameTypes.map((frameType) => [frameType, null]));
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
// Map of frame types with filters
|
|
62
|
+
this.frameFilters = new Map(frameTypes);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
// By default, exclude binary data fields that would clutter logs
|
|
66
|
+
this.excludeFields =
|
|
67
|
+
options.excludeFields ??
|
|
68
|
+
new Set([
|
|
69
|
+
"audio", // Skip binary audio data
|
|
70
|
+
"image", // Skip binary image data
|
|
71
|
+
"images", // Skip lists of images
|
|
72
|
+
]);
|
|
73
|
+
}
|
|
74
|
+
/** Format a value for logging. */
|
|
75
|
+
_formatValue(value) {
|
|
76
|
+
if (value === null || value === undefined) {
|
|
77
|
+
return "None";
|
|
78
|
+
}
|
|
79
|
+
else if (typeof value === "string") {
|
|
80
|
+
return reprStr(value);
|
|
81
|
+
}
|
|
82
|
+
else if (Array.isArray(value)) {
|
|
83
|
+
if (value.length === 0) {
|
|
84
|
+
return "[]";
|
|
85
|
+
}
|
|
86
|
+
if (isPlainObject(value[0]) && value.length > 3) {
|
|
87
|
+
// For message lists, just show count
|
|
88
|
+
return `${value.length} items`;
|
|
89
|
+
}
|
|
90
|
+
return formatList(value);
|
|
91
|
+
}
|
|
92
|
+
else if (value instanceof Uint8Array || value instanceof ArrayBuffer) {
|
|
93
|
+
return `${value.byteLength} bytes`;
|
|
94
|
+
}
|
|
95
|
+
else if (typeof value === "object" &&
|
|
96
|
+
typeof value.getMessagesForLogging === "function") {
|
|
97
|
+
// Special case for OpenAI context
|
|
98
|
+
const messages = value.getMessagesForLogging();
|
|
99
|
+
return `${value.constructor.name} with messages: ${formatAny(messages)}`;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
return formatAny(value);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/** Determine if a frame should be logged based on filters. */
|
|
106
|
+
_shouldLogFrame(frame, src, dst) {
|
|
107
|
+
// If no filters, log all frames
|
|
108
|
+
if (this.frameFilters.size === 0) {
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
// Check if this frame type is in our filters
|
|
112
|
+
for (const [frameType, filterConfig] of this.frameFilters) {
|
|
113
|
+
if (frame instanceof frameType) {
|
|
114
|
+
// If filter is null, log all instances of this frame type
|
|
115
|
+
if (filterConfig === null) {
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
// Otherwise, check the specific filter
|
|
119
|
+
const [serviceType, endpoint] = filterConfig;
|
|
120
|
+
if (endpoint === FrameEndpoint.SOURCE) {
|
|
121
|
+
return src instanceof serviceType;
|
|
122
|
+
}
|
|
123
|
+
else if (endpoint === FrameEndpoint.DESTINATION) {
|
|
124
|
+
return dst instanceof serviceType;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Process a frame being pushed into the pipeline.
|
|
132
|
+
*
|
|
133
|
+
* Logs frame details to the console with all relevant fields and values.
|
|
134
|
+
*
|
|
135
|
+
* @param data Event data containing the frame, source, destination,
|
|
136
|
+
* direction, and timestamp.
|
|
137
|
+
*/
|
|
138
|
+
async onPushFrame(data) {
|
|
139
|
+
const src = data.source;
|
|
140
|
+
const dst = data.destination;
|
|
141
|
+
const frame = data.frame;
|
|
142
|
+
const direction = data.direction;
|
|
143
|
+
const timestamp = data.timestamp;
|
|
144
|
+
// Check if we should log this frame
|
|
145
|
+
if (!this._shouldLogFrame(frame, src, dst)) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
// Format direction arrow
|
|
149
|
+
const arrow = direction === FrameDirection.DOWNSTREAM ? "→" : "←";
|
|
150
|
+
const timeSec = (timestamp / 1_000_000_000).toFixed(2);
|
|
151
|
+
const className = frame.constructor.name;
|
|
152
|
+
// Build frame representation
|
|
153
|
+
const frameDetails = [];
|
|
154
|
+
// Extract the frame's fields (its own enumerable properties, the
|
|
155
|
+
// equivalent of a dataclass's fields).
|
|
156
|
+
for (const [fieldName, value] of Object.entries(frame)) {
|
|
157
|
+
if (this.excludeFields.has(fieldName)) {
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
if (value === null || value === undefined) {
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
const formattedValue = this._formatValue(value);
|
|
164
|
+
frameDetails.push(`${fieldName}: ${formattedValue}`);
|
|
165
|
+
}
|
|
166
|
+
// Format the message
|
|
167
|
+
let message;
|
|
168
|
+
if (frameDetails.length > 0) {
|
|
169
|
+
const details = frameDetails.join(", ");
|
|
170
|
+
message = `${className} ${details} at ${timeSec}s`;
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
message = `${className} at ${timeSec}s`;
|
|
174
|
+
}
|
|
175
|
+
// Log the message
|
|
176
|
+
logger.debug(`${src} ${arrow} ${dst}: ${message}`);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/** Python's `repr()` of a string: single-quoted unless it holds only single quotes. */
|
|
180
|
+
function reprStr(s) {
|
|
181
|
+
const quote = s.includes("'") && !s.includes('"') ? '"' : "'";
|
|
182
|
+
let out = "";
|
|
183
|
+
for (const ch of s) {
|
|
184
|
+
if (ch === "\\")
|
|
185
|
+
out += "\\\\";
|
|
186
|
+
else if (ch === quote)
|
|
187
|
+
out += `\\${ch}`;
|
|
188
|
+
else if (ch === "\n")
|
|
189
|
+
out += "\\n";
|
|
190
|
+
else if (ch === "\r")
|
|
191
|
+
out += "\\r";
|
|
192
|
+
else if (ch === "\t")
|
|
193
|
+
out += "\\t";
|
|
194
|
+
else if (ch < " " || ch === "\x7f")
|
|
195
|
+
out += `\\x${ch.charCodeAt(0).toString(16).padStart(2, "0")}`;
|
|
196
|
+
else
|
|
197
|
+
out += ch;
|
|
198
|
+
}
|
|
199
|
+
return `${quote}${out}${quote}`;
|
|
200
|
+
}
|
|
201
|
+
function isPlainObject(value) {
|
|
202
|
+
if (value === null || typeof value !== "object")
|
|
203
|
+
return false;
|
|
204
|
+
const proto = Object.getPrototypeOf(value);
|
|
205
|
+
return proto === Object.prototype || proto === null;
|
|
206
|
+
}
|
|
207
|
+
/** Roughly Python's `str()`: plain data as JSON, objects through `toString()`. */
|
|
208
|
+
function formatAny(value) {
|
|
209
|
+
if (value === null || value === undefined)
|
|
210
|
+
return "None";
|
|
211
|
+
if (typeof value === "string")
|
|
212
|
+
return value;
|
|
213
|
+
if (Array.isArray(value))
|
|
214
|
+
return formatList(value);
|
|
215
|
+
if (isPlainObject(value)) {
|
|
216
|
+
try {
|
|
217
|
+
return JSON.stringify(value);
|
|
218
|
+
}
|
|
219
|
+
catch {
|
|
220
|
+
return String(value);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return String(value);
|
|
224
|
+
}
|
|
225
|
+
function formatList(values) {
|
|
226
|
+
return `[${values.map((v) => (typeof v === "string" ? reprStr(v) : formatAny(v))).join(", ")}]`;
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=debug_log_observer.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Copyright (c) 2024-2026, Daily
|
|
2
|
+
// Copyright (c) 2026, pipedog contributors
|
|
3
|
+
// SPDX-License-Identifier: BSD-2-Clause
|
|
4
|
+
//
|
|
5
|
+
// Ported from pipecat: src/pipecat/observers/loggers/__init__.py
|
|
6
|
+
// Upstream's `__init__.py` is empty: import the package's modules directly.
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseObserver, type FramePushed } from "../base_observer.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Observer to log LLM activity to the console.
|
|
4
|
+
*
|
|
5
|
+
* Logs all frame instances (only from/to LLM service) of:
|
|
6
|
+
*
|
|
7
|
+
* - LLMFullResponseStartFrame
|
|
8
|
+
* - LLMFullResponseEndFrame
|
|
9
|
+
* - LLMTextFrame
|
|
10
|
+
* - FunctionCallInProgressFrame
|
|
11
|
+
*
|
|
12
|
+
* This allows you to track when the LLM starts responding, what it generates,
|
|
13
|
+
* and when it finishes.
|
|
14
|
+
*/
|
|
15
|
+
export declare class LLMLogObserver extends BaseObserver {
|
|
16
|
+
/**
|
|
17
|
+
* Handle frame push events and log LLM-related activities.
|
|
18
|
+
*
|
|
19
|
+
* @param data The frame push event data containing source, destination,
|
|
20
|
+
* frame, direction, and timestamp information.
|
|
21
|
+
*/
|
|
22
|
+
onPushFrame(data: FramePushed): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=llm_log_observer.d.ts.map
|