-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(plugins): ai-prompt-template plugin #12340
Conversation
54c6c44
to
635dad9
Compare
An http client is required to have knowledge of all of the configured templates and their respective parameters in order to make a request. What convenience is provided by having Kong store and render the templates rather than the http client? |
154afd2
to
81db037
Compare
@flrgh It is designed this way, not so much for restricting exactly what human-callers can do, but so our Kong admins can turn a complex LLM backend into a simple API for consumption from something else. |
33a6ef0
to
755f89f
Compare
755f89f
to
746c22b
Compare
Cherry-pick failed for Please cherry-pick the changes locally. git remote add upstream https://github.com/kong/kong-ee
git fetch upstream master
git worktree add -d .worktree/cherry-pick-12340-to-master-to-upstream upstream/master
cd .worktree/cherry-pick-12340-to-master-to-upstream
git checkout -b cherry-pick-12340-to-master-to-upstream
ancref=$(git merge-base 14cc90fbe83b6fb04e4ef832519bc10204f0d4bc 746c22b6316def683a6e58fb6f0453ef2a0c48ec)
git cherry-pick -x $ancref..746c22b6316def683a6e58fb6f0453ef2a0c48ec |
Summary
This plugin adds the ability to provide tuned AI prompts to users, who only need to fill in the blanks with variable placeholders (in moustache format:
{{variable}}
)It is to be used in conjunction with
ai-proxy
plugin, as with other AI Family plugins.AI-Proxy plugin
This allows prompt tuning to be started, or performed, by the experience LLM users in an organisation, and then consumed by anyone.
When activated, it looks for template references in the following forms:
Chat:
Prompt:
Based on this gateway configuration:
It has been designed to work with other formats as soon as they are supported.
It also sanitises string inputs to ensure that json control characters are escaped, preventing arbitrary prompt injection.
Checklist
changelog/unreleased/kong
orskip-changelog
label added on PR if changelog is unnecessary. README.mdIssue reference
Internal project.