translationsv1alpha1connect

package
v1.8.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TranslationsServiceTranslateTemplateProcedure is the fully-qualified name of the
	// TranslationsService's TranslateTemplate RPC.
	TranslationsServiceTranslateTemplateProcedure = "/services.translations.v1alpha1.TranslationsService/TranslateTemplate"
	// TranslationsServiceListTranslationsProcedure is the fully-qualified name of the
	// TranslationsService's ListTranslations RPC.
	TranslationsServiceListTranslationsProcedure = "/services.translations.v1alpha1.TranslationsService/ListTranslations"
	// TranslationsServiceListLanguagesProcedure is the fully-qualified name of the
	// TranslationsService's ListLanguages RPC.
	TranslationsServiceListLanguagesProcedure = "/services.translations.v1alpha1.TranslationsService/ListLanguages"
	// TranslationsServiceListContextsProcedure is the fully-qualified name of the TranslationsService's
	// ListContexts RPC.
	TranslationsServiceListContextsProcedure = "/services.translations.v1alpha1.TranslationsService/ListContexts"
	// TranslationsServiceUpdateTranslationProcedure is the fully-qualified name of the
	// TranslationsService's UpdateTranslation RPC.
	TranslationsServiceUpdateTranslationProcedure = "/services.translations.v1alpha1.TranslationsService/UpdateTranslation"
	// TranslationsServiceTriggerLLMTranslationProcedure is the fully-qualified name of the
	// TranslationsService's TriggerLLMTranslation RPC.
	TranslationsServiceTriggerLLMTranslationProcedure = "/services.translations.v1alpha1.TranslationsService/TriggerLLMTranslation"
	// TranslationsServiceTriggerLLMTranslationsProcedure is the fully-qualified name of the
	// TranslationsService's TriggerLLMTranslations RPC.
	TranslationsServiceTriggerLLMTranslationsProcedure = "/services.translations.v1alpha1.TranslationsService/TriggerLLMTranslations"
	// TranslationsServiceSetSystemMessageProcedure is the fully-qualified name of the
	// TranslationsService's SetSystemMessage RPC.
	TranslationsServiceSetSystemMessageProcedure = "/services.translations.v1alpha1.TranslationsService/SetSystemMessage"
	// TranslationsServiceGetSystemMessageProcedure is the fully-qualified name of the
	// TranslationsService's GetSystemMessage RPC.
	TranslationsServiceGetSystemMessageProcedure = "/services.translations.v1alpha1.TranslationsService/GetSystemMessage"
	// TranslationsServiceTestSystemMessageProcedure is the fully-qualified name of the
	// TranslationsService's TestSystemMessage RPC.
	TranslationsServiceTestSystemMessageProcedure = "/services.translations.v1alpha1.TranslationsService/TestSystemMessage"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// TranslationsServiceName is the fully-qualified name of the TranslationsService service.
	TranslationsServiceName = "services.translations.v1alpha1.TranslationsService"
)

Variables

This section is empty.

Functions

func NewTranslationsServiceHandler

func NewTranslationsServiceHandler(svc TranslationsServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler)

NewTranslationsServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

type TranslationsServiceClient

type TranslationsServiceClient interface {
	// Translate a template for a given context and language.
	// Required permissions:
	//
	//	Any Authenticated User
	//
	// Errors:
	//   - grpc.AlreadyExists : This template is already translated for the given context and language.
	//   - grpc.InvalidArgument: The request is not valid.
	TranslateTemplate(context.Context, *connect_go.Request[v1alpha1.TranslateTemplateRequest]) (*connect_go.Response[v1alpha1.TranslateTemplateResponse], error)
	// Lists translations by context/language
	// Required permissions:
	//   - PERMISSION_CUSTOMER_SUPPORT
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is not valid.
	//   - grpc.NotFound: No templates found for the given context and language.
	ListTranslations(context.Context, *connect_go.Request[v1alpha1.ListTranslationsRequest]) (*connect_go.Response[v1alpha1.ListTranslationsResponse], error)
	// Lists localization languages
	// Required permissions:
	//   - Any Authenticated User
	ListLanguages(context.Context, *connect_go.Request[v1alpha1.ListLanguagesRequest]) (*connect_go.Response[v1alpha1.ListLanguagesResponse], error)
	// Lists localization contexts
	// Required permissions:
	//   - PERMISSION_CUSTOMER_SUPPORT
	ListContexts(context.Context, *connect_go.Request[v1alpha1.ListContextsRequest]) (*connect_go.Response[v1alpha1.ListContextsResponse], error)
	// Overrides the translation for a given translationID
	// Required permissions:
	//   - PERMISSION_CUSTOMER_SUPPORT
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is not valid.
	UpdateTranslation(context.Context, *connect_go.Request[v1alpha1.UpdateTranslationRequest]) (*connect_go.Response[v1alpha1.UpdateTranslationResponse], error)
	// Re-run the LLM translation for a given translationID
	// Required permissions:
	//   - PERMISSION_CUSTOMER_SUPPORT
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is not valid.
	TriggerLLMTranslation(context.Context, *connect_go.Request[v1alpha1.TriggerLLMTranslationRequest]) (*connect_go.Response[v1alpha1.TriggerLLMTranslationResponse], error)
	// re-run all translations for a given context (WARNING - this should be ran sparingly as it is a heavy operation and costs money)
	// Required permissions:
	//   - PERMISSION_CUSTOMER_SUPPORT
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is not valid.
	TriggerLLMTranslations(context.Context, *connect_go.Request[v1alpha1.TriggerLLMTranslationsRequest]) (*connect_go.Response[v1alpha1.TriggerLLMTranslationsResponse], error)
	// set/get context system message to give more tuned LLMs when translating for that context (WARNING - this overrides the previous system message for the context if exists)
	// Required permissions:
	//   - PERMISSION_CUSTOMER_SUPPORT
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is not valid.
	SetSystemMessage(context.Context, *connect_go.Request[v1alpha1.SetSystemMessageRequest]) (*connect_go.Response[v1alpha1.SetSystemMessageResponse], error)
	GetSystemMessage(context.Context, *connect_go.Request[v1alpha1.GetSystemMessageRequest]) (*connect_go.Response[v1alpha1.GetSystemMessageResponse], error)
	// Gives a translation for a system message, template and language with no side effects (Used for testing system messages)
	// Required permissions:
	//   - PERMISSION_CUSTOMER_SUPPORT
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is not valid.
	TestSystemMessage(context.Context, *connect_go.Request[v1alpha1.TestSystemMessageRequest]) (*connect_go.Response[v1alpha1.TestSystemMessageResponse], error)
}

