Skip to content

[Improvement] 服务端怎么向客户端广播一条消息? #1442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
121077313 opened this issue Jun 1, 2025 · 4 comments
Open

[Improvement] 服务端怎么向客户端广播一条消息? #1442

121077313 opened this issue Jun 1, 2025 · 4 comments

Comments

@121077313
Copy link

                try:
                    result = ActionResponse(
                        action=Action.RESPONSE, result=response, response=""
                    )
                    function_call_data = {
                        "name": "vision_analysis",
                        "id": f"vision_{mode}",
                        "arguments": f"mode={mode}",
                    }
                    conn._handle_function_result(result, function_call_data)
                    self.logger.bind(tag=TAG).info(f"成功广播模式 {mode} 的结果到客户端")
                except Exception as e:
                    self.logger.bind(tag=TAG).error(f"广播消息到客户端失败: {e}")

就例如我想改造vision_handler.py 在某些情况下 直接吧llm的返回结果广播给客户端,现在是我复用_handle_function_result方法,tts文本发送了 但是没有音频生成 也没有发送给客户端! @haolong886

@121077313
Copy link
Author

里面调用的tts_one_sentence正常都应该生成音频为什么这里就是不生成?是我少了什么流程吗
框架里面有没有准备广播方法

@121077313
Copy link
Author

@freshlife001 @HonestQiao @tangyiyong @Minamiyama 麻烦看下

@121077313
Copy link
Author

@openrz 请问服务端怎么向客户端广播消息 复用代码不会生成发送 也没有对应log打印

@freshlife001
Copy link
Contributor

打个日志看看 有没有被 正确添加到 tts_text_queue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants