File tree Expand file tree Collapse file tree
apisix/plugins/ai-providers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515-- limitations under the License.
1616--
1717
18- local function rewrite_max_tokens (body , override , force )
18+ local function rewrite_request_body (body , override , force )
1919 if override .max_tokens then
2020 if force or body .max_tokens == nil then
2121 body .max_tokens = override .max_tokens
@@ -30,7 +30,7 @@ return require("apisix.plugins.ai-providers.base").new(
3030 capabilities = {
3131 [" openai-chat" ] = {
3232 path = " /chat/completions" ,
33- rewrite_request_body = rewrite_max_tokens ,
33+ rewrite_request_body = rewrite_request_body ,
3434 },
3535 },
3636 }
Original file line number Diff line number Diff line change 1515-- limitations under the License.
1616--
1717
18- local function rewrite_max_tokens (body , override , force )
18+ local function rewrite_request_body (body , override , force )
1919 if override .max_tokens then
2020 if force or body .max_tokens == nil then
2121 body .max_tokens = override .max_tokens
@@ -30,11 +30,11 @@ return require("apisix.plugins.ai-providers.base").new(
3030 capabilities = {
3131 [" openai-chat" ] = {
3232 path = " /v1/chat/completions" ,
33- rewrite_request_body = rewrite_max_tokens ,
33+ rewrite_request_body = rewrite_request_body ,
3434 },
3535 [" anthropic-messages" ] = {
3636 path = " /v1/messages" ,
37- rewrite_request_body = rewrite_max_tokens ,
37+ rewrite_request_body = rewrite_request_body ,
3838 },
3939 },
4040 }
Original file line number Diff line number Diff line change 1515-- limitations under the License.
1616--
1717
18- local function rewrite_max_tokens (body , override , force )
18+ local function rewrite_request_body (body , override , force )
1919 if override .max_tokens then
2020 if force or body .max_tokens == nil then
2121 body .max_tokens = override .max_tokens
@@ -30,7 +30,7 @@ return require("apisix.plugins.ai-providers.base").new(
3030 capabilities = {
3131 [" openai-chat" ] = {
3232 path = " /completions" ,
33- rewrite_request_body = rewrite_max_tokens ,
33+ rewrite_request_body = rewrite_request_body ,
3434 },
3535 },
3636 }
Original file line number Diff line number Diff line change 1515-- limitations under the License.
1616--
1717
18- local function rewrite_max_tokens (body , override , force )
18+ local function rewrite_request_body (body , override , force )
1919 if override .max_tokens then
2020 if force or body .max_tokens == nil then
2121 body .max_tokens = override .max_tokens
@@ -30,7 +30,7 @@ return require("apisix.plugins.ai-providers.base").new(
3030 capabilities = {
3131 [" openai-chat" ] = {
3232 path = " /chat/completions" ,
33- rewrite_request_body = rewrite_max_tokens ,
33+ rewrite_request_body = rewrite_request_body ,
3434 },
3535 },
3636 }
Original file line number Diff line number Diff line change 1515-- limitations under the License.
1616--
1717
18- local function rewrite_max_tokens (body , override , force )
18+ local function rewrite_request_body (body , override , force )
1919 if override .max_tokens then
2020 if force or body .max_completion_tokens == nil then
2121 body .max_completion_tokens = override .max_tokens
@@ -30,7 +30,7 @@ return require("apisix.plugins.ai-providers.base").new(
3030 capabilities = {
3131 [" openai-chat" ] = {
3232 path = " /v1beta/openai/chat/completions" ,
33- rewrite_request_body = rewrite_max_tokens ,
33+ rewrite_request_body = rewrite_request_body ,
3434 },
3535 },
3636 }
Original file line number Diff line number Diff line change 1515-- limitations under the License.
1616--
1717
18- local function rewrite_max_tokens (body , override , force )
18+ local function rewrite_request_body (body , override , force )
1919 if override .max_tokens then
2020 if force or body .max_tokens == nil then
2121 body .max_tokens = override .max_tokens
@@ -30,7 +30,7 @@ return require("apisix.plugins.ai-providers.base").new(
3030 capabilities = {
3131 [" openai-chat" ] = {
3232 path = " /api/v1/chat/completions" ,
33- rewrite_request_body = rewrite_max_tokens ,
33+ rewrite_request_body = rewrite_request_body ,
3434 },
3535 },
3636 }
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ local function get_node(instance_conf)
5454end
5555
5656
57- local function rewrite_max_tokens (body , override , force )
57+ local function rewrite_request_body (body , override , force )
5858 if override .max_tokens then
5959 if force or body .max_completion_tokens == nil then
6060 body .max_completion_tokens = override .max_tokens
@@ -74,7 +74,7 @@ return require("apisix.plugins.ai-providers.base").new({
7474 return get_chat_completions_path (conf .project_id , conf .region )
7575 end
7676 end ,
77- rewrite_request_body = rewrite_max_tokens ,
77+ rewrite_request_body = rewrite_request_body ,
7878 },
7979 [" vertex-predict" ] = {
8080 host = function (conf )
You can’t perform that action at this time.
0 commit comments