Video SDK Agents
Project description
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()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file videosdk_agents-0.0.62.tar.gz.
File metadata
- Download URL: videosdk_agents-0.0.62.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
678a8a8d4d411418ee5f4214d82cb53a7e03c1cabca9fa5fe2e2ef59224ea6d4
|
|
| MD5 |
70f872cd493221330e036dbca9d7df43
|
|
| BLAKE2b-256 |
301ad25dc49202eee8a8a670ff4d37a5550533d0eab4e886340639a6332df017
|
File details
Details for the file videosdk_agents-0.0.62-py3-none-any.whl.
File metadata
- Download URL: videosdk_agents-0.0.62-py3-none-any.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11dbf422be7d446f82984dca0e4160511477e6c7b52daa76c4da14dc629caccd
|
|
| MD5 |
87029c116dcccef248ebf55408ffa028
|
|
| BLAKE2b-256 |
6258c69944edbadc355f35c304c81ad9044150cbc6defb8ecf32fedeb45d8ca6
|