Documentation
¶
Index ¶
- Constants
- func CloseRecognitionClient(cli *httpclient.WsClient)
- func ConnRecognitionClient(request *Request, token string) (*httpclient.WsClient, error)
- func GenerateTaskID() string
- func HandleRecognitionResult(ctx context.Context, cli *httpclient.WsClient, fn StreamingFunc)
- func SendRadioData(cli *httpclient.WsClient, bytesData []byte)
- type Attributes
- type Header
- type ModelParaformer
- type Output
- type Parameters
- type PayloadIn
- type PayloadOut
- type RecognitionResult
- type ReqHeader
- type Request
- type ResultWriter
- type Sentence
- type StreamingFunc
- type Usage
Constants ¶
View Source
const ParaformerWSURL = "wss://dashscope.aliyuncs.com/api-ws/v1/inference"
Variables ¶
This section is empty.
Functions ¶
func CloseRecognitionClient ¶
func CloseRecognitionClient(cli *httpclient.WsClient)
func ConnRecognitionClient ¶
func ConnRecognitionClient(request *Request, token string) (*httpclient.WsClient, error)
func HandleRecognitionResult ¶
func HandleRecognitionResult(ctx context.Context, cli *httpclient.WsClient, fn StreamingFunc)
func SendRadioData ¶
func SendRadioData(cli *httpclient.WsClient, bytesData []byte)
Types ¶
type Attributes ¶
type Attributes struct{}
type Header ¶
type Header struct { TaskID string `json:"task_id"` Event string `json:"event"` Attributes Attributes `json:"attributes"` }
type ModelParaformer ¶
type ModelParaformer = string
const ( // detect from file. ParaformerV1 ModelParaformer = "paraformer-v1" Paraformer8KV1 ModelParaformer = "paraformer-8k-v1" ParaformerMtlV1 ModelParaformer = "paraformer-mtl-v1" // real time voice. ParaformerRealTimeV1 ModelParaformer = "paraformer-realtime-v1" ParaformerRealTime8KV1 ModelParaformer = "paraformer-realtime-8k-v1" )
type Parameters ¶
type PayloadOut ¶
type RecognitionResult ¶
type RecognitionResult struct { Header Header `json:"header"` Payload PayloadOut `json:"payload"` }
type Request ¶
type Request struct { Header ReqHeader `json:"header"` Payload PayloadIn `json:"payload"` StreamingFn StreamingFunc `json:"-"` }
type ResultWriter ¶
Click to show internal directories.
Click to hide internal directories.