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.27
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.27.tar.gz | 641.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| videosdk_agents-1.0.27-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.3 MB
Release files / videosdk_agents-1.0.27.tar.gz
| Download URL | videosdk_agents-1.0.27.tar.gz |
|---|---|
| Size | 641.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
756955356d062165c9996cb1e9ff7e7d1a8cb5db2d9550a1d2bece1f7b171982
|
|
BLAKE2b-256 checksum How to use checksums |
b2814d83d0174d03817ccb4ddae4286397c421d050db753f68aecc2e9a914e93
|
| 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.27-py3-none-any.whl
| Download URL | videosdk_agents-1.0.27-py3-none-any.whl |
|---|---|
| Size | 700.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e8d48133f1379f0aa96e8e31b3311c853a327d1ab333c4d7423d335a12f7e710
|
|
BLAKE2b-256 checksum How to use checksums |
96f6eeb484b6adc96612a8aea865d1f499469809c9229843f7443c75bfaa924c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.11
|