Retrieve generation

GET /generations/{id}

返回指定题目生成任务的详细信息。

Path parameters

  • id string Required

    Format should match the following pattern: ^gen-.

Responses

  • 200 application/json

    generation found

    Hide response attributes Show response attributes object
    • id string

      Format should match the following pattern: ^gen-.

    • object string

      Value is generation.

    • created_at string(date-time)
    • finished_at string(date-time) | null
    • status string

      Values are queued, generating, succeeded, failed, or cancelled.

    • creation_type string Required

      Values are knowledge_base, question_bank, or oneline.

    • prompt string

      Maximum length is 256.

    • content string

      Maximum length is 100000.

    • file object

      Additional properties are allowed.

      Hide file attributes Show file attributes object
    • question_rules array[object]
      Hide question_rules attributes Show question_rules attributes object
      • type string Required

        Values are single_choice, multiple_choice, or true_or_false.

      • count integer Required
    • metadata object | null

      Additional properties are allowed.

  • 404 application/json

    generation not found

GET /generations/{id}
curl \
 -X GET https://v5.jinshuju.net/exam/api/generations/{id}
Response examples (200)
{
  "id": "gen-6757a41fe88e5d8d2a0bbc7e",
  "object": "generation",
  "status": "generating",
  "content": "content",
  "metadata": null,
  "created_at": "2024-12-10T10:14:55.556+08:00",
  "finished_at": null,
  "creation_type": "oneline",
  "question_rules": []
}
Response examples (404)
{
  "error": {
    "type": "invalid_request_error",
    "message": "No such Generation object: invalid"
  }
}