Documentation
¶
Index ¶
Constants ¶
View Source
const ( DownloadStreamProgressType = "download.progress" DownloadStreamErrorType = "download.error" DownloadStreamDoneType = "download.done" )
View Source
const ( TranscribeStreamDeltaType = "transcript.text.delta" TranscribeStreamDoneType = "transcript.text.done" TranscribeStreamErrorType = "transcript.text.error" TranscribeStreamLanguageType = "transcript.text.language" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DownloadModelRequest ¶ added in v0.0.26
type DownloadModelRequest struct {
Model string `json:"model" help:"Model ID to download"`
}
DownloadModelRequest represents a request to download a model
func (*DownloadModelRequest) String ¶ added in v0.0.26
func (r *DownloadModelRequest) String() string
type Event ¶ added in v0.0.26
type Event struct {
Type string `json:"type"`
Delta string `json:"delta,omitempty"` // transcript.text.delta
Text string `json:"text,omitempty"` // transcript.text.done and transcript.text.language
JSON json.RawMessage `json:"json,omitempty"` // transcript.text.delta and transcript.text.done when format = json or verbose_json
}
type Model ¶
type Segment ¶
type Segment struct {
Id int32 `json:"id"`
Start Timestamp `json:"start"`
End Timestamp `json:"end"`
Text string `json:"text"`
Tokens []string `json:"tokens,omitempty"` // TODO
Speaker string `json:"speaker,omitempty"` // TODO
SpeakerTurn bool `json:"speaker_turn,omitempty"` // TODO
}
type Timestamp ¶
func SecToTimestamp ¶ added in v0.0.23
func (Timestamp) MarshalJSON ¶
func (*Timestamp) UnmarshalJSON ¶ added in v0.0.23
type TranscribeMultipartRequest ¶ added in v0.0.26
type TranscribeMultipartRequest struct {
TranscribeRequest
Audio gomultipart.File `json:"audio"`
}
TranscribeMultipartRequest wraps TranscribeRequest with an audio file for multipart form handling
type TranscribeRequest ¶ added in v0.0.26
type TranscribeRequest struct {
TranslateRequest
Language *string `json:"language,omitempty" help:"Language of the audio (two-letter code)"`
}
TranscribeRequest represents a request to transcribe audio
func (*TranscribeRequest) String ¶ added in v0.0.26
func (r *TranscribeRequest) String() string
type Transcription ¶
type Transcription struct {
Task string `json:"task,omitempty"`
Language string `json:"language,omitempty" writer:",width:8"`
Duration Timestamp `json:"duration,omitempty" writer:",width:8,right"`
Text string `json:"text,omitempty" writer:",width:60,wrap"`
Segments []*Segment `json:"segments,omitempty" writer:",width:40,wrap"`
}
func (*Transcription) String ¶
func (t *Transcription) String() string
type TranslateMultipartRequest ¶ added in v0.0.26
type TranslateMultipartRequest struct {
TranslateRequest
Audio gomultipart.File `json:"audio"`
}
TranslateMultipartRequest wraps TranslateRequest with an audio file for multipart form handling
type TranslateRequest ¶ added in v0.0.26
type TranslateRequest struct {
Model string `json:"model" help:"Model ID to use for translation"`
Prompt *string `json:"prompt,omitempty" help:"Text to guide the model's style"`
Temperature *float64 `json:"temperature,omitempty" help:"Sampling temperature (0-1)"`
Stream *bool `json:"stream,omitempty" help:"Enable streaming response"`
Diarize *bool `json:"diarize,omitempty" help:"Identify and separate speakers"`
Filename *string `json:"filename,omitempty" help:"Optional filename with extension for the audio file"`
}
TranslateRequest represents a request to translate audio to English
func (*TranslateRequest) String ¶ added in v0.0.26
func (r *TranslateRequest) String() string
Click to show internal directories.
Click to hide internal directories.