构造器
构造函数
client): CommunityNotesClient
创建一个新的 Community Notes 客户端实例
参数
| 名称 | 类型 | 说明 |
|---|---|---|
client | Client | X API 的主客户端实例 |
返回值
CommunityNotesClient
定义位置
方法
searchEligiblePosts
testMode, options?): Promise<Get2NotesSearchPostsEligibleForNotesResponse>
搜索符合 Community Notes 条件的 Post
返回所有符合 Community Notes 条件的 Post。
参数
| 名称 | 类型 | 描述 |
|---|---|---|
testMode | boolean | 为 true 时,返回用于测试的 Post 列表;为 false 时,返回可供机器人就该产品撰写建议性备注的 Post 列表。 |
options | SearchEligiblePostsOptions | - |
返回
Promise<Get2NotesSearchPostsEligibleForNotesResponse>
解析为 API 响应的 Promise
定义位置
searchWritten
testMode, options?): Promise<Get2NotesSearchNotesWrittenResponse>
搜索已撰写的 Community Notes
返回该用户撰写的所有 Community Notes。
参数
| 名称 | 类型 | 描述 |
|---|---|---|
testMode | boolean | 为 true 时,返回调用方为测试撰写的备注;为 false 时,返回调用方在产品上撰写的备注。 |
options | SearchWrittenOptions | - |
返回
Promise<Get2NotesSearchNotesWrittenResponse>
返回解析为 API 响应的 Promise
定义于
community_notes/client.ts:231delete
id): Promise<DeleteNoteResponse>
删除一条 Community Note
删除一条社区注释。
参数
| 名称 | 类型 | 描述 |
|---|---|---|
id | string | 要删除的社区注释的 id。 |
返回
Promise<DeleteNoteResponse>
解析为 API 响应的 Promise
定义位置
evaluate
options?): Promise<EvaluateNoteResponse>
评估一条 Community Note
用于评估 Community Note 的端点。
参数
| 名称 | 类型 |
|---|---|
options | EvaluateOptions |
返回
Promise<EvaluateNoteResponse>
解析为 API 响应的 Promise
定义于
community_notes/client.ts:329create
options?): Promise<CreateNoteResponse>
创建 Community Note
为 LLM 用例创建一个社区笔记的端点。
参数
| 名称 | 类型 |
|---|---|
options | CreateOptions |
返回
Promise<CreateNoteResponse>
最终解析为 API 响应的 Promise