Hello Everyone, thanks a lot for the great framewo...
# ask-for-help
a
Hello Everyone, thanks a lot for the great framework! 🙂 I'm build a Transcription Service with an endpoint that requests a file and many other parameters:
Copy code
@bentoml.api(route="/v1/audio/transcriptions")
def transcribe(
    self,
    file: Annotated[Path, ContentType("audio/mpeg")],
    model: Optional[ModelName] = Field(),
    language: Optional[Language] = Field(),
    prompt: Optional[float] = Field(),
    response_format: Optional[ResponseFormat] = Field(),
    temperature: Optional[Union[float, List[float]]] = Field(),
    timestamp_granularities: Optional[List[TimestampGranularity]] = Field()
)
Now, because the file is sent together with all the other parameters, the request generated by the Swagger UI is of
Content-Type: multipart/form-data
. So far so good, what does not work is to send a list of
timestamp_granularities
or a list of
temperature
from the Swagger UI because the list is passed as comma-separated-values (word,segment).
Copy code
curl -X 'POST' \
  '<http://localhost:8002/v1/audio/transcriptions>' \
  -H 'accept: text/plain' \
  -H 'Content-Type: multipart/form-data' \
  -F 'file=@example_audio.mp3;type=audio/mpeg' \
  -F 'timestamp_granularities=word,segment'
Is there either a way to pass a list instead of comma-separated-values or alternatively access the request-context and split the csv up myself? Thanks a lot in advance!!
j
Hello, maybe can you be more specific for us to help understand your usecas. What will be your expected behaviour and is there any blocker with the current behaviour for your workflow?