AS AgentScopeAPI 手册 / API Reference

JsonPatchOperation

record JsonPatchOperation(String op, String path, Object value, String from)
源码Source io/agentscope/core/agui/event/AguiEvent.java:1702–1747

承载 JSON Patch Operation数据的记录类型。位于 io.agentscope.core.agui.event 包。核心成员包括 op、path、value、from、add、remove。

Represents a JSON Patch operation (RFC 6902). Used in StateDelta events for incremental state updates.

记录组件摘要Record Component Summary

组件Component类型Type说明Description
opString
执行 `op` 方法。
Performs the op operation.
pathString
执行路径相关操作。
Performs the path operation.
valueObject
执行值相关操作。
Performs the value operation.
fromString
创建并返回实例。
Creates and returns an instance.

构造器摘要Constructor Summary

构造器Constructor说明Description
public JsonPatchOperation(String op, String path, Object value, String from)
初始化 `JsonPatchOperation` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public static JsonPatchOperation add(String path, Object value)
static
执行添加相关操作。
Creates an "add" operation.
public static JsonPatchOperation remove(String path)
static
设置移除。
Creates a "remove" operation.
public static JsonPatchOperation replace(String path, Object value)
static
执行 `replace` 方法。
Creates a "replace" operation.

记录组件详情Record Component Detail

op

String op

执行 op 方法。

Performs the op operation.

源码Source io/agentscope/core/agui/event/AguiEvent.java:1702–1747

path

String path

执行路径相关操作。

Performs the path operation.

源码Source io/agentscope/core/agui/event/AguiEvent.java:1702–1747

value

Object value

执行值相关操作。

Performs the value operation.

源码Source io/agentscope/core/agui/event/AguiEvent.java:1702–1747

from

String from

创建并返回实例。

Creates and returns an instance.

源码Source io/agentscope/core/agui/event/AguiEvent.java:1702–1747

构造器详情Constructor Detail

JsonPatchOperation

public JsonPatchOperation(String op, String path, Object value, String from)

初始化 JsonPatchOperation 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
opStringop(类型 `String`)。The op.
pathString路径(类型 `String`)。The path.
valueObject值(类型 `Object`)。The value.
fromString来自(类型 `String`)。The from.
源码Source io/agentscope/core/agui/event/AguiEvent.java:1704–1714

方法详情Method Detail

add

public static JsonPatchOperation add(String path, Object value)
static

执行添加相关操作。

Creates an "add" operation.

参数Parameters
名称Name类型Type说明Description
pathString路径到添加 at。The path to add at
valueObject值到添加。The value to add
返回Returns JsonPatchOperation
返回JsonPatchOperation。A new add operation
源码Source io/agentscope/core/agui/event/AguiEvent.java:1723–1725

remove

public static JsonPatchOperation remove(String path)
static

设置移除。

Creates a "remove" operation.

参数Parameters
名称Name类型Type说明Description
pathString路径到移除。The path to remove
返回Returns JsonPatchOperation
返回JsonPatchOperation。A new remove operation
源码Source io/agentscope/core/agui/event/AguiEvent.java:1733–1735

replace

public static JsonPatchOperation replace(String path, Object value)
static

执行 replace 方法。

Creates a "replace" operation.

参数Parameters
名称Name类型Type说明Description
pathString路径(类型 `String`)。The path to replace
valueObject新的值。The new value
返回Returns JsonPatchOperation
返回JsonPatchOperation。A new replace operation
源码Source io/agentscope/core/agui/event/AguiEvent.java:1744–1746
基于官方固定版本源码静态生成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.