Skip to content

Conversation

@Yilialinn
Copy link
Contributor

@Yilialinn Yilialinn commented Jan 13, 2026

Description

Improve the ai-prompt-template plugin doc and update the Chinese version accordingly.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. doc Documentation things labels Jan 13, 2026
@Yilialinn Yilialinn requested a review from kayx23 January 13, 2026 09:44
@kayx23 kayx23 requested a review from Copilot January 13, 2026 09:56

This comment was marked as off-topic.

@kayx23 kayx23 requested a review from Copilot January 13, 2026 09:57

This comment was marked as off-topic.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +160 to +207
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -X PATCH \
-H "X-API-KEY: ${admin_key}" \
-d '{
"uri": "/v1/chat/completions",
"upstream": {
"type": "roundrobin",
"nodes": {
"api.openai.com:443": 1
},
"scheme": "https",
"pass_host": "node"
},
"plugins": {
"ai-prompt-template": {
"templates": [
{
"name": "QnA with complexity",
"template": {
"model": "gpt-4",
"messages": [
{
"role": "system",
"content": "Answer in {{complexity}}."
},
{
"role": "user",
"content": "Explain {{prompt}}."
}
]
}
},
{
"name": "echo",
"template": {
"model": "gpt-4",
"messages": [
{
"role": "user",
"content": "Echo {{prompt}}."
}
]
}
}
]
}
}
}'
```
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proxy-rewrite plugin configuration is missing from this PATCH request, but it's required to set the Authorization header with the OpenAI API key. Since this is a PATCH request that only updates the ai-prompt-template plugin, the Authorization header from the previous configuration may not be preserved. Users following this example after the first example would lose authentication and get API errors. Consider either using PUT to include the full configuration or adding a note that the proxy-rewrite configuration from the previous example is still active.

Copilot uses AI. Check for mistakes.
@apache apache deleted a comment from Copilot AI Jan 13, 2026
@apache apache deleted a comment from Copilot AI Jan 13, 2026
Yilialinn and others added 4 commits January 14, 2026 17:46
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Traky Deng <trakydeng@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Documentation things size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants