Skip to content

https://developer.konghq.com/plugins/ai-proxy/examples/sdk-two-routes/#openai-sdk-multi-provider-chat-routing #14764

@mark0725

Description

@mark0725

Is there an existing issue for this?

  • I have searched the existing issues

Kong version ($ kong version)

Kong 3.11

Current Behavior

Report an error when executing the command according to the documentation.
https://developer.konghq.com/plugins/ai-proxy/examples/sdk-two-routes/#openai-sdk-multi-provider-chat-routing

curl -i -X POST http://localhost:8001/plugins/ \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --data '
    {
      "name": "ai-proxy",
      "config": [
        {
          "route_type": "llm/v1/chat",
          "auth": {
            "header_name": "Authorization",
            "header_value": "'$COHERE_API_KEY'"
          },
          "logging": {
            "log_statistics": true,
            "log_payloads": false
          },
          "model": {
            "provider": "openai",
            "name": "$(uri_captures.model)"
          }
        },
        {
          "route_type": "llm/v1/chat",
          "auth": {
            "header_name": "Authorization",
            "header_value": "'$MISTRAL_API_KEY'"
          },
          "logging": {
            "log_statistics": true,
            "log_payloads": false
          },
          "model": {
            "provider": "mistral",
            "name": "$(uri_captures.model)"
          }
        }
      ]
    }
    '

result: error: {"message":"An unexpected error occurred"}

Expected Behavior

No response

Steps To Reproduce

No response

Anything else?

The AI proxy plugin config does not support arrays. What is the documentation based on?

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending author feedbackWaiting for the issue author to get back to a maintainer with findings, more details, etc...

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions