nic-6443 commented on code in PR #14073:
URL: https://github.com/apache/apisix/pull/14073#discussion_r4408061191


##########
apisix/plugins/ai-prompt-guard.lua:
##########
@@ -142,11 +142,20 @@ function _M.access(conf, ctx)
         return
     end
 
-    local messages = protocols.get_messages(json_body, ctx)
+    local messages
+    if proto_name == "openai-embeddings" then
+        local contents = 
protocols.get(proto_name).extract_request_content(json_body)
+        messages = {}
+        for i, content in ipairs(contents) do
+            messages[i] = {role = "user", content = content}
+        end

Review Comment:
   Should this piece of code be placed in the `get_messages` function of 
apisix/plugins/ai-protocols/openai-embeddings.lua?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to