videosdk-plugins-cometapi 0.0.40__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- videosdk_plugins_cometapi-0.0.40/.gitignore +19 -0
- videosdk_plugins_cometapi-0.0.40/PKG-INFO +26 -0
- videosdk_plugins_cometapi-0.0.40/README.md +9 -0
- videosdk_plugins_cometapi-0.0.40/pyproject.toml +32 -0
- videosdk_plugins_cometapi-0.0.40/videosdk/plugins/cometapi/__init__.py +9 -0
- videosdk_plugins_cometapi-0.0.40/videosdk/plugins/cometapi/llm.py +27 -0
- videosdk_plugins_cometapi-0.0.40/videosdk/plugins/cometapi/stt.py +29 -0
- videosdk_plugins_cometapi-0.0.40/videosdk/plugins/cometapi/tts.py +36 -0
- videosdk_plugins_cometapi-0.0.40/videosdk/plugins/cometapi/version.py +1 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: videosdk-plugins-cometapi
|
|
3
|
+
Version: 0.0.40
|
|
4
|
+
Summary: VideoSDK Agent Framework plugin for CometAPI services
|
|
5
|
+
Author: videosdk
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Keywords: ai,audio,cometapi,video,videosdk
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Topic :: Communications :: Conferencing
|
|
11
|
+
Classifier: Topic :: Multimedia :: Sound/Audio
|
|
12
|
+
Classifier: Topic :: Multimedia :: Video
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
14
|
+
Requires-Python: >=3.11
|
|
15
|
+
Requires-Dist: videosdk-agents>=0.0.40
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# VideoSDK CometAPI Plugin
|
|
19
|
+
|
|
20
|
+
Agent Framework plugin for real-time LLM, STT, and TTS services from CometAPI, allowing you to access multiple services using a single API key.
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install videosdk-plugins-cometapi
|
|
26
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "videosdk-plugins-cometapi"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "VideoSDK Agent Framework plugin for CometAPI services"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "Apache-2.0"
|
|
11
|
+
requires-python = ">=3.11"
|
|
12
|
+
authors = [{ name = "videosdk" }]
|
|
13
|
+
keywords = ["video", "audio", "ai", "cometapi", "videosdk"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Intended Audience :: Developers",
|
|
16
|
+
"Development Status :: 4 - Beta",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Topic :: Communications :: Conferencing",
|
|
19
|
+
"Topic :: Multimedia :: Sound/Audio",
|
|
20
|
+
"Topic :: Multimedia :: Video",
|
|
21
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
22
|
+
]
|
|
23
|
+
dependencies = ["videosdk-agents>=0.0.40"]
|
|
24
|
+
|
|
25
|
+
[tool.hatch.version]
|
|
26
|
+
path = "videosdk/plugins/cometapi/version.py"
|
|
27
|
+
|
|
28
|
+
[tool.hatch.build.targets.wheel]
|
|
29
|
+
packages = ["videosdk"]
|
|
30
|
+
|
|
31
|
+
[tool.hatch.build.targets.sdist]
|
|
32
|
+
include = ["/videosdk"]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from videosdk.plugins.openai.llm import OpenAILLM
|
|
3
|
+
import os
|
|
4
|
+
class CometAPILLM(OpenAILLM):
|
|
5
|
+
def __init__(
|
|
6
|
+
self,
|
|
7
|
+
*,
|
|
8
|
+
api_key: str | None = None,
|
|
9
|
+
model: str = "gpt-4o-mini",
|
|
10
|
+
temperature: float = 0.7,
|
|
11
|
+
max_completion_tokens: int | None = None,
|
|
12
|
+
) -> None:
|
|
13
|
+
"""Initialize the CometAPI LLM plugin.
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
api_key (Optional[str], optional): CometAPI API key. Defaults to None.
|
|
17
|
+
model (str): The model to use for the LLM plugin. Defaults to "gpt-4o-mini".
|
|
18
|
+
temperature (float): The temperature to use for the LLM plugin. Defaults to 0.7.
|
|
19
|
+
max_completion_tokens (Optional[int], optional): The maximum completion tokens to use for the LLM plugin. Defaults to None.
|
|
20
|
+
"""
|
|
21
|
+
super().__init__(
|
|
22
|
+
api_key=api_key or os.getenv("COMETAPI_API_KEY"),
|
|
23
|
+
model=model,
|
|
24
|
+
base_url="https://api.cometapi.com/v1/",
|
|
25
|
+
temperature=temperature,
|
|
26
|
+
max_completion_tokens=max_completion_tokens,
|
|
27
|
+
)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from videosdk.plugins.openai.stt import OpenAISTT
|
|
5
|
+
class CometAPISTT(OpenAISTT):
|
|
6
|
+
def __init__(
|
|
7
|
+
self,
|
|
8
|
+
*,
|
|
9
|
+
api_key: str | None = None,
|
|
10
|
+
model: str = "whisper-1",
|
|
11
|
+
prompt: str | None = None,
|
|
12
|
+
language: str = "en",
|
|
13
|
+
) -> None:
|
|
14
|
+
"""Initialize the CometAPI STT plugin.
|
|
15
|
+
|
|
16
|
+
Args:
|
|
17
|
+
api_key (Optional[str], optional): CometAPI API key. Defaults to None.
|
|
18
|
+
model (str): The model to use for the STT plugin. Defaults to "whisper-1".
|
|
19
|
+
prompt (Optional[str], optional): The prompt for the STT plugin. Defaults to None.
|
|
20
|
+
language (str): The language to use for the STT plugin. Defaults to "en".
|
|
21
|
+
"""
|
|
22
|
+
super().__init__(
|
|
23
|
+
api_key=api_key or os.getenv("COMETAPI_API_KEY"),
|
|
24
|
+
model=model,
|
|
25
|
+
base_url="https://api.cometapi.com/v1/",
|
|
26
|
+
prompt=prompt,
|
|
27
|
+
language=language,
|
|
28
|
+
enable_streaming=False,
|
|
29
|
+
)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from typing import Any, AsyncIterator, Optional
|
|
5
|
+
import httpx
|
|
6
|
+
import openai
|
|
7
|
+
from videosdk.agents import TTS, segment_text
|
|
8
|
+
from videosdk.plugins.openai.tts import OpenAITTS # Re-use the existing OpenAI TTS
|
|
9
|
+
|
|
10
|
+
class CometAPITTS(OpenAITTS):
|
|
11
|
+
def __init__(
|
|
12
|
+
self,
|
|
13
|
+
*,
|
|
14
|
+
api_key: str | None = None,
|
|
15
|
+
model: str = "tts-1",
|
|
16
|
+
voice: str = "alloy",
|
|
17
|
+
speed: float = 1.0,
|
|
18
|
+
response_format: str = "pcm",
|
|
19
|
+
) -> None:
|
|
20
|
+
"""Initialize the CometAPI TTS plugin.
|
|
21
|
+
|
|
22
|
+
Args:
|
|
23
|
+
api_key (Optional[str], optional): CometAPI API key. Defaults to None.
|
|
24
|
+
model (str): The model to use for the TTS plugin. Defaults to "tts-1".
|
|
25
|
+
voice (str): The voice to use for the TTS plugin. Defaults to "alloy".
|
|
26
|
+
speed (float): The speed to use for the TTS plugin. Defaults to 1.0.
|
|
27
|
+
response_format (str): The response format to use for the TTS plugin. Defaults to "pcm".
|
|
28
|
+
"""
|
|
29
|
+
super().__init__(
|
|
30
|
+
api_key=api_key or os.getenv("COMETAPI_API_KEY"),
|
|
31
|
+
model=model,
|
|
32
|
+
voice=voice,
|
|
33
|
+
speed=speed,
|
|
34
|
+
base_url="https://api.cometapi.com/v1/",
|
|
35
|
+
response_format=response_format,
|
|
36
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.40"
|