MCPcopy Index your code
hub / github.com/google/ax / DeleteConversation

Method DeleteConversation

internal/server/server.go:108–126  ·  view source on GitHub ↗
(ctx context.Context, req *proto.DeleteConversationRequest)

Source from the content-addressed store, hash-verified

106}
107
108func (s *Server) DeleteConversation(ctx context.Context, req *proto.DeleteConversationRequest) (*proto.DeleteConversationResponse, error) {
109 slog.InfoContext(ctx, "Deleting conversation...",
110 slog.String("conversation_id", req.ConversationId))
111
112 if req.ConversationId == "" {
113 return nil, status.Errorf(codes.InvalidArgument, "conversation_id is required")
114 }
115 inFlight, cleanup := s.markInFlight(req.ConversationId)
116 if inFlight {
117 return nil, status.Errorf(codes.FailedPrecondition, "conversation %q is already in flight", req.ConversationId)
118 }
119 defer cleanup()
120
121 if err := s.controller.Delete(ctx, req.ConversationId); err != nil {
122 return nil, status.Errorf(codes.Internal, "failed to delete conversation: %v", err)
123 }
124 go suspendActor(req.ConversationId) // TODO(jbd): Move to an interceptor.
125 return &proto.DeleteConversationResponse{}, nil
126}
127
128// Serve starts the gRPC server on the specified address.
129func (s *Server) Serve(address string, opts ...grpc.ServerOption) error {

Callers

nothing calls this directly

Calls 4

markInFlightMethod · 0.95
suspendActorFunction · 0.70
StringMethod · 0.45
DeleteMethod · 0.45

Tested by

no test coverage detected