// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc             v3.21.12
// source: yandex/cloud/ai/foundation_models/v1/text_classification/text_classification_service.proto

package text_classification

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	TextClassificationService_Classify_FullMethodName        = "/yandex.cloud.ai.foundation_models.v1.text_classification.TextClassificationService/Classify"
	TextClassificationService_FewShotClassify_FullMethodName = "/yandex.cloud.ai.foundation_models.v1.text_classification.TextClassificationService/FewShotClassify"
)

// TextClassificationServiceClient is the client API for TextClassificationService service.
//
// 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.
//
// Service for classifying the text requests provided in prompts.
type TextClassificationServiceClient interface {
	// RPC method to classify text with tuned model.
	//
	// The names of the classes between which the model will be distributing requests
	// must be specified during model tuning and are not provided in the request.
	Classify(ctx context.Context, in *TextClassificationRequest, opts ...grpc.CallOption) (*TextClassificationResponse, error)
	// RPC method for binary and multi-class classification.
	//
	// You can provide up to 20 classes for few-shot text classification
	// with optional examples.
	FewShotClassify(ctx context.Context, in *FewShotTextClassificationRequest, opts ...grpc.CallOption) (*FewShotTextClassificationResponse, error)
}

type textClassificationServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewTextClassificationServiceClient(cc grpc.ClientConnInterface) TextClassificationServiceClient {
	return &textClassificationServiceClient{cc}
}

func (c *textClassificationServiceClient) Classify(ctx context.Context, in *TextClassificationRequest, opts ...grpc.CallOption) (*TextClassificationResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(TextClassificationResponse)
	err := c.cc.Invoke(ctx, TextClassificationService_Classify_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *textClassificationServiceClient) FewShotClassify(ctx context.Context, in *FewShotTextClassificationRequest, opts ...grpc.CallOption) (*FewShotTextClassificationResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(FewShotTextClassificationResponse)
	err := c.cc.Invoke(ctx, TextClassificationService_FewShotClassify_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// TextClassificationServiceServer is the server API for TextClassificationService service.
// All implementations should embed UnimplementedTextClassificationServiceServer
// for forward compatibility.
//
// Service for classifying the text requests provided in prompts.
type TextClassificationServiceServer interface {
	// RPC method to classify text with tuned model.
	//
	// The names of the classes between which the model will be distributing requests
	// must be specified during model tuning and are not provided in the request.
	Classify(context.Context, *TextClassificationRequest) (*TextClassificationResponse, error)
	// RPC method for binary and multi-class classification.
	//
	// You can provide up to 20 classes for few-shot text classification
	// with optional examples.
	FewShotClassify(context.Context, *FewShotTextClassificationRequest) (*FewShotTextClassificationResponse, error)
}

// UnimplementedTextClassificationServiceServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedTextClassificationServiceServer struct{}

func (UnimplementedTextClassificationServiceServer) Classify(context.Context, *TextClassificationRequest) (*TextClassificationResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method Classify not implemented")
}
func (UnimplementedTextClassificationServiceServer) FewShotClassify(context.Context, *FewShotTextClassificationRequest) (*FewShotTextClassificationResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method FewShotClassify not implemented")
}
func (UnimplementedTextClassificationServiceServer) testEmbeddedByValue() {}

// UnsafeTextClassificationServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to TextClassificationServiceServer will
// result in compilation errors.
type UnsafeTextClassificationServiceServer interface {
	mustEmbedUnimplementedTextClassificationServiceServer()
}

func RegisterTextClassificationServiceServer(s grpc.ServiceRegistrar, srv TextClassificationServiceServer) {
	// If the following call panics, it indicates UnimplementedTextClassificationServiceServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&TextClassificationService_ServiceDesc, srv)
}

func _TextClassificationService_Classify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(TextClassificationRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TextClassificationServiceServer).Classify(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TextClassificationService_Classify_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TextClassificationServiceServer).Classify(ctx, req.(*TextClassificationRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _TextClassificationService_FewShotClassify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(FewShotTextClassificationRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TextClassificationServiceServer).FewShotClassify(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TextClassificationService_FewShotClassify_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TextClassificationServiceServer).FewShotClassify(ctx, req.(*FewShotTextClassificationRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// TextClassificationService_ServiceDesc is the grpc.ServiceDesc for TextClassificationService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var TextClassificationService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.ai.foundation_models.v1.text_classification.TextClassificationService",
	HandlerType: (*TextClassificationServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Classify",
			Handler:    _TextClassificationService_Classify_Handler,
		},
		{
			MethodName: "FewShotClassify",
			Handler:    _TextClassificationService_FewShotClassify_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/ai/foundation_models/v1/text_classification/text_classification_service.proto",
}
