mosoodocs

エラーと制限

mosoo API のエラー、再試行、idempotency、public API limit を処理します。

2xx 以外のすべての JSON error は同じ envelope を使用します。

{
  "error": {
    "code": "invalid_request",
    "message": "Request body must be an object."
  }
}

error.message ではなく error.code で branch してください。message は developer 向けであり、end user に直接表示すべきではありません。

Error code

HTTPerror.codeCaller の対応
400invalid_requestrequest shape、field value、body size、unsupported field を修正します。変更せずに retry しないでください。
400invalid_jsonserialization または Content-Type を修正します。
401unauthenticatedAuthorization を確認し、API token を rotate または再作成します。
403forbiddenAPI token がこの Agent、Thread、file に access できるか確認します。
404not_foundID が存在し、この API token から見えることを確認します。
409agent_not_publishedAgent を公開し、API access を有効にします。
409service_inactivemosoo で Agent を再公開または修復します。
409readiness_blockedmosoo で Agent readiness または configuration を修正します。
409idempotency_conflict処理中なら Retry-After まで待ち、body が異なる場合は新しい key を使用します。
429rate_limitedbackoff し、Retry-After の後に retry します。
500internal_error短時間の backoff で retry し、繰り返す場合は failure detail を保存します。

Idempotency

Idempotency-Key は次でサポートされます。

  • POST /agents/{agentId}/threads
  • POST /threads/{threadId}/events

ルール:

  • key の scope は API token、method、route、request body です。
  • 同じ request に同じ key を再使用すると、保存済み response が replay されます。
  • 異なる request に同じ key を使用すると 409 idempotency_conflict が返ります。
  • 最初の request が処理中に key を再使用すると 409 idempotency_conflict が返ります。
  • key は空でなく、128 文字以下である必要があります。
  • conflict response には Retry-After が含まれる場合があります。

Public limit

Limit
Create Thread input text32000 文字
userId255 文字
File ID26 文字
File upload67108864 bytes
Event list default100 events
Event list maximum1000 events
Thread list maximum100 Threads

On this page