gpt4 book ai didi

java - Watson 语音转文本授权问题

转载 作者:行者123 更新时间:2023-12-02 10:36:19 25 4
gpt4 key购买 nike

我正在将 3 个 Watson 服务从旧帐户转移到 Lite 帐户(以避免在 12 月 1 日收费)。文本转语音和助理服务在新帐户中都工作正常,但我在使用语音转文本 (STT) 服务时收到 401 未经授权的错误。这三个 API 均使用 IAM apikey 和关联的 URL 进行实例化,如我的 IBM 控制台仪表板中所示。如果我将 STT 切换回我的旧帐户(用户名/密码凭据),它可以与其他两个 IAM 服务一起正常工作。该环境是一个基于Java Spring的网站,使用最新的watson java-sdk(6.9.1)和最新的speech-javascript-sdk。以下是日志中的相关条目:

Nov 12, 2018 1:42:13 PM okhttp3.internal.platform.Platform log INFO: --> GET https://stream.watsonplatform.net/authorization/api/%2Fv1%2Ftoken?url=https%3A%2F%2Fstream.watsonplatform.net%2Fspeech-to-text%2Fapi http/1.1

Nov 12, 2018 1:42:13 PM okhttp3.internal.platform.Platform log INFO: <-- HTTP FAILED: java.io.IOException: unexpected end of stream on Connection{stream.watsonplatform.net:443, proxy=DIRECT hostAddress=stream.watsonplatform.net/169.61.44.182:443 cipherSuite=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 protocol=http/1.1}

Nov 12, 2018 1:42:17 PM okhttp3.internal.platform.Platform log INFO: --> GET https://stream.watsonplatform.net/authorization/api/%2Fv1%2Ftoken?url=https%3A%2F%2Fstream.watsonplatform.net%2Fspeech-to-text%2Fapi http/1.1

Nov 12, 2018 1:42:17 PM okhttp3.internal.platform.Platform log INFO: <-- 301 Moved Permanently https://stream.watsonplatform.net/authorization/api/%2Fv1%2Ftoken?url=https%3A%2F%2Fstream.watsonplatform.net%2Fspeech-to-text%2Fapi (89ms, 129-byte body)

Nov 12, 2018 1:42:17 PM okhttp3.internal.platform.Platform log INFO: --> GET https://stream.watsonplatform.net/authorization/api/v1/token?url=https%3A%2F%2Fstream.watsonplatform.net%2Fspeech-to-text%2Fapi http/1.1 Nov 12, 2018 1:42:17 PM okhttp3.internal.platform.Platform log

INFO: <-- 401 Unauthorized https://stream.watsonplatform.net/authorization/api/v1/token?url=https%3A%2F%2Fstream.watsonplatform.net%2Fspeech-to-text%2Fapi (116ms, 103-byte body)

Nov 12, 2018 1:42:18 PM com.ibm.watson.developer_cloud.service.WatsonService processServiceCall SEVERE: GET https://stream.watsonplatform.net/authorization/api/v1/token?url=https%3A%2F%2Fstream.watsonplatform.net%2Fspeech-to-text%2Fapi, status: 401, error: Unauthorized

我尝试确定导致流意外结束的原因(这可能是这里的真正问题),但没有成功。为了咯咯笑,我尝试在实例化 SpeechToText 之后添加一个调用来检索 SpeechModels 列表,效果很好!非常好奇。上面最后一个错误附带的“提示”询问端点是否已设置,是的,设置正确。

非常感谢任何帮助。

最佳答案

没关系。我专注于 java 错误,并没有仔细研究等式的 javascript 方面。我在node.js sdk中发现了这个注释:

NOTE: Authenticating with the X-Watson-Authorization-Token header or the watson-token query param is now deprecated. The token continues to work with Cloud Foundry services, but is not supported for services that use Identity and Access Management (IAM) authentication.

我的旧帐户中的 STT 是一项 Cloud Foundry 服务,这就是它继续工作的原因。我很遗憾没有做更多的研究......

关于java - Watson 语音转文本授权问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53269406/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com