AS AgentScopeAPI 手册 / API Reference

OllamaHttpException

public static class OllamaHttpException extends RuntimeException
源码Source io/agentscope/extensions/model/ollama/OllamaHttpClient.java:287–322

Ollama HTTP 异常,表示执行过程中的错误。位于 io.agentscope.extensions.model.ollama 包,继承自 RuntimeException。核心成员包括 getStatusCode、getResponseBody、OllamaHttpException。

Exception thrown when Ollama HTTP operations fail.

构造器摘要Constructor Summary

构造器Constructor说明Description
public OllamaHttpException(String message)
初始化 `OllamaHttpException` 实例。
Creates a new instance.
public OllamaHttpException(String message, Throwable cause)
初始化 `OllamaHttpException` 实例。
Creates a new instance.
public OllamaHttpException(String message, int statusCode, String responseBody)
初始化 `OllamaHttpException` 实例。
Creates a new instance.
public OllamaHttpException(String message, String errorCode, String responseBody)
初始化 `OllamaHttpException` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public Integer getStatusCode()
获取 `getStatusCode`。
Returns the status code.
public String getResponseBody()
获取响应正文。
Returns the response body.

构造器详情Constructor Detail

OllamaHttpException

public OllamaHttpException(String message)

初始化 OllamaHttpException 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
messageString消息(类型 `String`)。The message.
源码Source io/agentscope/extensions/model/ollama/OllamaHttpClient.java:291–295

OllamaHttpException

public OllamaHttpException(String message, Throwable cause)

初始化 OllamaHttpException 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
messageString消息(类型 `String`)。The message.
causeThrowablecause(类型 `Throwable`)。The cause.
源码Source io/agentscope/extensions/model/ollama/OllamaHttpClient.java:297–301

OllamaHttpException

public OllamaHttpException(String message, int statusCode, String responseBody)

初始化 OllamaHttpException 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
messageString消息(类型 `String`)。The message.
statusCodeint状态 Code(类型 `int`)。The status code.
responseBodyString响应正文(类型 `String`)。The response body.
源码Source io/agentscope/extensions/model/ollama/OllamaHttpClient.java:303–307

OllamaHttpException

public OllamaHttpException(String message, String errorCode, String responseBody)

初始化 OllamaHttpException 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
messageString消息(类型 `String`)。The message.
errorCodeString错误 Code(类型 `String`)。The error code.
responseBodyString响应正文(类型 `String`)。The response body.
源码Source io/agentscope/extensions/model/ollama/OllamaHttpClient.java:309–313

方法详情Method Detail

getStatusCode

public Integer getStatusCode()

获取 getStatusCode。

Returns the status code.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/OllamaHttpClient.java:315–317

getResponseBody

public String getResponseBody()

获取响应正文。

Returns the response body.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/model/ollama/OllamaHttpClient.java:319–321
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.