Documentation
¶
Overview ¶
Package protocol provides exported constants for the Sequify WebSocket protocol. These constants are the only externally importable part of the protocol SDK.
Index ¶
Constants ¶
const ( MessageTypeRequest = "Request" MessageTypeResponse = "Response" MessageTypeUpdates = "Updates" )
MessageType constants define the three envelope types.
const ( MethodCreateConversation = "create_conversation" MethodSwitchConversation = "switch_conversation" MethodDestroyConversation = "destroy_conversation" MethodIntent = "intent" MethodCancel = "cancel" MethodEditMessage = "edit_message" MethodResult = "result" MethodGetMaxSeq = "get_max_seq" MethodFetchUpdates = "fetch_updates" MethodReadReceipt = "read_receipt" MethodListConversations = "list_conversations" )
Method constants — client -> server (11 methods).
const ( MethodToolCall = "tool_call" MethodRequestCapabilities = "request_capabilities" MethodCallCapability = "call_capability" )
Method constants — server -> client (3 methods).
const ( UpdateKindToolCall = "tool_call" UpdateKindResult = "result" UpdateKindReply = "reply" UpdateKindError = "error" UpdateKindReadReceipt = "read_receipt" UpdateKindConversationCreated = "conversation_created" UpdateKindConversationDestroyed = "conversation_destroyed" UpdateKindConversationSwitched = "conversation_switched" )
UpdateKind constants — persistent (seq > 0, 8 kinds).
const ( UpdateKindTyping = "typing" UpdateKindRetry = "retry" UpdateKindStreaming = "streaming" // incremental reply content chunks {delta, done} )
UpdateKind constants — non-persistent (seq = 0, 3 kinds).
const ( CodeAuthFailed = 4001 // Reserved for developer SDK — Sequify Server does not perform auth CodeCredentialExpired = 4002 // Reserved for developer SDK — Sequify Server does not perform auth CodeConnLimit = 4003 CodeBadMessage = 4004 CodeCapabilityNotRegistered = 4005 // capability not registered CodeVersionIncompat = 4006 )
ErrorCode constants — connection-level (4xxx).
const ( CodeConvNotFound = 5001 CodeMsgNotFound = 5002 CodeIntentFailed = 5003 CodeToolTimeout = 5004 CodeConvDestroyed = 5005 CodeConcurrentConflict = 5006 CodeCapabilityNotFound = 5007 // capability not found )
ErrorCode constants — command-level (5xxx).
const ( CodeInternal = 6001 CodeQueueFull = 6003 CodeDB = 6004 CodeRedis = 6005 )
ErrorCode constants — service-level (6xxx).
const ProtocolVersion = 1
ProtocolVersion is the current protocol version.
Variables ¶
This section is empty.
Functions ¶
func IsValidMethod ¶
IsValidMethod reports whether the given method string is a known protocol method.
func IsValidUpdateKind ¶
IsValidUpdateKind reports whether the given kind string is a known update kind.
Types ¶
This section is empty.