Skip to content

anthropic-version: 2023-10-01 is not a valid version #285

@ianatha

Description

@ianatha

Extension

AI Writer Operation

Describe the Bug

Attempts to use that extension with Anthropic's API result in:

error\":{\"type\":\"invalid_request_error\",\"message\":\"anthropic-version: \\\"2023-10-01\\\" is not a valid version\"},\"request_id\":\"req_011CX24paaNdfCaRyUMhnjB5\"}}","status":400}
[18:30:25.936] ERROR: Request failed with status code 400
    err: {
      "type": "Error",
      "message": "Request failed with status code 400",
      "stack":
          
    }

Theat anthropic-version stanza seems to originate from https://github.com/directus-labs/extensions/blob/abba542be1b1693810723935e5a5dd27bae20d96/packages/ai-writer-operation/src/Provider/Anthropic.ts#L30C6-L30C38

Indeed https://platform.claude.com/docs/en/api/versioning indicates that there are two valid anthropic-versions:

  • 2023-01-01
  • 2023-06-01

but not 10-01.

To Reproduce

  • Create a new project using npx directus-template-cli@latest init my-project --frontend=nextjs --template=cms
  • Attempt to use the AI Ghostwriter option on "post" entity.

Directus Version

v11.4.0

Hosting Strategy

Self-Hosted (Docker Image)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions