Documentation
¶
Index ¶
- Constants
- Variables
- func NewQwenMessage[T qwen.IQwenContent](role string, content T) *qwen.Message[T]
- type AudioInput
- type AudioMessage
- type AudioQwenResponse
- type AudioRequest
- type TextInput
- type TextMessage
- type TextQwenResponse
- type TextRequest
- type TongyiClient
- func (q *TongyiClient) CreateAudioCompletion(ctx context.Context, payload *qwen.Request[*qwen.AudioContentList]) (*AudioQwenResponse, error)
- func (q *TongyiClient) CreateCompletion(ctx context.Context, payload *qwen.Request[*qwen.TextContent]) (*TextQwenResponse, error)
- func (q *TongyiClient) CreateEmbedding(ctx context.Context, r *embedding.Request) ([][]float32, error)
- func (q *TongyiClient) CreateImageGeneration(ctx context.Context, payload *wanx.ImageSynthesisRequest) ([]*wanx.ImgBlob, error)
- func (q *TongyiClient) CreateSpeechToTextGeneration(ctx context.Context, request *paraformer.Request, reader *bufio.Reader) error
- func (q *TongyiClient) CreateVLCompletion(ctx context.Context, payload *qwen.Request[*qwen.VLContentList]) (*VLQwenResponse, error)
- type VLInput
- type VLMessage
- type VLQwenResponse
- type VLRequest
- type WrapMessageError
Constants ¶
View Source
const (
DashscopeTokenEnvName = "DASHSCOPE_API_KEY" //nolint:gosec
)
Variables ¶
Functions ¶
func NewQwenMessage ¶
func NewQwenMessage[T qwen.IQwenContent](role string, content T) *qwen.Message[T]
Types ¶
type AudioInput ¶
type AudioInput = qwen.Input[*qwen.AudioContentList]
type AudioMessage ¶
type AudioMessage = qwen.Message[*qwen.AudioContentList]
type AudioQwenResponse ¶
type AudioQwenResponse = qwen.OutputResponse[*qwen.AudioContentList]
type AudioRequest ¶
type AudioRequest = qwen.Request[*qwen.AudioContentList]
type TextMessage ¶
type TextMessage = qwen.Message[*qwen.TextContent]
type TextQwenResponse ¶
type TextQwenResponse = qwen.OutputResponse[*qwen.TextContent]
type TextRequest ¶
type TextRequest = qwen.Request[*qwen.TextContent]
type TongyiClient ¶
type TongyiClient struct { Model string // contains filtered or unexported fields }
func NewTongyiClient ¶
func NewTongyiClient(model string, token string) *TongyiClient
func (*TongyiClient) CreateAudioCompletion ¶
func (q *TongyiClient) CreateAudioCompletion(ctx context.Context, payload *qwen.Request[*qwen.AudioContentList]) (*AudioQwenResponse, error)
func (*TongyiClient) CreateCompletion ¶
func (q *TongyiClient) CreateCompletion(ctx context.Context, payload *qwen.Request[*qwen.TextContent]) (*TextQwenResponse, error)
duplicate: CreateCompletion and CreateVLCompletion are the same but with different payload types. maybe this can be change in the future.
nolint:lll
func (*TongyiClient) CreateEmbedding ¶
func (*TongyiClient) CreateImageGeneration ¶
func (q *TongyiClient) CreateImageGeneration(ctx context.Context, payload *wanx.ImageSynthesisRequest) ([]*wanx.ImgBlob, error)
TODO: intergrate wanx.Request into qwen.IQwenContent(or should rename to ITongyiContent)
func (*TongyiClient) CreateSpeechToTextGeneration ¶
func (q *TongyiClient) CreateSpeechToTextGeneration(ctx context.Context, request *paraformer.Request, reader *bufio.Reader) error
func (*TongyiClient) CreateVLCompletion ¶
func (q *TongyiClient) CreateVLCompletion(ctx context.Context, payload *qwen.Request[*qwen.VLContentList]) (*VLQwenResponse, error)
type VLQwenResponse ¶
type VLQwenResponse = qwen.OutputResponse[*qwen.VLContentList]
type WrapMessageError ¶
func (*WrapMessageError) Error ¶
func (e *WrapMessageError) Error() string
Click to show internal directories.
Click to hide internal directories.