only extract and record the most critical part
This commit is contained in:
parent
fe88919d48
commit
726eae05e7
@ -130,6 +130,9 @@ const (
|
||||
// https://platform.openai.com/docs/guides/vision/calculating-costs
|
||||
// https://github.com/openai/openai-cookbook/blob/05e3f9be4c7a2ae7ecf029a7c32065b024730ebe/examples/How_to_count_tokens_with_tiktoken.ipynb
|
||||
func countImageTokens(url string, detail string) (_ int, err error) {
|
||||
if !strings.HasPrefix(url, "data:image") {
|
||||
return 0, errors.New("invalid image file type")
|
||||
}
|
||||
var fetchSize = true
|
||||
var width, height int
|
||||
// Reference: https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding
|
||||
|
Loading…
Reference in New Issue
Block a user