AS AgentScopeAPI 手册 / API Reference

OllamaResponse

@JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public class OllamaResponse
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:27–188

Ollama 响应,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.extensions.model.ollama.dto 包。核心成员包括 getError、setError、getModel、setModel、getCreatedAt、setCreatedAt。

Ollama chat response DTO. Represents the response from the Ollama chat API.

构造器摘要Constructor Summary

构造器Constructor说明Description
public OllamaResponse()
初始化 `OllamaResponse` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public String getError()
获取错误。
Returns the error.
public void setError(String error)
设置错误。
Sets the error.
public String getModel()
获取模型。
Returns the model.
public void setModel(String model)
设置模型。
Sets the model.
public String getCreatedAt()
获取已创建 At。
Returns the created at.
public void setCreatedAt(String createdAt)
设置已创建 At。
Sets the created at.
public OllamaMessage getMessage()
获取消息。
Returns the message.
public void setMessage(OllamaMessage message)
设置消息。
Sets the message.
public Boolean getDone()
获取 `getDone`。
Returns the done.
public void setDone(Boolean done)
设置 `setDone`。
Sets the done.
public Long getTotalDuration()
获取总数时长。
Returns the total duration.
public void setTotalDuration(Long totalDuration)
设置总数时长。
Sets the total duration.
public Long getLoadDuration()
获取加载时长。
Returns the load duration.
public void setLoadDuration(Long loadDuration)
设置加载时长。
Sets the load duration.
public Integer getPromptEvalCount()
获取提示词评估数量。
Returns the prompt eval count.
public Integer getPromptEvalCachedCount()
获取提示词评估已缓存数量。
Returns the prompt eval cached count.
public void setPromptEvalCachedCount(Integer promptEvalCachedCount)
设置提示词评估已缓存数量。
Sets the prompt eval cached count.
public void setPromptEvalCount(Integer promptEvalCount)
设置提示词评估数量。
Sets the prompt eval count.
public Long getPromptEvalDuration()
获取提示词评估时长。
Returns the prompt eval duration.
public void setPromptEvalDuration(Long promptEvalDuration)
设置提示词评估时长。
Sets the prompt eval duration.
public Integer getEvalCount()
获取评估数量。
Returns the eval count.
public void setEvalCount(Integer evalCount)
设置评估数量。
Sets the eval count.
public Long getEvalDuration()
获取评估时长。
Returns the eval duration.
public void setEvalDuration(Long evalDuration)
设置评估时长。
Sets the eval duration.
public String getDoneReason()
获取 `getDoneReason`。
Returns the done reason.
public void setDoneReason(String doneReason)
设置 `setDoneReason`。
Sets the done reason.

构造器详情Constructor Detail

OllamaResponse

public OllamaResponse()

初始化 OllamaResponse 实例。

Creates a new instance.

源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:83

方法详情Method Detail

getError

public String getError()

获取错误。

Returns the error.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:85–87

setError

public void setError(String error)

设置错误。

Sets the error.

参数Parameters
名称Name类型Type说明Description
errorString错误(类型 `String`)。The error.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:89–91

getModel

public String getModel()

获取模型。

Returns the model.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:93–95

setModel

public void setModel(String model)

设置模型。

Sets the model.

参数Parameters
名称Name类型Type说明Description
modelString模型实例(类型 `String`)。The model.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:97–99

getCreatedAt

public String getCreatedAt()

获取已创建 At。

Returns the created at.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:101–103

setCreatedAt

public void setCreatedAt(String createdAt)

设置已创建 At。

Sets the created at.

参数Parameters
名称Name类型Type说明Description
createdAtString已创建 At(类型 `String`)。The created at.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:105–107

getMessage

public OllamaMessage getMessage()

获取消息。

Returns the message.

返回Returns OllamaMessage
返回OllamaMessage。Returns Ollama message.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:109–111

setMessage

public void setMessage(OllamaMessage message)

设置消息。

Sets the message.

参数Parameters
名称Name类型Type说明Description
messageOllamaMessage消息(类型 `OllamaMessage`)。The message.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:113–115

getDone

public Boolean getDone()

获取 getDone。

Returns the done.

返回Returns Boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:117–119

setDone

public void setDone(Boolean done)

设置 setDone。

Sets the done.

参数Parameters
名称Name类型Type说明Description
doneBooleandone(类型 `Boolean`)。The done.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:121–123

getTotalDuration

public Long getTotalDuration()

获取总数时长。

Returns the total duration.

返回Returns Long
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:125–127

setTotalDuration

public void setTotalDuration(Long totalDuration)

设置总数时长。

Sets the total duration.

参数Parameters
名称Name类型Type说明Description
totalDurationLong总数时长(类型 `Long`)。The total duration.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:129–131

getLoadDuration

public Long getLoadDuration()

获取加载时长。

Returns the load duration.

返回Returns Long
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:133–135

setLoadDuration

public void setLoadDuration(Long loadDuration)

设置加载时长。

Sets the load duration.

参数Parameters
名称Name类型Type说明Description
loadDurationLong加载时长(类型 `Long`)。The load duration.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:137–139

getPromptEvalCount

public Integer getPromptEvalCount()

获取提示词评估数量。

Returns the prompt eval count.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:141–143

getPromptEvalCachedCount

public Integer getPromptEvalCachedCount()

获取提示词评估已缓存数量。

Returns the prompt eval cached count.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:145–147

setPromptEvalCachedCount

public void setPromptEvalCachedCount(Integer promptEvalCachedCount)

设置提示词评估已缓存数量。

Sets the prompt eval cached count.

参数Parameters
名称Name类型Type说明Description
promptEvalCachedCountInteger提示词评估已缓存数量(类型 `Integer`)。The prompt eval cached count.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:149–151

setPromptEvalCount

public void setPromptEvalCount(Integer promptEvalCount)

设置提示词评估数量。

Sets the prompt eval count.

参数Parameters
名称Name类型Type说明Description
promptEvalCountInteger提示词评估数量(类型 `Integer`)。The prompt eval count.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:153–155

getPromptEvalDuration

public Long getPromptEvalDuration()

获取提示词评估时长。

Returns the prompt eval duration.

返回Returns Long
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:157–159

setPromptEvalDuration

public void setPromptEvalDuration(Long promptEvalDuration)

设置提示词评估时长。

Sets the prompt eval duration.

参数Parameters
名称Name类型Type说明Description
promptEvalDurationLong提示词评估时长(类型 `Long`)。The prompt eval duration.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:161–163

getEvalCount

public Integer getEvalCount()

获取评估数量。

Returns the eval count.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:165–167

setEvalCount

public void setEvalCount(Integer evalCount)

设置评估数量。

Sets the eval count.

参数Parameters
名称Name类型Type说明Description
evalCountInteger评估数量(类型 `Integer`)。The eval count.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:169–171

getEvalDuration

public Long getEvalDuration()

获取评估时长。

Returns the eval duration.

返回Returns Long
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:173–175

setEvalDuration

public void setEvalDuration(Long evalDuration)

设置评估时长。

Sets the eval duration.

参数Parameters
名称Name类型Type说明Description
evalDurationLong评估时长(类型 `Long`)。The eval duration.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:177–179

getDoneReason

public String getDoneReason()

获取 getDoneReason。

Returns the done reason.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:181–183

setDoneReason

public void setDoneReason(String doneReason)

设置 setDoneReason。

Sets the done reason.

参数Parameters
名称Name类型Type说明Description
doneReasonStringdone 推理(类型 `String`)。The done reason.
源码Source io/agentscope/extensions/model/ollama/dto/OllamaResponse.java:185–187
基于官方固定版本源码静态生成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.