AS AgentScopeAPI 手册 / API Reference

CodingAgentFactory

public final class CodingAgentFactory
源码Source io/agentscope/harness/coding/agent/CodingAgentFactory.java:43–177

Coding 智能体工厂,承载智能体的部署、调度与服务化运行。位于 io.agentscope.harness.coding.agent 包。核心成员包括 create、resolveSandboxWorkingDir、resolveSandboxType、resolveSandboxImage、buildModel、resolveModelId。

Factory for the coding agent.

  • Coding-focused system prompt (workspace env, repo setup, GitHub via github_api_request)

  • Custom toolkit (http, fetch_url, web_search, github_api_request, request_pr_review)

  • Compaction for long-running sessions

  • Configurable model from environment (CODING_MODEL_ID)

  • Sandbox integration wired at phase 2

方法摘要Method Summary

方法Method说明Description
public static HarnessAgent create(Path workspace, Toolkit toolkit)
static
创建并返回实例。
Builds a coding agent for the given workspace with default settings.
public static HarnessAgent create(Path workspace, Toolkit toolkit, String linearCtx)
static
创建并返回实例。
Builds a coding agent.
public static String resolveSandboxWorkingDir()
static
解析 `resolveSandboxWorkingDir`。
Resolves the sandbox working directory inside the container.
public static String resolveSandboxType()
static
解析沙箱类型。
Returns the resolve sandbox type.
public static String resolveSandboxImage()
static
解析沙箱图像。
Returns the resolve sandbox image.
public static Model buildModel()
static
构建模型。
Builds the model from the `CODING_MODEL_ID` environment variable.
public static String resolveModelId()
static
解析模型标识。
Returns the resolve model id.

方法详情Method Detail

create

public static HarnessAgent create(Path workspace, Toolkit toolkit)
static

创建并返回实例。

Builds a coding agent for the given workspace with default settings.

参数Parameters
名称Name类型Type说明Description
workspacePath工作区(类型 `Path`)。The workspace.
toolkitToolkit工具包(类型 `Toolkit`)。The toolkit.
返回Returns HarnessAgent
返回HarnessAgent。Returns harness agent.
源码Source io/agentscope/harness/coding/agent/CodingAgentFactory.java:48–50

create

public static HarnessAgent create(Path workspace, Toolkit toolkit, String linearCtx)
static

创建并返回实例。

Builds a coding agent.

参数Parameters
名称Name类型Type说明Description
workspacePath工作区(类型 `Path`)。agent workspace directory
toolkitToolkit工具包(类型 `Toolkit`)。custom tools registered for the coding agent
linearCtxStringlinear Ctx(类型 `String`)。optional Linear context string (may be null — deferred)
返回Returns HarnessAgent
返回HarnessAgent。Returns harness agent.
源码Source io/agentscope/harness/coding/agent/CodingAgentFactory.java:59–90

resolveSandboxWorkingDir

public static String resolveSandboxWorkingDir()
static

解析 resolveSandboxWorkingDir。

Resolves the sandbox working directory inside the container.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/coding/agent/CodingAgentFactory.java:93–96

resolveSandboxType

public static String resolveSandboxType()
static

解析沙箱类型。

Returns the resolve sandbox type.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/coding/agent/CodingAgentFactory.java:98–101

resolveSandboxImage

public static String resolveSandboxImage()
static

解析沙箱图像。

Returns the resolve sandbox image.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/coding/agent/CodingAgentFactory.java:103–106

buildModel

public static Model buildModel()
static

构建模型。

Builds the model from the CODING_MODEL_ID environment variable.

返回Returns Model
返回模型。Returns model.
源码Source io/agentscope/harness/coding/agent/CodingAgentFactory.java:121–128

resolveModelId

public static String resolveModelId()
static

解析模型标识。

Returns the resolve model id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/coding/agent/CodingAgentFactory.java:161–164
基于官方固定版本源码静态生成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.