volc_engine_rtc_web library
RTC AIGC Plugin
火山引擎实时音视频与AIGC集成的Flutter插件,用于Web环境 支持与AI智能体进行实时对话,并收发字幕、状态和函数调用等消息
包含以下功能:
- RTC服务:实时音视频通话
- AIGC集成:与AI智能体对话
- 消息处理:支持字幕、状态、函数调用等消息类型
- 设备管理:音频输入输出设备管理
- UI组件:提供对话、字幕等UI组件
Classes
- AgentBrief
- Agent state constants matching web implementation
- AgentConfig
- AigcClient
- AIGC 客户端 - 统一管理与火山引擎API的交互
- AigcConfig
- App
- AsrConfig
- AsrProviderParams
- Audio
- AudioStatusEvent
- 音频状态变更事件
- CommandType
- Command type constants
- Config
- DeviceInfo
- 设备信息
- DeviceStateEvent
- 设备状态变更事件
- FunctionCall
- Function call details
- FunctionReturn
- Function return details
- InterruptPriority
- Interrupt priority constants
- LlmConfig
- ProviderParams
- RtcAigcMessage
- RTC AIGC消息模型
- RtcAigcPlugin
- RtcMessageType
- Message type constants matching web implementation
- RtcMessageUtils
- RTC消息工具类 - 处理TLV格式的消息和其他消息处理功能
- RtcService
- RTC服务 - 提供统一的接口用于RTC相关操作
- SubtitleEntity
- 字幕实体类
- TtsConfig
- VisionConfig
- WebUtils
- Web utilities for handling JavaScript interop and resource loading
Enums
- ActionType
- API 操作类型
- AigcClientState
- AIGC客户端状态
- COMMAND
- FunctionCallStatus
- Function call status
- MessageType
- 消息类型
- RtcConnectionState
- RTC连接状态
- RtcState
- RTC服务状态
Functions
-
aaFromJson(
String str) → AigcConfig -
AppId : "67f3871435d851017835d866"
RoomId : "room1"
TaskId :
"user1"AgentConfig : {"TargetUserId":`"user1"`,"WelcomeMessage":"你好,我是火山引擎 RTC 语音助手,有什么需要帮忙的吗?","UserId":"ChatBot01"} Config : {"LLMConfig":{"Mode":"ArkV3","EndPointId":"ep-20250401160533-rr59m","VisionConfig":{"Enable":false}},"ASRConfig":{"Provider":"volcano","ProviderParams":{"Mode":"smallmodel","AppId":"4799544484","Cluster":"volcengine_streaming_common"}},"TTSConfig":{"Provider":"volcano","ProviderParams":{"app":{"appid":"4799544484","cluster":"volcano_tts"},"audio":{"voice_type":"BV001_streaming"}}}} -
aaToJson(
AigcConfig data) → String -
agentConfigFromJson(
String str) → AgentConfig -
TargetUserId :
`"user1"`WelcomeMessage : "你好,我是火山引擎 RTC 语音助手,有什么需要帮忙的吗?" UserId : "ChatBot01" -
agentConfigToJson(
AgentConfig data) → String -
appFromJson(
String str) → App - appid : "4799544484" cluster : "volcano_tts"
-
appToJson(
App data) → String -
asrConfigFromJson(
String str) → AsrConfig - Provider : "volcano" ProviderParams : {"Mode":"smallmodel","AppId":"4799544484","Cluster":"volcengine_streaming_common"}
-
asrConfigToJson(
AsrConfig data) → String -
audioFromJson(
String str) → Audio - voice_type : "BV001_streaming"
-
audioToJson(
Audio data) → String -
configFromJson(
String str) → Config - LLMConfig : {"Mode":"ArkV3","EndPointId":"ep-20250401160533-rr59m","VisionConfig":{"Enable":false}} ASRConfig : {"Provider":"volcano","ProviderParams":{"Mode":"smallmodel","AppId":"4799544484","Cluster":"volcengine_streaming_common"}} TTSConfig : {"Provider":"volcano","ProviderParams":{"app":{"appid":"4799544484","cluster":"volcano_tts"},"audio":{"voice_type":"BV001_streaming"}}}
-
configToJson(
Config data) → String -
llmConfigFromJson(
String str) → LlmConfig - Mode : "ArkV3" EndPointId : "ep-20250401160533-rr59m" VisionConfig : {"Enable":false}
-
llmConfigToJson(
LlmConfig data) → String -
providerParamsFromJson(
String str) → ProviderParams - app : {"appid":"4799544484","cluster":"volcano_tts"} audio : {"voice_type":"BV001_streaming"}
-
providerParamsToJson(
ProviderParams data) → String -
ttsConfigFromJson(
String str) → TtsConfig - Provider : "volcano" ProviderParams : {"app":{"appid":"4799544484","cluster":"volcano_tts"},"audio":{"voice_type":"BV001_streaming"}}
-
ttsConfigToJson(
TtsConfig data) → String -
visionConfigFromJson(
String str) → VisionConfig - Enable : false
-
visionConfigToJson(
VisionConfig data) → String
Typedefs
-
RtcAudioPropertiesCallback
= void Function(Map<
String, dynamic> properties) - RTC音频属性回调
- RtcAudioStatusCallback = void Function(bool isPlaying)
- RTC音频状态回调
-
RtcAutoPlayFailedCallback
= void Function(Map<
String, dynamic> properties) - RTC自动播放失败回调
- RtcDeviceStateCallback = void Function(bool isPlaying)
- RTC设备状态回调
-
RtcFunctionCallCallback
= void Function(Map<
String, dynamic> properties) - RTC功能调用回调
- RtcMessageCallback = void Function(RtcAigcMessage message)
- RTC消息回调
-
RtcNetworkQualityCallback
= void Function(Map<
String, dynamic> properties) - RTC网络质量回调
- RtcStateCallback = void Function(RtcState state)
- RTC状态回调
-
RtcUserEventCallback
= void Function(Map<
String, dynamic> properties) - RTC用户相关事件回调
-
RtcUserPublishStreamCallback
= void Function(Map<
String, dynamic> properties) - RTC用户发布流回调
- StateChangeCallback = void Function(String state, String? message)
- 状态变更回调