hanqingwu commented on issue #12532: URL: https://github.com/apache/apisix/issues/12532#issuecomment-3200358880
I think ai-prompt-decorator.lua should not append history . ``` local function decorate(conf, body_tab) local new_messages = conf.prepend or EMPTY for _, message in pairs(body_tab.messages) do core.table.insert_tail(new_messages, message) end for _, message in pairs(conf.append or EMPTY) do core.table.insert_tail(new_messages, message) end body_tab.messages = new_messages end function _M.insert_tail(tab, ...) local idx = #tab for i = 1, select('#', ...) do idx = idx + 1 tab[idx] = select(i, ...) end return idx end ``` -- 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: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org