Skip to content

feat: ai-prompt-template plugin#11517

Merged
shreemaan-abhishek merged 16 commits into
apache:masterfrom
shreemaan-abhishek:prompt-template
Aug 29, 2024
Merged

feat: ai-prompt-template plugin#11517
shreemaan-abhishek merged 16 commits into
apache:masterfrom
shreemaan-abhishek:prompt-template

Conversation

@shreemaan-abhishek

@shreemaan-abhishek shreemaan-abhishek commented Aug 21, 2024

Copy link
Copy Markdown
Contributor

Description

Implement ai-prompt-template plugin.

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)

@shreemaan-abhishek
shreemaan-abhishek marked this pull request as ready for review August 21, 2024 09:30
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. doc Documentation things enhancement New feature or request plugin labels Aug 21, 2024
@bzp2010
bzp2010 self-requested a review August 23, 2024 05:43

@bzp2010 bzp2010 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment thread apisix/plugins/ai-prompt-template.lua
Comment thread apisix/plugins/ai-prompt-template.lua Outdated
Comment thread apisix/plugins/ai-prompt-template.lua
@bzp2010
bzp2010 self-requested a review August 28, 2024 03:15
bzp2010
bzp2010 previously approved these changes Aug 28, 2024

@bzp2010 bzp2010 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code LGTM

@bzp2010
bzp2010 requested a review from kayx23 August 28, 2024 03:44

## Description

The `ai-prompt-template` plugin simplifies access to AI providers and models by predefining the request format

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
The `ai-prompt-template` plugin simplifies access to AI providers and models by predefining the request format
The `ai-prompt-template` plugin simplifies access to LLM providers, such as OpenAI and Anthropic, and their models by predefining the request format

## Description

The `ai-prompt-template` plugin simplifies access to AI providers and models by predefining the request format
using a template and allowing users to pass only the values for template variables.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
using a template and allowing users to pass only the values for template variables.
using a template, which only allows users to pass customized values into template variables.

| ------------------------------------- | -------- | --------------------------------------------------- | ------------ |
| `templates` | Array | An array of template objects | Yes |
| `templates.name` | String | Name of the template. | Yes |
| `templates.template.model` | String | Model of the AI Model. Example: gpt-4, gpt-3.5 | Yes |

@kayx23 kayx23 Aug 28, 2024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
| `templates.template.model` | String | Model of the AI Model. Example: gpt-4, gpt-3.5 | Yes |
| `templates.template.model` | String | Model of the AI Model, for example `gpt-4` or `gpt-3.5`. See your LLM provider API documentation for more available models. | Yes |

Comment thread docs/en/latest/plugins/ai-prompt-template.md
Comment thread docs/en/latest/plugins/ai-prompt-template.md Outdated
moonming
moonming previously approved these changes Aug 28, 2024
@shreemaan-abhishek
shreemaan-abhishek dismissed stale reviews from moonming and bzp2010 via c46944f August 28, 2024 17:06

@kayx23 kayx23 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

doc LGTM

@shreemaan-abhishek
shreemaan-abhishek merged commit e775640 into apache:master Aug 29, 2024
@shreemaan-abhishek
shreemaan-abhishek deleted the prompt-template branch August 29, 2024 07:43
shreemaan-abhishek added a commit to shreemaan-abhishek/apisix that referenced this pull request Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Documentation things enhancement New feature or request plugin size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants