AddContexts - 写入上下文

更新时间:
复制 MD 格式

写入上下文

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

当前API暂无授权信息透出。

请求语法

POST /workspace/{workspace}/contextstore/{contextStoreName}/context HTTP/1.1

路径参数

名称

类型

必填

描述

示例值

workspace

string

工作空间 ID

workspace-test

contextStoreName

string

上下文库名称

test-context-store

请求参数

名称

类型

必填

描述

示例值

body

object

请求 Body

contextType

string

上下文类型

memory

memoryType

string

记忆类型

short

items

array<object>

上下文信息

array<object>

上下文信息

messages

array<object>

消息

object

消息

any

消息

{"content":"xxxx","role":"xxxx"}

content

string

内容

You are a conversation assistant.

userId

string

用户 Id

test_user_001

agentId

string

应用的 agentId

952730733889060865

appId

string

应用 Id

mm_480d961a1b5e4efe84603f4cbc0f

runId

string

运行 id

jr-80ded1d6953c64ea

labels

object

标签

string

标签

{"key":"xxxx","value":"xxxx"}

metadata

object

元数据

{"sessionId":"test_session_001"}

infer

boolean

推断

true

customInstructions

string

自定义指令

Your custom instructions here

timestamp

integer

时间戳

1774578167

categories

array

分类

string

分类

[]

immutable

boolean

可变属性

true

expirationDate

string

过期时间

1731231212334396

triggerCondition

string

触发条件

Identify and troubleshoot SLs issues

experience

object

经验

{ "taskType": "troubleshooting", "complexity": "medium", "confidence": 0.95 }

返回参数

名称

类型

描述

示例值

object

响应数据

requestId

string

请求 Id

0B9377D9-C56B-5C2E-A8A4-A01D6CC3F4B8

results

array<object>

返回值

object

返回值

contextId

string

写入生成的记录 ID 或事件 ID

897294a7-67a4-4f60-976c-e136edc5f97e

status

string

写入状态,例如 accepted、queued、created

accepted

示例

正常返回示例

JSON格式

{
  "requestId": "0B9377D9-C56B-5C2E-A8A4-A01D6CC3F4B8",
  "results": [
    {
      "contextId": "897294a7-67a4-4f60-976c-e136edc5f97e",
      "status": "accepted"
    }
  ]
}

错误码

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情