TranslationsServiceClient is a client for the services.translations.v1alpha1.TranslationsService service.

func NewTranslationsServiceClient

func NewTranslationsServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) TranslationsServiceClient

NewTranslationsServiceClient constructs a client for the services.translations.v1alpha1.TranslationsService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type TranslationsServiceHandler

type TranslationsServiceHandler interface {
	// Translate a template for a given context and language.
	// Required permissions:
	//
	//	Any Authenticated User
	//
	// Errors:
	//   - grpc.AlreadyExists : This template is already translated for the given context and language.
	//   - grpc.InvalidArgument: The request is not valid.
	TranslateTemplate(context.Context, *connect_go.Request[v1alpha1.TranslateTemplateRequest]) (*connect_go.Response[v1alpha1.TranslateTemplateResponse], error)
	// Lists translations by context/language
	// Required permissions:
	//   - PERMISSION_CUSTOMER_SUPPORT
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is not valid.
	//   - grpc.NotFound: No templates found for the given context and language.
	ListTranslations(context.Context, *connect_go.Request[v1alpha1.ListTranslationsRequest]) (*connect_go.Response[v1alpha1.ListTranslationsResponse], error)
	// Lists localization languages
	// Required permissions:
	//   - Any Authenticated User
	ListLanguages(context.Context, *connect_go.Request[v1alpha1.ListLanguagesRequest]) (*connect_go.Response[v1alpha1.ListLanguagesResponse], error)
	// Lists localization contexts
	// Required permissions:
	//   - PERMISSION_CUSTOMER_SUPPORT
	ListContexts(context.Context, *connect_go.Request[v1alpha1.ListContextsRequest]) (*connect_go.Response[v1alpha1.ListContextsResponse], error)
	// Overrides the translation for a given translationID
	// Required permissions:
	//   - PERMISSION_CUSTOMER_SUPPORT
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is not valid.
	UpdateTranslation(context.Context, *connect_go.Request[v1alpha1.UpdateTranslationRequest]) (*connect_go.Response[v1alpha1.UpdateTranslationResponse], error)
	// Re-run the LLM translation for a given translationID
	// Required permissions:
	//   - PERMISSION_CUSTOMER_SUPPORT
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is not valid.
	TriggerLLMTranslation(context.Context, *connect_go.Request[v1alpha1.TriggerLLMTranslationRequest]) (*connect_go.Response[v1alpha1.TriggerLLMTranslationResponse], error)
	// re-run all translations for a given context (WARNING - this should be ran sparingly as it is a heavy operation and costs money)
	// Required permissions:
	//   - PERMISSION_CUSTOMER_SUPPORT
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is not valid.
	TriggerLLMTranslations(context.Context, *connect_go.Request[v1alpha1.TriggerLLMTranslationsRequest]) (*connect_go.Response[v1alpha1.TriggerLLMTranslationsResponse], error)
	// set/get context system message to give more tuned LLMs when translating for that context (WARNING - this overrides the previous system message for the context if exists)
	// Required permissions:
	//   - PERMISSION_CUSTOMER_SUPPORT
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is not valid.
	SetSystemMessage(context.Context, *connect_go.Request[v1alpha1.SetSystemMessageRequest]) (*connect_go.Response[v1alpha1.SetSystemMessageResponse], error)
	GetSystemMessage(context.Context, *connect_go.Request[v1alpha1.GetSystemMessageRequest]) (*connect_go.Response[v1alpha1.GetSystemMessageResponse], error)
	// Gives a translation for a system message, template and language with no side effects (Used for testing system messages)
	// Required permissions:
	//   - PERMISSION_CUSTOMER_SUPPORT
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is not valid.
	TestSystemMessage(context.Context, *connect_go.Request[v1alpha1.TestSystemMessageRequest]) (*connect_go.Response[v1alpha1.TestSystemMessageResponse], error)
}

TranslationsServiceHandler is an implementation of the services.translations.v1alpha1.TranslationsService service.

type UnimplementedTranslationsServiceHandler

type UnimplementedTranslationsServiceHandler struct{}

UnimplementedTranslationsServiceHandler returns CodeUnimplemented from all methods.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL