-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support ak/sk auth #269
Conversation
ZingLix
commented
Feb 7, 2024
- Description: 支持应用 aksk 鉴权
- Issue: golang release 0.0.2 #260
- Dependencies: /
- Tag maintainer: @stonekim, @danielhjz, @Dobiichi-Origami.
|
||
var _authManager *AuthManager | ||
|
||
func GetAuthManager() *AuthManager { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有没有场景,AuthManager 的 Requestor 需要一些特殊设置?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
貌似没有,python目前没遇到,需要设置的参数都走GetConfig()获取
func (s *ModelResponseStream) checkResponseError() error { | ||
tokenRefreshed := false | ||
var apiError *APIError | ||
for retryCount := 0; retryCount < s.Options.LLMRetryCount || s.Options.LLMRetryCount == 0; retryCount++ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s.Options.LLMRetryCount == 0 这个重试条件建议注释一下,不然看的有点吓人
go/qianfan/base_model.go
Outdated
if err != nil { | ||
return err | ||
} | ||
if err = checkResponseError(modelApiResponse); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
圈复杂度有些高了,解下。看起来有点头晕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM