简体   繁体   English

com.algorithmia.APIException:308个意外的API响应

[英]com.algorithmia.APIException: 308 unexpected API response

I'm using algorithmia, a repository of trained ML functions on the Internet. 我正在使用Algorithmia,这是Internet上经过训练的ML函数的存储库。 Few weeks ago, an issue showed up, and since then, haven't been able to figure out what's going on. 几周前,出现了一个问题,从那以后,一直无法弄清发生了什么。 I'm executing this code, which can be found on their official site. 我正在执行此代码,可以在其官方网站上找到它们。

import com.algorithmia.Algorithmia;
import com.algorithmia.AlgorithmiaClient;
import com.algorithmia.algo.AlgoResponse;
import com.algorithmia.algo.Algorithm;

public class Main {

    public static void main(String[] args) throws Exception {
        String input = "A purely peer-to-peer...";
        AlgorithmiaClient client = Algorithmia.client("api_key");
        Algorithm algo = client.algo("nlp/Summarizer/0.1.8");
        algo.setTimeout(300L, java.util.concurrent.TimeUnit.SECONDS); //optional
        AlgoResponse result = algo.pipe(input);
        System.out.println(result.asJsonString());
    }

}

But this code raises the following exception: 但是此代码引发以下异常:

Exception in thread "main" com.algorithmia.APIException: 308 unexpected API response: 
    at com.algorithmia.algo.Algorithm.pipeRequest(Algorithm.java:145)
    at com.algorithmia.algo.Algorithm.pipe(Algorithm.java:96)
    at Main.main(Main.java:13)

I want to help out 我想帮忙

  1. Create a maven project 创建一个Maven项目
  2. Add this maven dependency 添加此Maven依赖项
<dependency>
  <groupId>com.algorithmia</groupId>
  <artifactId>algorithmia-client</artifactId>
  <version>[,1.1.0)</version>
</dependency>
  1. Paste the code showed above 粘贴上面显示的代码

Further observations and guessings 进一步的观察和猜测

  • Issuing a cURL request everything works as expected 发出cURL请求,一切正常
  • Using Python works fine 使用Python可以正常工作
  • It may have something to do with HttpClient 它可能与HttpClient
  • The Java code will work with a proxy like Charles Java代码将与像Charles这样的代理一起工作
  • Refer to the opened issue on GitHub 请参阅GitHub上已打开的问题

给定当前日期,2019年7月2日,他们发布了解决此错误的版本1.0.16

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 测试导轨API绑定-无法识别的响应代码(308) - Test rail API binding - unrecognized response code (308) 带有com.google.android.gms.common.api.ApiException的Google Awareness API位置:7508 - Google Awareness API Places with com.google.android.gms.common.api.ApiException: 7508 Google Play 服务游戏无提示登录错误 &#39;com.google.android.gms.common.api.ApiException: 4:&#39; - Google play service game Silent Login error 'com.google.android.gms.common.api.ApiException: 4: ' Android Google 登录失败 com.google.android.gms.common.api.ApiException: 12500 - Android Google Sign In Failed com.google.android.gms.common.api.ApiException: 12500 谷歌玩服务游戏signInSilently()失败错误'com.google.android.gms.common.api.ApiException:4:4' - Google play service game signInSilently() FAILED error 'com.google.android.gms.common.api.ApiException: 4: 4 ' 获取自动完成预测 API 调用时出错:com.google.android.gms.common.api.ApiException: 9003: PLACES_API_ACCESS_NOT_CONFIGURED - Error getting autocomplete prediction API call: com.google.android.gms.common.api.ApiException: 9003: PLACES_API_ACCESS_NOT_CONFIGURED Unhandled Exception: PlatformException (sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null) - works well in one system - Unhandled Exception: PlatformException (sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null) - works well in one system IOException:来自远程api的意外响应 - IOException: unexpected response from remote api Twilio - com.twilio.exception.ApiException:需要升级 - Twilio - com.twilio.exception.ApiException: Upgrade Required com.google.appengine.api.datastore.DatastoreFailureException:意外失败 - com.google.appengine.api.datastore.DatastoreFailureException: Unexpected failure
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM