speech

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChunkAudioDelta

type ChunkAudioDelta[T any] struct {
	Type  T      `json:"type"`
	Audio string `json:"audio"`
}

type ChunkAudioDone

type ChunkAudioDone[T any] struct {
	Type  T     `json:"type"`
	Usage Usage `json:"usage"`
}

type ChunkTypeAudioDelta

type ChunkTypeAudioDelta string

func (*ChunkTypeAudioDelta) MarshalJSON

func (m *ChunkTypeAudioDelta) MarshalJSON() ([]byte, error)

func (*ChunkTypeAudioDelta) UnmarshalJSON

func (m *ChunkTypeAudioDelta) UnmarshalJSON(buf []byte) error

func (*ChunkTypeAudioDelta) Value

func (m *ChunkTypeAudioDelta) Value() string

type ChunkTypeAudioDone

type ChunkTypeAudioDone string

func (*ChunkTypeAudioDone) MarshalJSON

func (m *ChunkTypeAudioDone) MarshalJSON() ([]byte, error)

func (*ChunkTypeAudioDone) UnmarshalJSON

func (m *ChunkTypeAudioDone) UnmarshalJSON(buf []byte) error

func (*ChunkTypeAudioDone) Value

func (m *ChunkTypeAudioDone) Value() string

type Request

type Request struct {
	Input          string  `json:"input"`
	Model          string  `json:"model"`
	Voice          string  `json:"voice"`
	Instruction    *string `json:"instruction,omitempty"`
	ResponseFormat *string `json:"response_format,omitempty"`
	Speed          *int    `json:"speed,omitempty"`
	StreamFormat   *string `json:"stream_format,omitempty"`
}

func (*Request) IsStreamingRequest

func (r *Request) IsStreamingRequest() bool

type Response

type Response struct {
	Audio       []byte         `json:"audio"`
	ContentType string         `json:"content_type"`
	Usage       Usage          `json:"usage"`
	RawFields   map[string]any `json:"raw_fields"`
}

type ResponseChunk

type ResponseChunk struct {
	OfAudioDelta *ChunkAudioDelta[ChunkTypeAudioDelta] `json:",omitempty"`
	OfAudioDone  *ChunkAudioDone[ChunkTypeAudioDone]   `json:",omitempty"`
}

type StringConstant

type StringConstant interface {
	Value() string
}

type Usage

type Usage struct {
	InputTokens        int `json:"input_tokens"`
	InputTokensDetails struct {
		CachedTokens int `json:"cached_tokens"`
	} `json:"input_tokens_details"`
	OutputTokens        int `json:"output_tokens"`
	OutputTokensDetails struct {
		ReasoningTokens int `json:"reasoning_tokens"`
	} `json:"output_tokens_details"`
	TotalTokens int `json:"total_tokens"`
}

Jump to

Keyboard shortcuts

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