Versions in this module Expand all Collapse all v0 v0.0.3 Mar 8, 2024 v0.0.2 Mar 4, 2024 Changes in this version + const DashscopeTokenEnvName + var ErrEmptyResponse = errors.New("empty response") + var ErrImageFilePrefix = errors.New("file prefix is not supported, must be one of: file://, https://, http://") + var ErrModelNotSet = errors.New("model is not set") + func NewQwenMessage[T qwen.IQwenContent](role string, content T) *qwen.Message[T] + type AudioInput = qwen.Input[*qwen.AudioContentList] + type AudioMessage = qwen.Message[*qwen.AudioContentList] + type AudioQwenResponse = qwen.OutputResponse[*qwen.AudioContentList] + type AudioRequest = qwen.Request[*qwen.AudioContentList] + type TextInput = qwen.Input[*qwen.TextContent] + type TextMessage = qwen.Message[*qwen.TextContent] + type TextQwenResponse = qwen.OutputResponse[*qwen.TextContent] + type TextRequest = qwen.Request[*qwen.TextContent] + type TongyiClient struct + Model string + func NewTongyiClient(model string, token string) *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 = qwen.Input[*qwen.VLContentList] + type VLMessage = qwen.Message[*qwen.VLContentList] + type VLQwenResponse = qwen.OutputResponse[*qwen.VLContentList] + type VLRequest = qwen.Request[*qwen.VLContentList] + type WrapMessageError struct + Cause error + Message string + func (e *WrapMessageError) Error() string