LiteSun commented on code in PR #12036: URL: https://github.com/apache/apisix/pull/12036#discussion_r2005035105
########## docs/en/latest/plugins/ai-request-rewrite.md: ########## @@ -0,0 +1,167 @@ +--- +title: ai-request-rewrite +keywords: + - Apache APISIX + - API Gateway + - Plugin + - ai-request-rewrite +description: This document contains information about the Apache APISIX ai-request-rewrite Plugin. +--- + +<!-- +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +--> + +## Description + +The `ai-request-rewrite` plugin leverages predefined prompts and AI services to intelligently modify client requests, enabling AI-powered content transformation before forwarding to upstream services. + +## Plugin Attributes + +| **Field** | **Required** | **Type** | **Description** | +| ------------------------- | ------------ | -------- | ------------------------------------------------------------------------------------ | +| prompt | Yes | String | The prompt send to AI service. | +| provider | Yes | String | Type of the AI service. | +| auth | Yes | Object | Authentication configuration | +| auth.header | No | Object | Authentication headers. Key must match pattern `^[a-zA-Z0-9._-]+$`. | +| auth.query | No | Object | Authentication query parameters. Key must match pattern `^[a-zA-Z0-9._-]+$`. | +| options | No | Object | Key/value settings for the model | +| options.model | No | String | Model to execute. | +| override.endpoint | No | String | To be specified to override the endpoint of the AI service | +| timeout | No | Integer | Timeout in milliseconds for requests to AI service. Range: 1 - 60000. Default: 3000 | Review Comment: Timeout is the total of connect, read, and send timeout durations, I created a issue to improve this in the future https://github.com/apache/apisix/issues/12072, -- 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