Package videosdk.plugins.cometapi
Sub-modules
videosdk.plugins.cometapi.llmvideosdk.plugins.cometapi.sttvideosdk.plugins.cometapi.tts
Classes
class CometAPILLM (*,
api_key: str | None = None,
model: str = 'gpt-4o-mini',
temperature: float = 0.7,
max_completion_tokens: int | None = None)-
Expand source code
class CometAPILLM(OpenAILLM): def __init__( self, *, api_key: str | None = None, model: str = "gpt-4o-mini", temperature: float = 0.7, max_completion_tokens: int | None = None, ) -> None: """Initialize the CometAPI LLM plugin. Args: api_key (Optional[str], optional): CometAPI API key. Defaults to None. model (str): The model to use for the LLM plugin. Defaults to "gpt-4o-mini". temperature (float): The temperature to use for the LLM plugin. Defaults to 0.7. max_completion_tokens (Optional[int], optional): The maximum completion tokens to use for the LLM plugin. Defaults to None. """ super().__init__( api_key=api_key or os.getenv("COMETAPI_API_KEY"), model=model, base_url="https://api.cometapi.com/v1/", temperature=temperature, max_completion_tokens=max_completion_tokens, )Base class for LLM implementations.
Initialize the CometAPI LLM plugin.
Args
api_key:Optional[str], optional- CometAPI API key. Defaults to None.
model:str- The model to use for the LLM plugin. Defaults to "gpt-4o-mini".
temperature:float- The temperature to use for the LLM plugin. Defaults to 0.7.
max_completion_tokens:Optional[int], optional- The maximum completion tokens to use for the LLM plugin. Defaults to None.
Ancestors
- videosdk.plugins.openai.llm.OpenAILLM
- videosdk.agents.llm.llm.LLM
- videosdk.agents.event_emitter.EventEmitter
- typing.Generic
class CometAPISTT (*,
api_key: str | None = None,
model: str = 'whisper-1',
prompt: str | None = None,
language: str = 'en')-
Expand source code
class CometAPISTT(OpenAISTT): def __init__( self, *, api_key: str | None = None, model: str = "whisper-1", prompt: str | None = None, language: str = "en", ) -> None: """Initialize the CometAPI STT plugin. Args: api_key (Optional[str], optional): CometAPI API key. Defaults to None. model (str): The model to use for the STT plugin. Defaults to "whisper-1". prompt (Optional[str], optional): The prompt for the STT plugin. Defaults to None. language (str): The language to use for the STT plugin. Defaults to "en". """ super().__init__( api_key=api_key or os.getenv("COMETAPI_API_KEY"), model=model, base_url="https://api.cometapi.com/v1/", prompt=prompt, language=language, enable_streaming=False, )Base class for Speech-to-Text implementations
Initialize the CometAPI STT plugin.
Args
api_key:Optional[str], optional- CometAPI API key. Defaults to None.
model:str- The model to use for the STT plugin. Defaults to "whisper-1".
prompt:Optional[str], optional- The prompt for the STT plugin. Defaults to None.
language:str- The language to use for the STT plugin. Defaults to "en".
Ancestors
- videosdk.plugins.openai.stt.OpenAISTT
- videosdk.agents.stt.stt.STT
- videosdk.agents.event_emitter.EventEmitter
- typing.Generic
class CometAPITTS (*,
api_key: str | None = None,
model: str = 'tts-1',
voice: str = 'alloy',
speed: float = 1.0,
response_format: str = 'pcm')-
Expand source code
class CometAPITTS(OpenAITTS): def __init__( self, *, api_key: str | None = None, model: str = "tts-1", voice: str = "alloy", speed: float = 1.0, response_format: str = "pcm", ) -> None: """Initialize the CometAPI TTS plugin. Args: api_key (Optional[str], optional): CometAPI API key. Defaults to None. model (str): The model to use for the TTS plugin. Defaults to "tts-1". voice (str): The voice to use for the TTS plugin. Defaults to "alloy". speed (float): The speed to use for the TTS plugin. Defaults to 1.0. response_format (str): The response format to use for the TTS plugin. Defaults to "pcm". """ super().__init__( api_key=api_key or os.getenv("COMETAPI_API_KEY"), model=model, voice=voice, speed=speed, base_url="https://api.cometapi.com/v1/", response_format=response_format, )Base class for Text-to-Speech implementations
Initialize the CometAPI TTS plugin.
Args
api_key:Optional[str], optional- CometAPI API key. Defaults to None.
model:str- The model to use for the TTS plugin. Defaults to "tts-1".
voice:str- The voice to use for the TTS plugin. Defaults to "alloy".
speed:float- The speed to use for the TTS plugin. Defaults to 1.0.
response_format:str- The response format to use for the TTS plugin. Defaults to "pcm".
Ancestors
- videosdk.plugins.openai.tts.OpenAITTS
- videosdk.agents.tts.tts.TTS
- videosdk.agents.event_emitter.EventEmitter
- typing.Generic