branch: externals/llm
commit 0b361e8b35099ce3a54e1ef8a5c99bc050302723
Author: Andrew Hyatt <ahy...@gmail.com>
Commit: GitHub <nore...@github.com>

    Fix request error on Open AI batch embeddings (#197)
---
 NEWS.org      | 1 +
 llm-openai.el | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/NEWS.org b/NEWS.org
index b40c3e2099..43a7631be1 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -1,5 +1,6 @@
 * Version 0.26.1
 - Add Claude 4 models
+- Fix error using Open AI for batch embeddings
 * Version 0.26.0
 - Call tools with =nil= when called with false JSON values.
 - Fix bug in ollama batch embedding generation.
diff --git a/llm-openai.el b/llm-openai.el
index 6339fedc78..9d8f98dee0 100644
--- a/llm-openai.el
+++ b/llm-openai.el
@@ -72,7 +72,9 @@ https://api.example.com/v1/chat, then URL should be
 (cl-defmethod llm-provider-embedding-request ((provider llm-openai) 
string-or-list)
   "Return the request to the server for the embedding of STRING-OR-LIST.
 PROVIDER is the Open AI provider struct."
-  `(:input ,string-or-list
+  `(:input ,(if (listp string-or-list)
+                (apply #'vector string-or-list)
+              string-or-list)
            :model ,(llm-openai-embedding-model provider)))
 
 (cl-defmethod llm-provider-batch-embeddings-request ((provider llm-openai) 
batch)

Reply via email to