Files
FastGPT/packages/service
Octopus c0072fabbc fix(embedding): decode base64 embedding responses before vector processing (#6807)
* fix(embedding): decode base64 embedding responses before vector processing

When a model's extra body config includes `encoding_format: "base64"`, the
embedding API returns a base64-encoded IEEE 754 little-endian float32 array
instead of a `number[]`. The previous code passed this raw string directly
to `formatVectors`, which called `.reduce()` on it and threw:
  TypeError: a.reduce is not a function

Add `decodeEmbedding()` that detects base64 strings and decodes them to
`number[]` via `Buffer → Float32Array → Array.from()`, then use it in
`getVectorsByText` before calling `formatVectors`.

Fixes #6769

* perf: test

---------

Co-authored-by: octo-patch <octo-patch@github.com>
Co-authored-by: archer <545436317@qq.com>
2026-04-26 21:12:40 +08:00
..
2026-04-22 23:35:58 +08:00
2026-04-22 16:31:06 +08:00
2026-03-16 17:09:25 +08:00
2026-04-17 23:28:43 +08:00
2026-04-17 23:28:43 +08:00
2026-04-22 16:31:06 +08:00
2026-04-22 23:35:58 +08:00
2026-03-06 19:02:04 +08:00
2026-02-25 18:28:16 +08:00