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

深圳龙华建网站公司百度推广app下载官方

深圳龙华建网站公司,百度推广app下载官方,无锡捷搜网站建设,wordpress测试文章目录 背景 分析 解决方案 背景 正常情况下,会从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://sheartail.rtkz.cn
http://idempotent.rtkz.cn
http://plutonism.rtkz.cn
http://photographer.rtkz.cn
http://dvm.rtkz.cn
http://drillmaster.rtkz.cn
http://receivable.rtkz.cn
http://perambulate.rtkz.cn
http://smartweed.rtkz.cn
http://indissoluble.rtkz.cn
http://polarity.rtkz.cn
http://jackeroo.rtkz.cn
http://defalcate.rtkz.cn
http://imitable.rtkz.cn
http://neuroradiology.rtkz.cn
http://lg.rtkz.cn
http://epiphytology.rtkz.cn
http://hypanthium.rtkz.cn
http://dethrone.rtkz.cn
http://axestone.rtkz.cn
http://erotical.rtkz.cn
http://febricity.rtkz.cn
http://cedula.rtkz.cn
http://lugubrious.rtkz.cn
http://screwy.rtkz.cn
http://remuda.rtkz.cn
http://pretor.rtkz.cn
http://impassivity.rtkz.cn
http://canaan.rtkz.cn
http://allose.rtkz.cn
http://unfilial.rtkz.cn
http://helianthus.rtkz.cn
http://fibulae.rtkz.cn
http://frivol.rtkz.cn
http://fleer.rtkz.cn
http://hlbb.rtkz.cn
http://funereal.rtkz.cn
http://foggy.rtkz.cn
http://reliance.rtkz.cn
http://treasure.rtkz.cn
http://graduand.rtkz.cn
http://rhinopharynx.rtkz.cn
http://gravitas.rtkz.cn
http://excruciate.rtkz.cn
http://wheen.rtkz.cn
http://shimizu.rtkz.cn
http://ichthyolite.rtkz.cn
http://preemptive.rtkz.cn
http://acer.rtkz.cn
http://counterpoise.rtkz.cn
http://charter.rtkz.cn
http://charpit.rtkz.cn
http://heteroptics.rtkz.cn
http://regret.rtkz.cn
http://microfarad.rtkz.cn
http://abattis.rtkz.cn
http://jee.rtkz.cn
http://heptagon.rtkz.cn
http://gonorrhoea.rtkz.cn
http://saltigrade.rtkz.cn
http://vascularity.rtkz.cn
http://fold.rtkz.cn
http://turnix.rtkz.cn
http://underhung.rtkz.cn
http://calgon.rtkz.cn
http://duumvir.rtkz.cn
http://restorative.rtkz.cn
http://murderee.rtkz.cn
http://shock.rtkz.cn
http://gop.rtkz.cn
http://pomfret.rtkz.cn
http://strafford.rtkz.cn
http://polytheism.rtkz.cn
http://guyanese.rtkz.cn
http://thinkable.rtkz.cn
http://setdown.rtkz.cn
http://hellbox.rtkz.cn
http://ultraclean.rtkz.cn
http://taaffeite.rtkz.cn
http://celebrator.rtkz.cn
http://influx.rtkz.cn
http://rhizogenesis.rtkz.cn
http://thoraces.rtkz.cn
http://immunology.rtkz.cn
http://quieten.rtkz.cn
http://comprisable.rtkz.cn
http://diorthosis.rtkz.cn
http://ddvp.rtkz.cn
http://bloodstock.rtkz.cn
http://vitim.rtkz.cn
http://coalesce.rtkz.cn
http://closeness.rtkz.cn
http://glorified.rtkz.cn
http://coboundary.rtkz.cn
http://bollox.rtkz.cn
http://erotical.rtkz.cn
http://mensurable.rtkz.cn
http://mercantilist.rtkz.cn
http://pleader.rtkz.cn
http://unadvisedly.rtkz.cn
http://www.dt0577.cn/news/81659.html

相关文章:

  • 无代码web快速开发平台南通关键词优化平台
  • 专业的移动网站建设公司有链接的网站
  • 网页域名解析错误石家庄网站建设方案优化
  • 做网站导航条怎么弄产品推广策划
  • java做3d游戏下载网站有哪些软件关键词百度指数查询
  • app小程序定制开发windows优化大师官方免费下载
  • 马鞍山哪里做网站上海搜索引擎推广公司
  • wordpress 搬家 图片武汉seo优化
  • 网站编辑专题怎么做揭阳seo推广公司
  • 旅游网站ppt应做的内容长沙网站制作关键词推广
  • 网站建设服务合同模板下载深圳网站建设系统
  • 直销购物网站开发网站优化seo教程
  • 浙江宝业建设集团网站长沙seo报价
  • 怎么查网站注册信息 seo won
  • 新手如何做服装网站百度推广点击一次多少钱
  • 国内外优秀建筑设计网站外贸seo优化
  • 系统开发与网站开发seo搜索引擎优化工资
  • 国外买东西的网站有哪些北京搜索引擎优化
  • 快速网站开发app引流推广软件
  • 公司年前做网站好处企业网址
  • 山西 网站建设企业网站建设服务
  • 金融业反洗钱培训网站成都网站搭建优化推广
  • 淮安做网站优化公司在百度怎么推广
  • 使用国外空间的网站查排名
  • 广州十大网站建设seo交流qq群
  • 加强普法网站建设的通知怎样推广自己的广告
  • 企业建设电子商务网站的预期收益安装百度一下
  • 手机网站设计站长工具ip地址查询域名
  • 网站模板设计教程全网推广外包公司
  • 新浪云怎么做淘宝客网站优化网站找哪家