VideoSDK Agents
Agents Framework on top of VideoSDK's architecture.
Installation
pip install videosdk-agents
Visit https://docs.videosdk.live/ai_agents/introduction for Quickstart, Examples and Detailed Documentation.
Usage
import asyncio
from videosdk.agents import Agent, AgentSession, RealTimePipeline, function_tool, WorkerJob, RoomOptions, JobContext
from videosdk.plugins.openai import OpenAIRealtime, OpenAIRealtimeConfig
from openai.types.beta.realtime.session import InputAudioTranscription, TurnDetection
class MyVoiceAgent(Agent):
def __init__(self):
super().__init__(
instructions="You are a helpful voice assistant that can answer questions and help with tasks.",
)
async def on_enter(self) -> None:
await self.session.say("How can i assist you today?")
async def entrypoint(ctx: JobContext):
print("Starting connection test...")
print(f"Job context: {jobctx}")
model = OpenAIRealtime(
model="gpt-4o-realtime-preview",
config=OpenAIRealtimeConfig( modalities=["text", "audio"] )
)
pipeline = RealTimePipeline(model=model)
session = AgentSession(
agent=MyVoiceAgent(),
pipeline=pipeline,
context=jobctx
)
try:
await ctx.connect()
await session.start()
print("Connection established. Press Ctrl+C to exit.")
await asyncio.Event().wait()
except KeyboardInterrupt:
print("\nShutting down gracefully...")
finally:
await session.close()
await ctx.shutdown()
def make_context() -> JobContext:
room_options = RoomOptions(room_id="<meeting_id>", name="Sandbox Agent", playground=True)
return JobContext(
room_options=room_options
)
if __name__ == "__main__":
job = WorkerJob(job_func=entryPoint, jobctx=make_context)
job.start()
Metadata
Release files for videosdk-agents 1.0.30
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| videosdk_agents-1.0.30.tar.gz | 649.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| videosdk_agents-1.0.30-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.4 MB
Release files / videosdk_agents-1.0.30.tar.gz
| Download URL | videosdk_agents-1.0.30.tar.gz |
|---|---|
| Size | 649.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cdbd77b83bae2a0183ca446884bd07ad4bd455e469639a927d7cdd06dfb4f027
|
|
BLAKE2b-256 checksum How to use checksums |
5a733ee62740529b087508c80c48abbcbb5a8eeb042b5fd6e03a08fc334aacfb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.11
|
Release files / videosdk_agents-1.0.30-py3-none-any.whl
| Download URL | videosdk_agents-1.0.30-py3-none-any.whl |
|---|---|
| Size | 711.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a14abb6a678bce4bd56379222bbe0c390c88e78899094163284ee6542a1a1347
|
|
BLAKE2b-256 checksum How to use checksums |
5b3007c251769f772a34f781aca9ad74589a35b1b7d3ce91ea8ed407528efc58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.11
|