Skip to content

Commit

Permalink
Fixed api model
Browse files Browse the repository at this point in the history
  • Loading branch information
Sara Veldhoen committed Sep 24, 2024
1 parent b40cf63 commit d6b21a8
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions apis/whisper_api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from flask import request, url_for
from flask_restx import Namespace, Resource
from flask_restx import Namespace, Resource, fields
import logging
import asyncio
from time import time
Expand All @@ -12,15 +12,18 @@
running_transcriptions: dict[str, asyncio.Task] = {}

# FIXME this model is not correct. Swagger cannot render this
# transcribe_request = api.model(
# "TranscribeRequest",
# {"doc_id": "this_is_not_a_valid_id", "location": "this_is_not_a_valid_S3_URI"},
# )
transcribe_request = api.model(
name="TranscribeRequest",
model={
"doc_id": fields.String,
"location": fields.String
},
)


@api.route("/transcribe", endpoint="Request new audio file transcription")
class TranscriptionEndpoint(Resource):
# @api.expect(transcribe_request)
@api.marshal_with(transcribe_request)
def post(self):
params = request.get_json(force=True)

Expand Down

0 comments on commit d6b21a8

Please sign in to comment.