Enhance WebSocket session configuration by introducing an optional config.resolved event, which provides a public snapshot of the session's configuration. Update the API reference documentation to clarify the conditions under which this event is emitted and the details it includes. Modify session management to respect the new setting for emitting configuration details, ensuring sensitive information remains secure. Update tests to validate the new behavior and ensure compliance with the updated configuration schema.
This commit is contained in:
@@ -322,15 +322,17 @@
|
||||
|
||||
3. `config.resolved`
|
||||
- 关键字段:
|
||||
- `config.appId`
|
||||
- `config.channel`
|
||||
- `config.configVersionId`
|
||||
- `config.prompt.sha256`
|
||||
- `config.output`
|
||||
- `config.services`(去密钥后的有效服务配置)
|
||||
- `config.tools.allowlist`
|
||||
- `config.output.mode`
|
||||
- `config.tools.enabled`
|
||||
- `config.tools.count`
|
||||
- `config.tracks`
|
||||
- 含义:服务端最终生效配置快照,便于前端展示与排错
|
||||
- 含义:服务端公开配置快照(SaaS 安全),便于前端展示与排错
|
||||
- 发送策略:可选调试事件,默认关闭(`ws_emit_config_resolved=false`)
|
||||
- 不应返回:
|
||||
- `assistantId` / `appId` / `configVersionId`
|
||||
- `services`(provider/model/baseUrl 等内部运行细节)
|
||||
- 系统提示词原文及其它内部编排细节
|
||||
|
||||
4. `heartbeat`
|
||||
- 关键字段:无业务字段(仅 envelope)
|
||||
@@ -512,7 +514,7 @@ Client -> hello
|
||||
Server <- hello.ack
|
||||
Client -> session.start
|
||||
Server <- session.started
|
||||
Server <- config.resolved
|
||||
Server <- (optional) config.resolved
|
||||
Client -> (binary pcm frames...)
|
||||
Server <- input.speech_started / transcript.delta / transcript.final
|
||||
Server <- assistant.response.delta / assistant.response.final
|
||||
|
||||
Reference in New Issue
Block a user