AS AgentScopeAPI 手册 / API Reference

ThreadIdFactory

public final class ThreadIdFactory
源码Source io/agentscope/harness/coding/control/ThreadIdFactory.java:32–133

会话线程标识工厂,承载智能体的部署、调度与服务化运行。位于 io.agentscope.harness.coding.control 包。核心成员包括 fromGitHubIssue、fromGitHubPr、fromGitHubReviewer、fromGitHubComment、fromDingtalkConversation、fromFeishuChat。

Generates deterministic thread IDs from GitHub issue/PR/reviewer context.

SHA-256 hash of a canonical key string is converted to a UUID for uniqueness and readability.

Slack and Linear thread ID generation are deferred to a later phase.

方法摘要Method Summary

方法Method说明Description
public static String fromGitHubIssue(String owner, String repo, int issueNumber)
static
执行 `fromGitHubIssue` 方法。
Thread ID for a GitHub issue conversation.
public static String fromGitHubPr(String owner, String repo, int prNumber)
static
执行来自 GitHub Pr相关操作。
Thread ID for a GitHub PR coding session (branch-stable).
public static String fromGitHubReviewer(String owner, String repo, int prNumber)
static
执行 `fromGitHubReviewer` 方法。
Thread ID for a reviewer session on a specific PR.
public static String fromGitHubComment(String owner, String repo, int issueOrPrNumber)
static
执行 `fromGitHubComment` 方法。
Thread ID derived from a comment on a GitHub issue or PR.
public static String fromDingtalkConversation(String appKey, String conversationId)
static
用于DingTalk 会话(DM 或组)的会话线程标识。
Thread ID for a DingTalk conversation (DM or group).
public static String fromFeishuChat(String tenantKey, String chatId)
static
执行 `fromFeishuChat` 方法。
Thread ID for a Feishu/Lark chat (DM, group, or thread).

方法详情Method Detail

fromGitHubIssue

public static String fromGitHubIssue(String owner, String repo, int issueNumber)
static

执行 fromGitHubIssue 方法。

Thread ID for a GitHub issue conversation.

参数Parameters
名称Name类型Type说明Description
ownerString所有者(类型 `String`)。repo owner
repoString仓库(类型 `String`)。repo name
issueNumberintissue 数量(类型 `int`)。issue number
返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/coding/control/ThreadIdFactory.java:43–45

fromGitHubPr

public static String fromGitHubPr(String owner, String repo, int prNumber)
static

执行来自 GitHub Pr相关操作。

Thread ID for a GitHub PR coding session (branch-stable).

参数Parameters
名称Name类型Type说明Description
ownerString所有者(类型 `String`)。repo owner
repoString仓库(类型 `String`)。repo name
prNumberintpr 数量(类型 `int`)。PR number
返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/coding/control/ThreadIdFactory.java:54–56

fromGitHubReviewer

public static String fromGitHubReviewer(String owner, String repo, int prNumber)
static

执行 fromGitHubReviewer 方法。

Thread ID for a reviewer session on a specific PR.

参数Parameters
名称Name类型Type说明Description
ownerString所有者(类型 `String`)。repo owner
repoString仓库(类型 `String`)。repo name
prNumberintpr 数量(类型 `int`)。PR number
返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/coding/control/ThreadIdFactory.java:65–67

fromGitHubComment

public static String fromGitHubComment(String owner, String repo, int issueOrPrNumber)
static

执行 fromGitHubComment 方法。

Thread ID derived from a comment on a GitHub issue or PR.

参数Parameters
名称Name类型Type说明Description
ownerString所有者(类型 `String`)。repo owner
repoString仓库(类型 `String`)。repo name
issueOrPrNumberintissue 或 Pr 数量(类型 `int`)。issue/PR number
返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/coding/control/ThreadIdFactory.java:76–78

fromDingtalkConversation

public static String fromDingtalkConversation(String appKey, String conversationId)
static

用于DingTalk 会话(DM 或组)的会话线程标识。

Thread ID for a DingTalk conversation (DM or group).

参数Parameters
名称Name类型Type说明Description
appKeyString应用键(类型 `String`)。enterprise internal app key (namespaces conversation ids across tenants)
conversationIdString会话标识(类型 `String`)。DingTalk conversation id (DM senderStaffId or group openConversationId)
返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/coding/control/ThreadIdFactory.java:87–89

fromFeishuChat

public static String fromFeishuChat(String tenantKey, String chatId)
static

执行 fromFeishuChat 方法。

Thread ID for a Feishu/Lark chat (DM, group, or thread).

参数Parameters
名称Name类型Type说明Description
tenantKeyString租户键(类型 `String`)。Feishu tenant key (namespaces chat ids across tenants)
chatIdString聊天标识(类型 `String`)。Feishu chat id (`open_chat_id` for DMs/groups, `thread_id` for threaded conversations)
返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/coding/control/ThreadIdFactory.java:98–100
基于官方固定版本源码静态生成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.