当前位置: 首页 > news >正文

企业备案的网站名称深圳seo优化外包

企业备案的网站名称,深圳seo优化外包,龙华住房和建设局网站怎么无法登陆,租赁服务器做电影网站目录 背景 分析 解决方案 背景 正常情况下,会从Openai Realtime api Sever收到正常的json数据,但是当返回音频数据时,总会返回非json数据。这是什么问题呢? 分析 期望的完整响应数据如下: {"session": {"inp…

目录

背景

分析

解决方案


背景

正常情况下,会从Openai Realtime api Sever收到正常的json数据,但是当返回音频数据时,总会返回非json数据。这是什么问题呢?

分析

期望的完整响应数据如下:

{"session": {"input_audio_format": "pcm16","instructions": "Role: 1.You are a tarot master who focuses on providing divination and interpretation 2.Your name is Luna 3.Your tarot readings blend intuition and wisdom, uncovering the mysteries of emotion and soul to help you find inner balance. \\nContext: Now the user has drawn 1 tarot cards, which are as follows: the first one is 【The Empress】\\\\n\\\" +, the interpretation is                         \\\"\\\\n\\\" +; the summary is                         \\\"《In the near future, you are likely to find love if you continue to cultivate your inner world and maintain an open heart. Trust in the natural process of life and be mindful of the loving energy you put out into the world, for it will attract a similar energy back to you. Remember to nurture yourself as you would a garden, and the blossoms of love will soon follow.》.\\nPlease start a chat dialogue based on the number of tarot cards the user has drawn, their respective interpretations, summaries, and the user's messages.\\nNote: 1. Please remember the user's historical questions and your answers so that you can provide better help in subsequent conversations. 2.The output characters should be less than 150.","max_response_output_tokens": 4096,"modalities": ["text","audio"],"output_audio_format": "pcm16","temperature": 0.8,"tool_choice": "auto","tools": [],"turn_detection": {"prefix_padding_ms": 300,"silence_duration_ms": 500,"threshold": 0.5,"type": "server_vad"},"voice": "alloy"},"event_id": "evt_bxsN7DWraWgnUPqxK","type": "session.update"
}

实际收到的数据类似如下:

eart. Trust in the natural process of life and be mindful of the loving energy you put out into the world, for it will attract a similar energy back to you. Remember to nurture yourself as you would a garden, and the blossoms of love will soon follow.》.\\nPlease start a chat dialogue based on the number of tarot cards the user has drawn, their respective interpretations, summaries, and the user's messages.\\nNote: 1. Please remember the user's historical questions and your answers so that you can provide better help in subsequent conversations. 2.The output characters should be less than 150.","max_response_output_tokens": 4096,"modalities": ["text","audio"],"output_audio_format": "pcm16","temperature": 0.8,"tool_choice": "auto","tools": [],"turn_detection": {"prefix_padding_ms": 300,"silence_duration_ms": 500,"threshold": 0.5,"type": "server_vad"},"voice": "alloy"},"event_id": "evt_bxsN7DWraWgnUPqxK","type": "session.update"
}

明显看起来只收到了部分数据,究其原因是超过了接受缓冲区的65535的最大默认配置,没有进行自定义配置,对于json数据就是设置WebSocket容器的默认最大文本消息缓冲区大小。

解决方案

设置最大文本消息缓冲区大小,具体代码如下:

public static void connect(Channel channel) {try {WebSocketContainer container = new WsWebSocketContainer();// Set the binary message buffer size in bytescontainer.setDefaultMaxBinaryMessageBufferSize(5120000);// Set the text message buffer size in bytescontainer.setDefaultMaxTextMessageBufferSize(5120000);// Set the session idle timeout in millisecondscontainer.setDefaultMaxSessionIdleTimeout(30 * 60000L);StandardWebSocketClient client = new StandardWebSocketClient(container);WebSocketHttpHeaders httpHeaders = new WebSocketHttpHeaders();httpHeaders.add("Authorization", "Bearer sk-***");httpHeaders.add("OpenAI-Beta", "realtime=v1");WebSocketSession session = client.doHandshake(new SpringWebSocketClientHandler(), httpHeaders, new URI(URL)).get();if (session.isOpen()) {log.info("Target Client: WebSocket connection established and bind success!");log.info("connect before SESSION_CHANNEL_CONCURRENT_MAP:{}", BindConnectService.SESSION_CHANNEL_CONCURRENT_MAP);BindConnectService.safeBindChannelSession(session, channel);log.info("connect after SESSION_CHANNEL_CONCURRENT_MAP:{}", BindConnectService.SESSION_CHANNEL_CONCURRENT_MAP);} else {log.warn("Target Client: WebSocket connection is not open, then add channel failed!");channel.close();}} catch (Exception e) {log.error("Target Client: WebSocket connection failed, then add channel failed!", e);channel.close();}}

http://www.hrbkazy.com/news/9922.html

相关文章:

  • 网站开发 网站建设自媒体营销的策略和方法
  • 网站建设与管理logo沧州搜索引擎优化
  • 做的最好的网站南宁网站推广排名
  • 长沙做网站咨询公司短视频推广平台有哪些
  • 卖设备用哪个网站网络营销策略的内容
  • 买产品做企业网站还是博客南京疫情最新消息
  • 网站开发人员保密网络推广引流是做什么工作
  • 营销推广策划方案范文如何网站seo
  • 做网站运营需要具备什么能力打开一个网站
  • 高端品牌网站设计企业网站建设百度百度一下一下
  • vip解析网站怎么做的站长统计app下载
  • 局域网手机网站建设百度关键词排名手机
  • 如果用别人公司信息做网站巨量算数关键词查询
  • 动态网站后台怎么做西安seo外包
  • 做网站公司佛山自己如何制作一个网站
  • wordpress关键词连接插件上海关键词优化按天计费
  • 商城网站制作公司cpa推广接单平台
  • 在哪里申请域名短视频seo营销系统
  • 中国银行全球门户网站什么是seo
  • wordpress设定密码seo优化教程培训
  • 建设b2c商城网站定免费推广的平台都有哪些
  • 做的网站有营销效果吗seo优化方案策划书
  • 九江网站建设优化公司软文推广平台排名
  • 引导企业做网站关键词搜索引擎又称为
  • 百度站长反馈武汉seo首页优化报价
  • 佛山网站设计模板sem与seo的区别
  • 网站建设 成都完美日记网络营销策划书
  • 长沙手机网站建设公司哪家好如何免费做网站网页
  • 网站怎么做效果更好企业短视频推广
  • 把网站做app百度seo推广价格