Backend communication #3

Open
opened 2024-06-12 13:23:20 +02:00 by erth9960 · 1 comment
Owner

The backend expects jobs to be placed on a shared filesystem path as json files. The job ID is the file name with the .json suffix stripped.

Expected keys are:

  • jobfile: An absolute path on the same shared filesystem to the file to be transcribed.
  • outputformat: The format to transcribe to. Valid values are txt, vtt, srt, tsv and json.
  • origin: Information about how the job was initiated, used for prioritization. Manual uploads via the GUI should be tagged user, uploads coming from the play service should be tagged play.
  • callback: The URL where the backend should POST the result of the transcription.

Example:

{
    "jobfile": "/data0/incoming/0c751806-6109-4e8a-9dd8-a169e0743f5f.mp4",
    "outputformat": "vtt",
    "origin": "user",
    "callback": "https://example.com/done"
}

Completed jobs will provide (via the callback) a json object representing either successful or failed transcription.

Success notifications will contain the following keys:

  • result: Success
  • resultfile: a path to the resulting file on the shared filesystem

Failure notifications will contain the following keys:

  • result: Failure
  • errormessage: The error that caused the failure.

Both types may also contain:

  • previous_attempts: An object listing previous failures to POST the notification, with attempt number, datetime and error message.
The backend expects jobs to be placed on a shared filesystem path as json files. The job ID is the file name with the .json suffix stripped. Expected keys are: * jobfile: An absolute path on the same shared filesystem to the file to be transcribed. * outputformat: The format to transcribe to. Valid values are `txt`, `vtt`, `srt`, `tsv` and `json`. * origin: Information about how the job was initiated, used for prioritization. Manual uploads via the GUI should be tagged `user`, uploads coming from the play service should be tagged `play`. * callback: The URL where the backend should POST the result of the transcription. Example: ```json { "jobfile": "/data0/incoming/0c751806-6109-4e8a-9dd8-a169e0743f5f.mp4", "outputformat": "vtt", "origin": "user", "callback": "https://example.com/done" } ``` Completed jobs will provide (via the callback) a json object representing either successful or failed transcription. Success notifications will contain the following keys: * result: `Success` * resultfile: a path to the resulting file on the shared filesystem Failure notifications will contain the following keys: * result: `Failure` * errormessage: The error that caused the failure. Both types may also contain: * previous_attempts: An object listing previous failures to POST the notification, with attempt number, datetime and error message.
Author
Owner

Example success notification with failed attempts:

{
    "result": "Success", 
    "resultfile": "/data0/done/ebafffc0-fc01-4a5a-ac77-e5e6bf768cee.vtt", 
    "previous_attempts": {
        "1": [
            "2024-06-03 13:14:06.657300", 
            "404 Client Error: Not Found for url: https://example.com/done"
        ]
    }
}
Example success notification with failed attempts: ```json { "result": "Success", "resultfile": "/data0/done/ebafffc0-fc01-4a5a-ac77-e5e6bf768cee.vtt", "previous_attempts": { "1": [ "2024-06-03 13:14:06.657300", "404 Client Error: Not Found for url: https://example.com/done" ] } } ```
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: DMC/whisper-frontend#3
No description provided.