org.llm4s.shared.ProtocolCodec
JSON codec for workspace agent protocol messages.
Provides serialization and deserialization of commands and responses using uPickle's JSON support. All protocol types are serialized polymorphically based on their runtime type.
== Usage Example ==
val command: WorkspaceAgentCommand = ReadFileCommand("cmd-1", "/path/to/file.txt", None, None)
val json = ProtocolCodec.encodeAgentCommand(command)
val decoded = ProtocolCodec.decodeAgentCommand(json)
Attributes
See also
Source
ProtocolCodec.scala
Graph
Reset zoom Hide graph Show graph
Supertypes
trait Matchable
class Any
Self type
Members list
Decodes a JSON string to a WorkspaceAgentCommand.
Decodes a JSON string to a WorkspaceAgentCommand.
Value parameters
json
JSON string representation of a command
Attributes
Returns
decoded command
Note
Throws upickle.core.AbortException if JSON is invalid or doesn't match expected schema
Source
ProtocolCodec.scala
Decodes a JSON string to a WorkspaceAgentResponse.
Decodes a JSON string to a WorkspaceAgentResponse.
Value parameters
json
JSON string representation of a response
Attributes
Returns
decoded response
Note
Throws upickle.core.AbortException if JSON is invalid or doesn't match expected schema
Source
ProtocolCodec.scala
Encodes a WorkspaceAgentCommand to JSON string.
Encodes a WorkspaceAgentCommand to JSON string.
Value parameters
command
command to encode
Attributes
Returns
JSON string representation
Source
ProtocolCodec.scala
Encodes a WorkspaceAgentResponse to JSON string.
Encodes a WorkspaceAgentResponse to JSON string.
Value parameters
response
response to encode
Attributes
Returns
JSON string representation
Source
ProtocolCodec.scala