Skip to content

Commit

Permalink
pass lint check
Browse files Browse the repository at this point in the history
  • Loading branch information
devinyf committed Jul 30, 2024
1 parent 32f3a11 commit 3773b31
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions qwen/qwen_params.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package qwen

const (
DashScopeBaseURL = "https://dashscope.aliyuncs.com/api"
DashScopeBaseURL = "https://dashscope.aliyuncs.com/api"
DashScopeIntlBaseURL = "https://dashscope-intl.aliyuncs.com/api"
QwenSubURL = "/v1/services/aigc/text-generation/generation"
QwenVLSubURL = "/v1/services/aigc/multimodal-generation/generation"
QwenAudioSubURL = QwenVLSubURL
QwenSubURL = "/v1/services/aigc/text-generation/generation"
QwenVLSubURL = "/v1/services/aigc/multimodal-generation/generation"
QwenAudioSubURL = QwenVLSubURL
)

type ModelQwen = string
Expand Down
14 changes: 7 additions & 7 deletions tongyiclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type TongyiClient struct {
httpCli httpclient.IHttpClient
wsCli *httpclient.WsClient // only used for paraformer realtime speech to text.
uploadCache qwen.UploadCacher
baseUrl string
baseURL string
}

// qwen client with default base url (CN).
Expand All @@ -43,7 +43,7 @@ func newTongyiCLientWithHTTPCli(baseURL, model, token string, httpcli httpclient
httpCli: httpcli,
token: token,
uploadCache: qwen.NewMemoryFileCache(),
baseUrl: baseURL,
baseURL: baseURL,
}
}

Expand All @@ -59,7 +59,7 @@ func (q *TongyiClient) SetUploadCache(uploadCache qwen.UploadCacher) *TongyiClie
// nolint:lll
func (q *TongyiClient) CreateCompletion(ctx context.Context, payload *qwen.Request[*qwen.TextContent]) (*TextQwenResponse, error) {
payload = payloadPreCheck(q, payload)
return genericCompletion[*qwen.TextContent, *qwen.TextContent](ctx, payload, q.httpCli, qwen.URLQwen(q.baseUrl), q.token)
return genericCompletion[*qwen.TextContent, *qwen.TextContent](ctx, payload, q.httpCli, qwen.URLQwen(q.baseURL), q.token)
}

//nolint:lll
Expand All @@ -82,7 +82,7 @@ func (q *TongyiClient) CreateVLCompletion(ctx context.Context, payload *qwen.Req
}
}

return genericCompletion[*qwen.VLContentList, *qwen.VLContentList](ctx, payload, q.httpCli, qwen.URLQwenVL(q.baseUrl), q.token)
return genericCompletion[*qwen.VLContentList, *qwen.VLContentList](ctx, payload, q.httpCli, qwen.URLQwenVL(q.baseURL), q.token)
}

//nolint:lll
Expand All @@ -106,7 +106,7 @@ func (q *TongyiClient) CreateAudioCompletion(ctx context.Context, payload *qwen.
}
}

return genericCompletion[*qwen.AudioContentList, *qwen.AudioContentList](ctx, payload, q.httpCli, qwen.URLQwenAudio(q.baseUrl), q.token)
return genericCompletion[*qwen.AudioContentList, *qwen.AudioContentList](ctx, payload, q.httpCli, qwen.URLQwenAudio(q.baseURL), q.token)
}

// used for pdf_extracter plugin.
Expand All @@ -131,7 +131,7 @@ func (q *TongyiClient) CreateFileCompletion(ctx context.Context, payload *qwen.R
}
}

return genericCompletion[*qwen.FileContentList, *qwen.TextContent](ctx, payload, q.httpCli, qwen.URLQwen(q.baseUrl), q.token)
return genericCompletion[*qwen.FileContentList, *qwen.TextContent](ctx, payload, q.httpCli, qwen.URLQwen(q.baseURL), q.token)
}

func checkIfNeedUploadFile(ctx context.Context, filepath string, model, token string, uploadCacher qwen.UploadCacher) (string, bool, error) {
Expand Down Expand Up @@ -184,7 +184,7 @@ func (q *TongyiClient) CreateImageGeneration(ctx context.Context, payload *wanx.
}
payload.Model = q.Model
}
return wanx.CreateImageGeneration(ctx, q.baseUrl, payload, q.httpCli, q.token)
return wanx.CreateImageGeneration(ctx, q.baseURL, payload, q.httpCli, q.token)
}

// voice file to text.
Expand Down

0 comments on commit 3773b31

Please sign in to comment.