-
Notifications
You must be signed in to change notification settings - Fork 53
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: Go SDK 添加 Tokenizer
并且支持 ChatCompletion
的 Messages
截断逻辑
#583
Conversation
"UNSPECIFIED_MODEL": {MaxInputChars: 0, MaxInputTokens: 0}, | ||
} | ||
|
||
var limitMapInEndpoint = map[string]inputLimitInfo{ |
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.
这个是不是只维护到endpoint->model的映射就好了
go/qianfan/chat_completion.go
Outdated
|
||
if (limit.MaxInputTokens > 0 && totalMessageTokens > limit.MaxInputTokens) || | ||
(limit.MaxInputChars > 0 && totalMessageChars > limit.MaxInputChars) { | ||
return |
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.
break?
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.
done
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.
others LGTM
Go SDK 添加
Tokenizer
并且支持ChatCompletion
的Messages
截断逻辑