deepgram.clients.analyze.v1.helpers
1# Copyright 2023-2024 Deepgram SDK contributors. All Rights Reserved. 2# Use of this source code is governed by a MIT license that can be found in the LICENSE file. 3# SPDX-License-Identifier: MIT 4 5from .options import AnalyzeSource 6 7 8def is_buffer_source(provided_source: AnalyzeSource) -> bool: 9 """ 10 Check if the provided source is a buffer source. 11 """ 12 return "buffer" in provided_source 13 14 15def is_readstream_source(provided_source: AnalyzeSource) -> bool: 16 """ 17 Check if the provided source is a readstream source. 18 """ 19 return "stream" in provided_source 20 21 22def is_url_source(provided_source: AnalyzeSource) -> bool: 23 """ 24 Check if the provided source is a url source. 25 """ 26 return "url" in provided_source
def
is_buffer_source( provided_source: Union[deepgram.clients.common.UrlSource, deepgram.clients.common.TextSource, deepgram.clients.common.BufferSource, deepgram.clients.common.StreamSource]) -> bool:
9def is_buffer_source(provided_source: AnalyzeSource) -> bool: 10 """ 11 Check if the provided source is a buffer source. 12 """ 13 return "buffer" in provided_source
Check if the provided source is a buffer source.
def
is_readstream_source( provided_source: Union[deepgram.clients.common.UrlSource, deepgram.clients.common.TextSource, deepgram.clients.common.BufferSource, deepgram.clients.common.StreamSource]) -> bool:
16def is_readstream_source(provided_source: AnalyzeSource) -> bool: 17 """ 18 Check if the provided source is a readstream source. 19 """ 20 return "stream" in provided_source
Check if the provided source is a readstream source.
def
is_url_source( provided_source: Union[deepgram.clients.common.UrlSource, deepgram.clients.common.TextSource, deepgram.clients.common.BufferSource, deepgram.clients.common.StreamSource]) -> bool:
23def is_url_source(provided_source: AnalyzeSource) -> bool: 24 """ 25 Check if the provided source is a url source. 26 """ 27 return "url" in provided_source
Check if the provided source is a url source.