Pular para o conteúdo principal
PUT
/
api
/
v1
/
llm
/
guardrails
Python (SDK)
from openapi import SDK


with SDK(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.guardrails.update_guardrails(guardrails=[
        {
            "mode": "ban_words",
            "config": {
                "words": [
                    "spam",
                    "inappropriate",
                ],
            },
        },
    ])

    # Handle response
    print(res)
{
  "object": "guardrails_settings",
  "guardrails": [
    {
      "mode": "ban_words",
      "enabled": true,
      "config": {
        "words": [
          "spam",
          "inappropriate"
        ]
      }
    }
  ],
  "updated_at": 1704067200
}

Autorizações

Authorization
string
header
obrigatório

Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.

Corpo

application/json
guardrails
object[]
obrigatório

Lista de guardrails para configurar

Resposta

200 - application/json

OK

object
any
obrigatório
guardrails
object[]
obrigatório
updated_at
number
obrigatório

Timestamp Unix de quando as configurações foram atualizadas