()
| 87 | } |
| 88 | |
| 89 | func (s *Server) registerConversations() { |
| 90 | huma.Register(s.API, huma.Operation{ |
| 91 | OperationID: "listConversations", |
| 92 | Method: http.MethodGet, |
| 93 | Path: "/v1/agents/{email}/conversations", |
| 94 | Summary: "List conversations", |
| 95 | Description: "List an agent's conversation threads (derived from messages.conversation_id).", |
| 96 | Tags: []string{"conversations"}, |
| 97 | Security: []map[string][]string{{"bearer": {}}}, |
| 98 | }, s.handleListConversations) |
| 99 | |
| 100 | huma.Register(s.API, huma.Operation{ |
| 101 | OperationID: "getConversation", |
| 102 | Method: http.MethodGet, |
| 103 | Path: "/v1/agents/{email}/conversations/{id}", |
| 104 | Summary: "Get a conversation", |
| 105 | Description: "Fetch a single conversation thread with its participants, labels, and member messages.", |
| 106 | Tags: []string{"conversations"}, |
| 107 | Security: []map[string][]string{{"bearer": {}}}, |
| 108 | }, s.handleGetConversation) |
| 109 | } |
| 110 | |
| 111 | func (s *Server) handleListConversations(ctx context.Context, in *ListConversationsInput) (*listConversationsOutput, error) { |
| 112 | ag, err := s.resolveOwnedAgent(ctx, in.Address) |
no test coverage detected