cloud.google.com/go/aiplatform@v1.106.0/apiv1beta1/aiplatformpb/genai_tuning_service_grpc.pb.go (about) 1 // Copyright 2025 Google LLC 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 16 // versions: 17 // - protoc-gen-go-grpc v1.3.0 18 // - protoc v4.25.7 19 // source: google/cloud/aiplatform/v1beta1/genai_tuning_service.proto 20 21 package aiplatformpb 22 23 import ( 24 longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" 25 context "context" 26 grpc "google.golang.org/grpc" 27 codes "google.golang.org/grpc/codes" 28 status "google.golang.org/grpc/status" 29 emptypb "google.golang.org/protobuf/types/known/emptypb" 30 ) 31 32 // This is a compile-time assertion to ensure that this generated file 33 // is compatible with the grpc package it is being compiled against. 34 // Requires gRPC-Go v1.32.0 or later. 35 const _ = grpc.SupportPackageIsVersion7 36 37 const ( 38 GenAiTuningService_CreateTuningJob_FullMethodName = "/google.cloud.aiplatform.v1beta1.GenAiTuningService/CreateTuningJob" 39 GenAiTuningService_GetTuningJob_FullMethodName = "/google.cloud.aiplatform.v1beta1.GenAiTuningService/GetTuningJob" 40 GenAiTuningService_ListTuningJobs_FullMethodName = "/google.cloud.aiplatform.v1beta1.GenAiTuningService/ListTuningJobs" 41 GenAiTuningService_CancelTuningJob_FullMethodName = "/google.cloud.aiplatform.v1beta1.GenAiTuningService/CancelTuningJob" 42 GenAiTuningService_RebaseTunedModel_FullMethodName = "/google.cloud.aiplatform.v1beta1.GenAiTuningService/RebaseTunedModel" 43 ) 44 45 // GenAiTuningServiceClient is the client API for GenAiTuningService service. 46 // 47 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 48 type GenAiTuningServiceClient interface { 49 // Creates a TuningJob. A created TuningJob right away will be attempted to 50 // be run. 51 CreateTuningJob(ctx context.Context, in *CreateTuningJobRequest, opts ...grpc.CallOption) (*TuningJob, error) 52 // Gets a TuningJob. 53 GetTuningJob(ctx context.Context, in *GetTuningJobRequest, opts ...grpc.CallOption) (*TuningJob, error) 54 // Lists TuningJobs in a Location. 55 ListTuningJobs(ctx context.Context, in *ListTuningJobsRequest, opts ...grpc.CallOption) (*ListTuningJobsResponse, error) 56 // Cancels a TuningJob. 57 // Starts asynchronous cancellation on the TuningJob. The server makes a best 58 // effort to cancel the job, but success is not guaranteed. Clients can use 59 // [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1beta1.GenAiTuningService.GetTuningJob] 60 // or other methods to check whether the cancellation succeeded or whether the 61 // job completed despite cancellation. On successful cancellation, the 62 // TuningJob is not deleted; instead it becomes a job with a 63 // [TuningJob.error][google.cloud.aiplatform.v1beta1.TuningJob.error] value 64 // with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding 65 // to `Code.CANCELLED`, and 66 // [TuningJob.state][google.cloud.aiplatform.v1beta1.TuningJob.state] is set 67 // to `CANCELLED`. 68 CancelTuningJob(ctx context.Context, in *CancelTuningJobRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) 69 // Rebase a TunedModel. 70 // Creates a LongRunningOperation that takes a legacy Tuned GenAI model 71 // Reference and creates a TuningJob based on newly available model. 72 RebaseTunedModel(ctx context.Context, in *RebaseTunedModelRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) 73 } 74 75 type genAiTuningServiceClient struct { 76 cc grpc.ClientConnInterface 77 } 78 79 func NewGenAiTuningServiceClient(cc grpc.ClientConnInterface) GenAiTuningServiceClient { 80 return &genAiTuningServiceClient{cc} 81 } 82 83 func (c *genAiTuningServiceClient) CreateTuningJob(ctx context.Context, in *CreateTuningJobRequest, opts ...grpc.CallOption) (*TuningJob, error) { 84 out := new(TuningJob) 85 err := c.cc.Invoke(ctx, GenAiTuningService_CreateTuningJob_FullMethodName, in, out, opts...) 86 if err != nil { 87 return nil, err 88 } 89 return out, nil 90 } 91 92 func (c *genAiTuningServiceClient) GetTuningJob(ctx context.Context, in *GetTuningJobRequest, opts ...grpc.CallOption) (*TuningJob, error) { 93 out := new(TuningJob) 94 err := c.cc.Invoke(ctx, GenAiTuningService_GetTuningJob_FullMethodName, in, out, opts...) 95 if err != nil { 96 return nil, err 97 } 98 return out, nil 99 } 100 101 func (c *genAiTuningServiceClient) ListTuningJobs(ctx context.Context, in *ListTuningJobsRequest, opts ...grpc.CallOption) (*ListTuningJobsResponse, error) { 102 out := new(ListTuningJobsResponse) 103 err := c.cc.Invoke(ctx, GenAiTuningService_ListTuningJobs_FullMethodName, in, out, opts...) 104 if err != nil { 105 return nil, err 106 } 107 return out, nil 108 } 109 110 func (c *genAiTuningServiceClient) CancelTuningJob(ctx context.Context, in *CancelTuningJobRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { 111 out := new(emptypb.Empty) 112 err := c.cc.Invoke(ctx, GenAiTuningService_CancelTuningJob_FullMethodName, in, out, opts...) 113 if err != nil { 114 return nil, err 115 } 116 return out, nil 117 } 118 119 func (c *genAiTuningServiceClient) RebaseTunedModel(ctx context.Context, in *RebaseTunedModelRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) { 120 out := new(longrunningpb.Operation) 121 err := c.cc.Invoke(ctx, GenAiTuningService_RebaseTunedModel_FullMethodName, in, out, opts...) 122 if err != nil { 123 return nil, err 124 } 125 return out, nil 126 } 127 128 // GenAiTuningServiceServer is the server API for GenAiTuningService service. 129 // All implementations should embed UnimplementedGenAiTuningServiceServer 130 // for forward compatibility 131 type GenAiTuningServiceServer interface { 132 // Creates a TuningJob. A created TuningJob right away will be attempted to 133 // be run. 134 CreateTuningJob(context.Context, *CreateTuningJobRequest) (*TuningJob, error) 135 // Gets a TuningJob. 136 GetTuningJob(context.Context, *GetTuningJobRequest) (*TuningJob, error) 137 // Lists TuningJobs in a Location. 138 ListTuningJobs(context.Context, *ListTuningJobsRequest) (*ListTuningJobsResponse, error) 139 // Cancels a TuningJob. 140 // Starts asynchronous cancellation on the TuningJob. The server makes a best 141 // effort to cancel the job, but success is not guaranteed. Clients can use 142 // [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1beta1.GenAiTuningService.GetTuningJob] 143 // or other methods to check whether the cancellation succeeded or whether the 144 // job completed despite cancellation. On successful cancellation, the 145 // TuningJob is not deleted; instead it becomes a job with a 146 // [TuningJob.error][google.cloud.aiplatform.v1beta1.TuningJob.error] value 147 // with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding 148 // to `Code.CANCELLED`, and 149 // [TuningJob.state][google.cloud.aiplatform.v1beta1.TuningJob.state] is set 150 // to `CANCELLED`. 151 CancelTuningJob(context.Context, *CancelTuningJobRequest) (*emptypb.Empty, error) 152 // Rebase a TunedModel. 153 // Creates a LongRunningOperation that takes a legacy Tuned GenAI model 154 // Reference and creates a TuningJob based on newly available model. 155 RebaseTunedModel(context.Context, *RebaseTunedModelRequest) (*longrunningpb.Operation, error) 156 } 157 158 // UnimplementedGenAiTuningServiceServer should be embedded to have forward compatible implementations. 159 type UnimplementedGenAiTuningServiceServer struct { 160 } 161 162 func (UnimplementedGenAiTuningServiceServer) CreateTuningJob(context.Context, *CreateTuningJobRequest) (*TuningJob, error) { 163 return nil, status.Errorf(codes.Unimplemented, "method CreateTuningJob not implemented") 164 } 165 func (UnimplementedGenAiTuningServiceServer) GetTuningJob(context.Context, *GetTuningJobRequest) (*TuningJob, error) { 166 return nil, status.Errorf(codes.Unimplemented, "method GetTuningJob not implemented") 167 } 168 func (UnimplementedGenAiTuningServiceServer) ListTuningJobs(context.Context, *ListTuningJobsRequest) (*ListTuningJobsResponse, error) { 169 return nil, status.Errorf(codes.Unimplemented, "method ListTuningJobs not implemented") 170 } 171 func (UnimplementedGenAiTuningServiceServer) CancelTuningJob(context.Context, *CancelTuningJobRequest) (*emptypb.Empty, error) { 172 return nil, status.Errorf(codes.Unimplemented, "method CancelTuningJob not implemented") 173 } 174 func (UnimplementedGenAiTuningServiceServer) RebaseTunedModel(context.Context, *RebaseTunedModelRequest) (*longrunningpb.Operation, error) { 175 return nil, status.Errorf(codes.Unimplemented, "method RebaseTunedModel not implemented") 176 } 177 178 // UnsafeGenAiTuningServiceServer may be embedded to opt out of forward compatibility for this service. 179 // Use of this interface is not recommended, as added methods to GenAiTuningServiceServer will 180 // result in compilation errors. 181 type UnsafeGenAiTuningServiceServer interface { 182 mustEmbedUnimplementedGenAiTuningServiceServer() 183 } 184 185 func RegisterGenAiTuningServiceServer(s grpc.ServiceRegistrar, srv GenAiTuningServiceServer) { 186 s.RegisterService(&GenAiTuningService_ServiceDesc, srv) 187 } 188 189 func _GenAiTuningService_CreateTuningJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 190 in := new(CreateTuningJobRequest) 191 if err := dec(in); err != nil { 192 return nil, err 193 } 194 if interceptor == nil { 195 return srv.(GenAiTuningServiceServer).CreateTuningJob(ctx, in) 196 } 197 info := &grpc.UnaryServerInfo{ 198 Server: srv, 199 FullMethod: GenAiTuningService_CreateTuningJob_FullMethodName, 200 } 201 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 202 return srv.(GenAiTuningServiceServer).CreateTuningJob(ctx, req.(*CreateTuningJobRequest)) 203 } 204 return interceptor(ctx, in, info, handler) 205 } 206 207 func _GenAiTuningService_GetTuningJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 208 in := new(GetTuningJobRequest) 209 if err := dec(in); err != nil { 210 return nil, err 211 } 212 if interceptor == nil { 213 return srv.(GenAiTuningServiceServer).GetTuningJob(ctx, in) 214 } 215 info := &grpc.UnaryServerInfo{ 216 Server: srv, 217 FullMethod: GenAiTuningService_GetTuningJob_FullMethodName, 218 } 219 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 220 return srv.(GenAiTuningServiceServer).GetTuningJob(ctx, req.(*GetTuningJobRequest)) 221 } 222 return interceptor(ctx, in, info, handler) 223 } 224 225 func _GenAiTuningService_ListTuningJobs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 226 in := new(ListTuningJobsRequest) 227 if err := dec(in); err != nil { 228 return nil, err 229 } 230 if interceptor == nil { 231 return srv.(GenAiTuningServiceServer).ListTuningJobs(ctx, in) 232 } 233 info := &grpc.UnaryServerInfo{ 234 Server: srv, 235 FullMethod: GenAiTuningService_ListTuningJobs_FullMethodName, 236 } 237 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 238 return srv.(GenAiTuningServiceServer).ListTuningJobs(ctx, req.(*ListTuningJobsRequest)) 239 } 240 return interceptor(ctx, in, info, handler) 241 } 242 243 func _GenAiTuningService_CancelTuningJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 244 in := new(CancelTuningJobRequest) 245 if err := dec(in); err != nil { 246 return nil, err 247 } 248 if interceptor == nil { 249 return srv.(GenAiTuningServiceServer).CancelTuningJob(ctx, in) 250 } 251 info := &grpc.UnaryServerInfo{ 252 Server: srv, 253 FullMethod: GenAiTuningService_CancelTuningJob_FullMethodName, 254 } 255 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 256 return srv.(GenAiTuningServiceServer).CancelTuningJob(ctx, req.(*CancelTuningJobRequest)) 257 } 258 return interceptor(ctx, in, info, handler) 259 } 260 261 func _GenAiTuningService_RebaseTunedModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 262 in := new(RebaseTunedModelRequest) 263 if err := dec(in); err != nil { 264 return nil, err 265 } 266 if interceptor == nil { 267 return srv.(GenAiTuningServiceServer).RebaseTunedModel(ctx, in) 268 } 269 info := &grpc.UnaryServerInfo{ 270 Server: srv, 271 FullMethod: GenAiTuningService_RebaseTunedModel_FullMethodName, 272 } 273 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 274 return srv.(GenAiTuningServiceServer).RebaseTunedModel(ctx, req.(*RebaseTunedModelRequest)) 275 } 276 return interceptor(ctx, in, info, handler) 277 } 278 279 // GenAiTuningService_ServiceDesc is the grpc.ServiceDesc for GenAiTuningService service. 280 // It's only intended for direct use with grpc.RegisterService, 281 // and not to be introspected or modified (even as a copy) 282 var GenAiTuningService_ServiceDesc = grpc.ServiceDesc{ 283 ServiceName: "google.cloud.aiplatform.v1beta1.GenAiTuningService", 284 HandlerType: (*GenAiTuningServiceServer)(nil), 285 Methods: []grpc.MethodDesc{ 286 { 287 MethodName: "CreateTuningJob", 288 Handler: _GenAiTuningService_CreateTuningJob_Handler, 289 }, 290 { 291 MethodName: "GetTuningJob", 292 Handler: _GenAiTuningService_GetTuningJob_Handler, 293 }, 294 { 295 MethodName: "ListTuningJobs", 296 Handler: _GenAiTuningService_ListTuningJobs_Handler, 297 }, 298 { 299 MethodName: "CancelTuningJob", 300 Handler: _GenAiTuningService_CancelTuningJob_Handler, 301 }, 302 { 303 MethodName: "RebaseTunedModel", 304 Handler: _GenAiTuningService_RebaseTunedModel_Handler, 305 }, 306 }, 307 Streams: []grpc.StreamDesc{}, 308 Metadata: "google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", 309 }