Skip to content

Inconsistency between types and documentation for speechToText.convert #284

@nediamond

Description

@nediamond

The docstring for BodySpeechToTextV1SpeechToTextPost.file says

The file to transcribe. All major audio and video formats are supported. Exactly one of the file or cloud_storage_url parameters must be provided. The file size must be less than 3.0GB.

Similarly the docstring for BodySpeechToTextV1SpeechToTextPost.cloudStorageUrl says

The HTTPS URL of the file to transcribe. Exactly one of the file or cloud_storage_url parameters must be provided. The file must be accessible via HTTPS and the file size must be less than 2GB. Any valid HTTPS URL is accepted, including URLs from cloud storage providers (AWS S3, Google Cloud Storage, Cloudflare R2, etc.), CDNs, or any other HTTPS source. URLs can be pre-signed or include authentication tokens in query parameters.

But it is typed as

interface BodySpeechToTextV1SpeechToTextPost {
   file: core.file.Uploadable.FileLike;
   ...
   cloudStorageUrl?: string;
}

This typing indicates that file must always be present and sometimes cloudStorageUrl can be present along side it, which does not match the description and also does not allow for usage of cloudStorageUrl.

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