dosubot[bot] commented on issue #12532:
URL: https://github.com/apache/apisix/issues/12532#issuecomment-3200105374

   <!-- Answer -->
   Based on the official documentation and plugin source code, neither the 
ai-proxy nor the ai-prompt-decorator plugins in APISIX will automatically 
append user history to the messages array or persist chat context across 
requests—they only modify the payload as explicitly configured (for example, by 
prepending a system prompt) and forward it to the upstream AI provider as 
received [reference](https://docs.api7.ai/hub/ai-prompt-decorator) 
[reference](https://docs.api7.ai/hub/ai-proxy).
   
   If the AI is recalling previous questions without them being present in the 
current messages array, this is not expected behavior from APISIX or these 
plugins. Possible causes include: (1) the client (such as Apifox) is 
automatically sending previous messages, (2) the upstream AI provider is 
maintaining session state, or (3) another plugin or middleware is modifying the 
payload.
   
   To troubleshoot, I recommend:  
   1. Enable detailed request/response logging in APISIX (e.g., with 
file-logger and include_req_body/include_resp_body) to inspect the exact 
payload sent upstream.  
   2. Try sending a single, stateless request using a minimal client like curl 
or Postman to rule out client-side session features.  
   3. Double-check that no other plugins or custom logic are active on your 
route or globally.
   
   If you share the logged upstream payload for a single request, I can help 
analyze whether history is being injected before it leaves APISIX.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/c6f1fd56-a2fc-4761-98d1-757330b48bfc?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/c6f1fd56-a2fc-4761-98d1-757330b48bfc?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/c6f1fd56-a2fc-4761-98d1-757330b48bfc?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/c6f1fd56-a2fc-4761-98d1-757330b48bfc?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/c6f1fd56-a2fc-4761-98d1-757330b48bfc?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/c6f1fd56-a2fc-4761-98d1-757330b48bfc?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/c6f1fd56-a2fc-4761-98d1-757330b48bfc?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat
 with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6aff3395-54f4-4ca2-8624-021d21c2f031/ask?utm_source=githu
 b)&nbsp;[![Join 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/apisix/issues/12532)


-- 
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

Reply via email to