ProtocolCodec

org.llm4s.shared.ProtocolCodec
object 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

WorkspaceAgentCommand for available commands

WorkspaceAgentResponse for response types

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

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

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

Encodes a WorkspaceAgentCommand to JSON string.

Encodes a WorkspaceAgentCommand to JSON string.

Value parameters

command

command to encode

Attributes

Returns

JSON string representation

Encodes a WorkspaceAgentResponse to JSON string.

Encodes a WorkspaceAgentResponse to JSON string.

Value parameters

response

response to encode

Attributes

Returns

JSON string representation