AS AgentScopeAPI 手册 / API Reference

MessageContentDeserializer

public class MessageContentDeserializer extends JsonDeserializer<MessageContent>
源码Source io/agentscope/core/agui/model/MessageContentDeserializer.java:39–68

消息内容反序列化器,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.core.agui.model 包,继承自 JsonDeserializer<MessageContent>。核心成员包括 deserialize。

Custom Jackson deserializer for MessageContent.

Handles the AG-UI protocol's union type where content can be either:

  • A JSON string → MessageContent.Text

  • A JSON array of objects → MessageContent.Blocks

  • A JSON null → null

方法摘要Method Summary

方法Method说明Description
public MessageContent deserialize(JsonParser p, DeserializationContext ctxt) throws IOException
执行 `deserialize` 方法。
Performs the deserialize operation.

方法详情Method Detail

deserialize

public MessageContent deserialize(JsonParser p, DeserializationContext ctxt) throws IOException

执行 deserialize 方法。

Performs the deserialize operation.

参数Parameters
名称Name类型Type说明Description
pJsonParserp(类型 `JsonParser`)。The p.
ctxtDeserializationContextctxt(类型 `DeserializationContext`)。The ctxt.
返回Returns MessageContent
返回MessageContent。Returns message content.
抛出Throws
  • IOException 可能抛出 `IOException`。Thrown when the operation cannot be completed.
源码Source io/agentscope/core/agui/model/MessageContentDeserializer.java:44–67
基于官方固定版本源码静态生成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.