ai

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_ai_proto protoreflect.FileDescriptor

Functions

func NewAiEndpoints

func NewAiEndpoints() []*api.Endpoint

func RegisterAiHandler

func RegisterAiHandler(s server.Server, hdlr AiHandler, opts ...server.HandlerOption) error

Types

type AiService

type AiService interface {
	Call(ctx context.Context, in *CallRequest, opts ...client.CallOption) (*CallResponse, error)
	Check(ctx context.Context, in *CheckRequest, opts ...client.CallOption) (*CheckResponse, error)
	Moderate(ctx context.Context, in *ModerateRequest, opts ...client.CallOption) (*ModerateResponse, error)
}

func NewAiService

func NewAiService(name string, c client.Client) AiService

type CallRequest

type CallRequest struct {

	// text to pass in
	Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

Make a request to the AI

func (*CallRequest) Descriptor deprecated

func (*CallRequest) Descriptor() ([]byte, []int)

Deprecated: Use CallRequest.ProtoReflect.Descriptor instead.

func (*CallRequest) GetText

func (x *CallRequest) GetText() string

func (*CallRequest) ProtoMessage

func (*CallRequest) ProtoMessage()

func (*CallRequest) ProtoReflect

func (x *CallRequest) ProtoReflect() protoreflect.Message

func (*CallRequest) Reset

func (x *CallRequest) Reset()

func (*CallRequest) String

func (x *CallRequest) String() string

type CallResponse

type CallResponse struct {

	// text returned
	Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

Response from the AI

func (*CallResponse) Descriptor deprecated

func (*CallResponse) Descriptor() ([]byte, []int)

Deprecated: Use CallResponse.ProtoReflect.Descriptor instead.

func (*CallResponse) GetText

func (x *CallResponse) GetText() string

func (*CallResponse) ProtoMessage

func (*CallResponse) ProtoMessage()

func (*CallResponse) ProtoReflect

func (x *CallResponse) ProtoReflect() protoreflect.Message

func (*CallResponse) Reset

func (x *CallResponse) Reset()

func (*CallResponse) String

func (x *CallResponse) String() string

type CheckRequest

type CheckRequest struct {

	// text/code to check
	Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	// instruction hint e.g check the grammar
	Instruction string `protobuf:"bytes,2,opt,name=instruction,proto3" json:"instruction,omitempty"`
	// contains filtered or unexported fields
}

Check or edit text/code

func (*CheckRequest) Descriptor deprecated

func (*CheckRequest) Descriptor() ([]byte, []int)

Deprecated: Use CheckRequest.ProtoReflect.Descriptor instead.

func (*CheckRequest) GetInstruction

func (x *CheckRequest) GetInstruction() string

func (*CheckRequest) GetText

func (x *CheckRequest) GetText() string

func (*CheckRequest) ProtoMessage

func (*CheckRequest) ProtoMessage()

func (*CheckRequest) ProtoReflect

func (x *CheckRequest) ProtoReflect() protoreflect.Message

func (*CheckRequest) Reset

func (x *CheckRequest) Reset()

func (*CheckRequest) String

func (x *CheckRequest) String() string

type CheckResponse

type CheckResponse struct {

	// response output
	Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

func (*CheckResponse) Descriptor deprecated

func (*CheckResponse) Descriptor() ([]byte, []int)

Deprecated: Use CheckResponse.ProtoReflect.Descriptor instead.

func (*CheckResponse) GetText

func (x *CheckResponse) GetText() string

func (*CheckResponse) ProtoMessage

func (*CheckResponse) ProtoMessage()

func (*CheckResponse) ProtoReflect

func (x *CheckResponse) ProtoReflect() protoreflect.Message

func (*CheckResponse) Reset

func (x *CheckResponse) Reset()

func (*CheckResponse) String

func (x *CheckResponse) String() string

type ModerateRequest

type ModerateRequest struct {

	// text to check
	Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

Moderate hate speech

func (*ModerateRequest) Descriptor deprecated

func (*ModerateRequest) Descriptor() ([]byte, []int)

Deprecated: Use ModerateRequest.ProtoReflect.Descriptor instead.

func (*ModerateRequest) GetText

func (x *ModerateRequest) GetText() string

func (*ModerateRequest) ProtoMessage

func (*ModerateRequest) ProtoMessage()

func (*ModerateRequest) ProtoReflect

func (x *ModerateRequest) ProtoReflect() protoreflect.Message

func (*ModerateRequest) Reset

func (x *ModerateRequest) Reset()

func (*ModerateRequest) String

func (x *ModerateRequest) String() string

type ModerateResponse

type ModerateResponse struct {

	// whether it was flagged or not
	Flagged bool `protobuf:"varint,1,opt,name=flagged,proto3" json:"flagged,omitempty"`
	// categories tested and identified
	Categories map[string]bool `` /* 162-byte string literal not displayed */
	// related scores
	Scores map[string]float64 `` /* 155-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ModerateResponse) Descriptor deprecated

func (*ModerateResponse) Descriptor() ([]byte, []int)

Deprecated: Use ModerateResponse.ProtoReflect.Descriptor instead.

func (*ModerateResponse) GetCategories

func (x *ModerateResponse) GetCategories() map[string]bool

func (*ModerateResponse) GetFlagged

func (x *ModerateResponse) GetFlagged() bool

func (*ModerateResponse) GetScores

func (x *ModerateResponse) GetScores() map[string]float64

func (*ModerateResponse) ProtoMessage

func (*ModerateResponse) ProtoMessage()

func (*ModerateResponse) ProtoReflect

func (x *ModerateResponse) ProtoReflect() protoreflect.Message

func (*ModerateResponse) Reset

func (x *ModerateResponse) Reset()

func (*ModerateResponse) String

func (x *ModerateResponse) String() string

Jump to

Keyboard shortcuts

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