rapida_definitions

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssistantDefinition

type AssistantDefinition interface {
	GetAssistant() uint64
	GetAssistantVersion() string
}

func NewAssistant

func NewAssistant(assistant interface{}, assistantVersion string) (AssistantDefinition, error)

type Content

type Content struct {
	Original      *lexatic_backend.Content
	Content       []byte
	ContentFormat string
	ContentType   string
	Meta          *structpb.Struct
}

Content is a struct that wraps around the Common.Content protobuf message.

func NewContent

func NewContent(data *lexatic_backend.Content) *Content

NewContent constructs a Content wrapper from a Common.Content protobuf message.

func (*Content) ToDict

func (c *Content) ToDict() (map[string]interface{}, error)

ToDict converts the original protobuf content to a map.

func (*Content) ToJSON

func (c *Content) ToJSON() (string, error)

ToJSON converts the original protobuf content to a JSON string.

func (*Content) ToText

func (c *Content) ToText() (string, error)

ToText converts the content to a text string if the format and type are text-based.

type EndpointDefinition

type EndpointDefinition interface {
	GetEndpoint() uint64
	GetEndpointVersion() string
}

func NewEndpoint

func NewEndpoint(endpoint uint64, endpointVersion string) EndpointDefinition

type InvokeResponseWrapper

type InvokeResponseWrapper struct {
	Data    *lexatic_backend.CallerResponse
	Success bool
	Code    int32
	Error   *lexatic_backend.InvokerError
}

InvokeResponseWrapper is a struct that wraps around the response from the Invoker API.

func NewInvokeResponseWrapper

func NewInvokeResponseWrapper(data *lexatic_backend.InvokeResponse) *InvokeResponseWrapper

NewInvokeResponseWrapper constructs an InvokeResponseWrapper from an InvokerApi.InvokeResponse.

func (*InvokeResponseWrapper) GetCode

func (irw *InvokeResponseWrapper) GetCode() int32

GetCode returns the response code.

func (*InvokeResponseWrapper) GetData

func (irw *InvokeResponseWrapper) GetData() ([]*Content, error)

GetData returns a list of Content objects.

func (*InvokeResponseWrapper) GetError

GetError returns the error object.

func (*InvokeResponseWrapper) GetErrorCode

func (irw *InvokeResponseWrapper) GetErrorCode() int64

GetErrorCode returns the error code.

func (*InvokeResponseWrapper) GetErrorMessage

func (irw *InvokeResponseWrapper) GetErrorMessage() string

GetErrorMessage returns the error message.

func (*InvokeResponseWrapper) GetHumanErrorMessage

func (irw *InvokeResponseWrapper) GetHumanErrorMessage() string

GetHumanErrorMessage returns the human-readable error message.

func (*InvokeResponseWrapper) GetMetadata

func (irw *InvokeResponseWrapper) GetMetadata() (map[string]interface{}, error)

GetMetadata returns the metadata as a map.

func (*InvokeResponseWrapper) GetMetrics

func (irw *InvokeResponseWrapper) GetMetrics() ([]*Metric, error)

GetMetrics returns a list of Metric objects.

func (*InvokeResponseWrapper) GetRequestId

func (irw *InvokeResponseWrapper) GetRequestId() uint64

GetRequestId returns the request ID.

func (*InvokeResponseWrapper) GetTimeTaken

func (irw *InvokeResponseWrapper) GetTimeTaken() uint64

GetTimeTaken returns the time taken for the operation.

func (*InvokeResponseWrapper) IsError

func (irw *InvokeResponseWrapper) IsError() bool

IsError returns true if there was an error.

func (*InvokeResponseWrapper) IsSuccess

func (irw *InvokeResponseWrapper) IsSuccess() bool

IsSuccess returns true if the operation was successful.

func (*InvokeResponseWrapper) ToDict

func (irw *InvokeResponseWrapper) ToDict() (map[string]interface{}, error)

ToDict converts the wrapped data to a map.

func (*InvokeResponseWrapper) ToJSON

func (irw *InvokeResponseWrapper) ToJSON() (string, error)

ToJSON converts the wrapped data to JSON.

type Metric

type Metric struct {
	Original    *lexatic_backend.Metric
	Description string
	Name        string
	Value       string
}

Metric wraps around the Common.Metric protobuf message.

func NewMetric

func NewMetric(data *lexatic_backend.Metric) *Metric

NewMetric constructs a Metric wrapper from a Common.Metric protobuf message.

func (*Metric) ToDict

func (m *Metric) ToDict() (map[string]interface{}, error)

ToDict converts the original protobuf metric to a map.

func (*Metric) ToJSON

func (m *Metric) ToJSON() (string, error)

ToJSON converts the original protobuf metric to a JSON string.

Jump to

Keyboard shortcuts

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