NewServer 创建 A2A 服务器
(actorSystem *actor.System, taskStore TaskStore)
| 26 | |
| 27 | // NewServer 创建 A2A 服务器 |
| 28 | func NewServer(actorSystem *actor.System, taskStore TaskStore) *Server { |
| 29 | if taskStore == nil { |
| 30 | taskStore = NewInMemoryTaskStore() |
| 31 | } |
| 32 | |
| 33 | return &Server{ |
| 34 | actorSystem: actorSystem, |
| 35 | taskStore: taskStore, |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | // HandleRequest 处理 JSON-RPC 请求 |
| 40 | func (s *Server) HandleRequest(ctx context.Context, agentID string, req *JSONRPCRequest) *JSONRPCResponse { |