AS AgentScopeAPI 手册 / API Reference

GitLabBotIdentityResolver

public final class GitLabBotIdentityResolver
源码Source io/agentscope/extensions/channel/gitlab/GitLabBotIdentityResolver.java:32–89

GitLab Bot 身份解析器,把智能体接入外部消息渠道与企业平台。位于 io.agentscope.extensions.channel.gitlab 包。核心成员包括 refresh、botUserId、botUsername、GitLabBotIdentityResolver。

Resolves the bot's GitLab user id (and username) for the configured token by calling GET /user. Used for bot-loop self-detection — when a Note Hook is fired by the bot itself, the channel must drop it to avoid infinite loops.

构造器摘要Constructor Summary

构造器Constructor说明Description
public GitLabBotIdentityResolver(String apiBase, String token)
初始化 `GitLabBotIdentityResolver` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public void refresh()
执行刷新相关操作。
Synchronously attempts to resolve `GET /user` and cache the response.
public long botUserId()
返回 `botUserId` 结果。
Returns the bot's numeric user id, or `-1` if unresolved.
public String botUsername()
返回 `botUsername` 结果。
Returns the bot's username, or null if unresolved.

构造器详情Constructor Detail

GitLabBotIdentityResolver

public GitLabBotIdentityResolver(String apiBase, String token)

初始化 GitLabBotIdentityResolver 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
apiBaseStringAPI 基类(类型 `String`)。The api base.
tokenString令牌(类型 `String`)。The token.
源码Source io/agentscope/extensions/channel/gitlab/GitLabBotIdentityResolver.java:41–44

方法详情Method Detail

refresh

public void refresh()

执行刷新相关操作。

Synchronously attempts to resolve GET /user and cache the response.

源码Source io/agentscope/extensions/channel/gitlab/GitLabBotIdentityResolver.java:50–74

botUserId

public long botUserId()

返回 botUserId 结果。

Returns the bot's numeric user id, or -1 if unresolved.

返回Returns long
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/channel/gitlab/GitLabBotIdentityResolver.java:77–79

botUsername

public String botUsername()

返回 botUsername 结果。

Returns the bot's username, or null if unresolved.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/channel/gitlab/GitLabBotIdentityResolver.java:82–84
基于官方固定版本源码静态生成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.