Files
synapse/pkg/sdk/doc.go
2026-06-28 03:24:26 +08:00

22 lines
812 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Package sdk 灵隙(Synapse)协议 SDK
//
// 单包 SDK,通过 Protocol 类型区分三种协议客户端:
//
// - ProtoP2A(协议前缀 "P2A"):外部调用方,使用 REST API
// - ProtoA2A(协议前缀 "A2A"):Agent 点对点通信,消息级交互
// - ProtoA2N(协议前缀 "A2N"):Agent 群组协作,管理群组与任务
//
// 用法示例:
//
// p2a := sdk.NewClient(sdk.ProtoP2A, sdk.Config{BaseURL: "http://...", APIKey: "..."})
// task, err := p2a.SubmitTask(ctx, req)
//
// a2a := sdk.NewClient(sdk.ProtoA2A, sdk.Config{...})
// taskID, err := a2a.SendTaskRequest(ctx, target, "text_gen", payload)
//
// a2n := sdk.NewClient(sdk.ProtoA2N, sdk.Config{...})
// group, err := a2n.CreateGroup(ctx, name, topology, nil, members)
//
// 协议版本:1.0.0
package sdk