Documentation ¶
Index ¶
- Constants
- Variables
- func GetDefaultConfig() *interfaces.StreamingConfig
- func Init(init SybmlInit)
- type LogLevel
- type NebulaClient
- type RestClient
- func (c *RestClient) DoAppendTextWithOptions(ctx context.Context, conversationId string, ...) error
- func (c *RestClient) DoFile(ctx context.Context, filePath string, resBody interface{}) error
- func (c *RestClient) DoFileWithOptions(ctx context.Context, filePath string, ...) error
- func (c *RestClient) DoTextWithOptions(ctx context.Context, options asyncinterfaces.AsyncTextRequest, ...) error
- func (c *RestClient) DoURL(ctx context.Context, url string, resBody interface{}) error
- func (c *RestClient) DoURLWithOptions(ctx context.Context, ufRequest asyncinterfaces.AsyncURLFileRequest, ...) error
- type StreamClient
- type StreamingOptions
- type SybmlInit
Constants ¶
const ( LogLevelDefault LogLevel = iota LogLevelErrorOnly = 1 LogLevelStandard = 2 LogLevelElevated = 3 LogLevelFull = 4 LogLevelDebug = 5 LogLevelTrace = 6 LogLevelVerbose = 7 )
The verbosity of the logging to the console or logfile. Default is LogLevelStandard LogLevelFull contains INFO related messages that could be helpful in debugging LogLevelTrace is very detailed function enter, highly verbose statements, function exit LogLevelVerbose contains data movement on top of Trace
Variables ¶
var ( // ErrInvalidInput required input was not found ErrInvalidInput = errors.New("required input was not found") // ErrAuthFailure failed to authenticate to the symbl platform ErrAuthFailure = errors.New("failed to authenticate to the symbl platform") // ErrReauthFailure failed to re-authenticate to the symbl platform ErrReauthFailure = errors.New("failed to re-authenticate to the symbl platform") // ErrWebSocketInitializationFailed websocket initialization failed ErrWebSocketInitializationFailed = errors.New("websocket initialization failed") )
Functions ¶
func GetDefaultConfig ¶
func GetDefaultConfig() *interfaces.StreamingConfig
GetDefaultConfig returns a minimal Symbl Config for the Websocket Interface
Types ¶
type NebulaClient ¶
NebulaClient extends the pkg/client/rest Client and also keeps tabs on the auth token
func NewNebulaClientWithToken ¶
func NewNebulaClientWithToken(ctx context.Context, nebulaToken string) (*NebulaClient, error)
NewNebulaClientWithToken creates a new Nebula client. The client authenticates reusing an already valid Symbl Platform auth token
func NewNebulaRestClient ¶
func NewNebulaRestClient(ctx context.Context) (*NebulaClient, error)
NewNebulaRestClient creates a new Nebula client on the Symbl.ai platform. The client authenticates with the server with SYMBLAI_NEBULA_TOKEN as defined in environment variables.
type RestClient ¶
RestClient extends the pkg/client/rest Client and also keeps tabs on the Creds and Auth Cookie in order to reconnect
func NewRestClient ¶
func NewRestClient(ctx context.Context) (*RestClient, error)
NewRestClient creates a new client on the Symbl.ai platform. The client authenticates with the server with APP_ID/APP_SECRET as defined in environment variables.
func NewRestClientWithCreds ¶
func NewRestClientWithCreds(ctx context.Context, creds interfaces.Credentials) (*RestClient, error)
NewRestClientWithCreds creates a new client on the Symbl.ai platform. The client authenticates with the server using APP_ID/APP_SECRET provided in Credentials struct
func NewRestClientWithToken ¶
func NewRestClientWithToken(ctx context.Context, accessToken string) (*RestClient, error)
NewRestClientWithToken creates a new client on the Symbl.ai platform. The client authenticates reusing an already valid Symbl Platform auth token
func (*RestClient) DoAppendTextWithOptions ¶
func (c *RestClient) DoAppendTextWithOptions(ctx context.Context, conversationId string, options asyncinterfaces.AsyncTextRequest, resBody interface{}) error
DoAppendTextWithOptions wrapper function for REST Client. Please see pkg/client/rest
func (*RestClient) DoFile ¶
func (c *RestClient) DoFile(ctx context.Context, filePath string, resBody interface{}) error
DoFile wrapper function for REST Client. Please see pkg/client/rest
func (*RestClient) DoFileWithOptions ¶
func (c *RestClient) DoFileWithOptions(ctx context.Context, filePath string, ufRequest asyncinterfaces.AsyncURLFileRequest, resBody interface{}) error
DoFileWithOptions wrapper function for REST Client. Please see pkg/client/rest
func (*RestClient) DoTextWithOptions ¶
func (c *RestClient) DoTextWithOptions(ctx context.Context, options asyncinterfaces.AsyncTextRequest, resBody interface{}) error
DoTextWithOptions wrapper function for REST Client. Please see pkg/client/rest
func (*RestClient) DoURL ¶
func (c *RestClient) DoURL(ctx context.Context, url string, resBody interface{}) error
DoURL wrapper function for REST Client. Please see pkg/client/rest
func (*RestClient) DoURLWithOptions ¶
func (c *RestClient) DoURLWithOptions(ctx context.Context, ufRequest asyncinterfaces.AsyncURLFileRequest, resBody interface{}) error
DoURLWithOptions wrapper function for REST Client. Please see pkg/client/rest
type StreamClient ¶
type StreamClient struct { *stream.WebSocketClient // contains filtered or unexported fields }
StreamClient is a representation of the Symbl Platform streaming client over a Websocket interface
func NewStreamClient ¶
func NewStreamClient(ctx context.Context, options StreamingOptions) (*StreamClient, error)
NewStreamClient creates a Symbl Streaming Client with the provided StreamingOptions and uses the APP_ID/APP_SECRET environment variables for authentication.
func NewStreamClientWithDefaults ¶
func NewStreamClientWithDefaults(ctx context.Context) (*StreamClient, error)
NewStreamClientWithDefaults creates a Symbl Streaming Client with the default config and uses the APP_ID/APP_SECRET environment variables for authentication.
func (*StreamClient) GetConversationId ¶
func (sc *StreamClient) GetConversationId() string
GetConversationId returns the Symbl Conversation ID for this Real-Time Streaming session.
func (*StreamClient) Start ¶
func (sc *StreamClient) Start() error
Start begins the Symbl Platform Websocket Protocol by sending the "start_request" message
func (*StreamClient) Stop ¶
func (sc *StreamClient) Stop()
Stop closes the Websocket connection cleanly by sending "stop_request" message to the Symbl Platform.
type StreamingOptions ¶
type StreamingOptions struct { UUID string SymblEndpoint string SymblConfig *cfginterfaces.StreamingConfig Callback rtinterfaces.InsightCallback SkipServerAuth bool RedirectService bool }
StreamingOptions are connection options for the Real-Time Websocket client