Skip to content

Commit 0456c67

Browse files
committed
initial commit
1 parent fc032bf commit 0456c67

File tree

5 files changed

+383
-1
lines changed

5 files changed

+383
-1
lines changed

agents-core/README.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,50 @@ Build Vision Agents quickly with any model or video provider.
1010

1111
Created by Stream, uses [Stream's edge network](https://getstream.io/video/) for ultra-low latency.
1212

13-
See [Github](https://github.com/GetStream/Vision-Agents).
13+
## Quick Start
14+
15+
```bash
16+
# Install vision-agents
17+
uv add vision-agents
18+
19+
# Import (automatically creates .env file)
20+
python -c "from vision_agents import Agent"
21+
```
22+
23+
The package automatically creates a `.env` file with example configuration. Edit it to add your API keys:
24+
25+
### Required API Keys
26+
- **Stream** (required): `STREAM_API_KEY`, `STREAM_API_SECRET` - [Get keys](https://getstream.io/)
27+
- **LLM** (choose one): `OPENAI_API_KEY`, `GOOGLE_API_KEY`, `ANTHROPIC_API_KEY`, `XAI_API_KEY`
28+
- **STT** (choose one): `DEEPGRAM_API_KEY`, `MOONSHINE_API_KEY`, `WIZPER_API_KEY`
29+
- **TTS** (choose one): `CARTESIA_API_KEY`, `ELEVENLABS_API_KEY`, `KOKORO_API_KEY`
30+
- **Turn Detection**: `FAL_KEY` - [Get key](https://fal.ai/)
31+
32+
### Setup Commands
33+
```bash
34+
vision-agents-setup # Create .env file
35+
vision-agents-setup --guide # Show setup guide
36+
vision-agents-setup --force # Overwrite existing .env
37+
```
38+
39+
## Example Usage
40+
41+
```python
42+
from vision_agents import Agent
43+
from vision_agents.plugins import openai, deepgram, cartesia
44+
45+
agent = Agent(
46+
edge=getstream.Edge(),
47+
agent_user=User(name="AI Assistant", id="agent"),
48+
instructions="You're a helpful AI assistant.",
49+
llm=openai.LLM(model="gpt-4o-mini"),
50+
tts=cartesia.TTS(),
51+
stt=deepgram.STT(),
52+
)
53+
```
54+
55+
## Documentation
56+
57+
- 📚 [Full Documentation](https://visionagents.ai/)
58+
- 💬 [Examples](https://github.com/GetStream/Vision-Agents/tree/main/examples)
59+
- 🔧 [GitHub Repository](https://github.com/GetStream/Vision-Agents)

agents-core/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ packages = ["vision_agents"]
8181
[tool.hatch.build.targets.sdist]
8282
include = ["vision_agents"]
8383

84+
[project.scripts]
85+
vision-agents-setup = "vision_agents.post_install:main"
86+
8487
#[tool.uv.sources]
8588
#krisp-audio = [
8689
# { path = "./vision_agents/core/turn_detection/krisp/krisp_audio-1.4.0-cp313-cp313-macosx_12_0_arm64.whl", marker = "sys_platform == 'darwin' and platform_machine == 'aarch64'" },
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
"""
2+
Vision Agents - Open video agents for building low latency video and voice agents.
3+
"""
4+
5+
import os
6+
import sys
7+
from pathlib import Path
8+
9+
# Version will be set by hatch-vcs
10+
__version__ = "0.0.0"
11+
12+
# Auto-create .env file on first import if it doesn't exist
13+
def _setup_env_file():
14+
"""Automatically create .env file from template if it doesn't exist."""
15+
try:
16+
# Get the package directory
17+
package_dir = Path(__file__).parent
18+
19+
# Template file path
20+
template_path = package_dir / "env_template.txt"
21+
22+
# Target .env file path (in current working directory)
23+
env_path = Path.cwd() / ".env"
24+
25+
# Check if .env already exists
26+
if env_path.exists():
27+
return
28+
29+
# Check if template exists
30+
if not template_path.exists():
31+
return
32+
33+
# Only create .env if we're in a project directory (not in site-packages)
34+
# This prevents creating .env files in unexpected places
35+
if "site-packages" in str(package_dir) or "dist-packages" in str(package_dir):
36+
return
37+
38+
# Copy template to .env
39+
import shutil
40+
shutil.copy2(template_path, env_path)
41+
42+
# Print helpful message
43+
print("🎉 Vision Agents: Created .env file with example configuration!")
44+
print()
45+
print("📁 File location:")
46+
print(f" {env_path.absolute()}")
47+
print()
48+
print("📝 Please edit the .env file and add your actual API keys")
49+
print("🔗 See the comments in the .env file for where to get API keys")
50+
print("💡 Run 'vision-agents-setup' command for more setup options")
51+
52+
except Exception:
53+
# Silently fail - don't break the import if env setup fails
54+
pass
55+
56+
# Run the setup function
57+
_setup_env_file()
58+
59+
# Import core components
60+
from .core.agents import Agent
61+
from .core.edge.types import User
62+
63+
__all__ = ["Agent", "User", "__version__"]
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# Vision Agents Environment Configuration
2+
# Copy this file to .env and fill in your actual API keys
3+
4+
# =============================================================================
5+
# CORE INFRASTRUCTURE
6+
# =============================================================================
7+
8+
# Stream (Required for video/audio infrastructure)
9+
# Get your keys from: https://getstream.io/
10+
STREAM_API_KEY=your_stream_api_key_here
11+
STREAM_API_SECRET=your_stream_api_secret_here
12+
STREAM_BASE_URL=https://getstream.io
13+
14+
# =============================================================================
15+
# LLM PROVIDERS
16+
# =============================================================================
17+
18+
# OpenAI (for GPT models)
19+
# Get your key from: https://platform.openai.com/api-keys
20+
OPENAI_API_KEY=your_openai_api_key_here
21+
22+
# Google/Gemini
23+
# Get your key from: https://aistudio.google.com/app/apikey
24+
GOOGLE_API_KEY=your_google_api_key_here
25+
GEMINI_API_KEY=your_gemini_api_key_here # Alternative to GOOGLE_API_KEY
26+
27+
# Anthropic (Claude)
28+
# Get your key from: https://console.anthropic.com/
29+
ANTHROPIC_API_KEY=your_anthropic_api_key_here
30+
31+
# xAI (Grok)
32+
# Get your key from: https://console.x.ai/
33+
XAI_API_KEY=your_xai_api_key_here
34+
35+
# =============================================================================
36+
# SPEECH-TO-TEXT (STT) PROVIDERS
37+
# =============================================================================
38+
39+
# Deepgram
40+
# Get your key from: https://console.deepgram.com/
41+
DEEPGRAM_API_KEY=your_deepgram_api_key_here
42+
43+
# Moonshine
44+
# Get your key from: https://moonshine.ai/
45+
MOONSHINE_API_KEY=your_moonshine_api_key_here
46+
47+
# Wizper
48+
# Get your key from: https://wizper.ai/
49+
WIZPER_API_KEY=your_wizper_api_key_here
50+
51+
# =============================================================================
52+
# TEXT-TO-SPEECH (TTS) PROVIDERS
53+
# =============================================================================
54+
55+
# Cartesia
56+
# Get your key from: https://cartesia.ai/
57+
CARTESIA_API_KEY=your_cartesia_api_key_here
58+
59+
# ElevenLabs
60+
# Get your key from: https://elevenlabs.io/
61+
ELEVENLABS_API_KEY=your_elevenlabs_api_key_here
62+
63+
# Kokoro
64+
# Get your key from: https://kokoro.ai/
65+
KOKORO_API_KEY=your_kokoro_api_key_here
66+
67+
# =============================================================================
68+
# TURN DETECTION & VAD
69+
# =============================================================================
70+
71+
# Smart Turn (FAL)
72+
# Get your key from: https://fal.ai/
73+
FAL_KEY=your_fal_api_key_here
74+
75+
# =============================================================================
76+
# COMPUTER VISION
77+
# =============================================================================
78+
79+
# Ultralytics (YOLO models)
80+
# No API key required for basic usage
81+
# ULTRALYTICS_API_KEY=your_ultralytics_api_key_here
82+
83+
# =============================================================================
84+
# AUDIO PROCESSING
85+
# =============================================================================
86+
87+
# Krisp (Noise cancellation)
88+
# Get your key from: https://krisp.ai/
89+
KRISP_API_KEY=your_krisp_api_key_here
90+
91+
# =============================================================================
92+
# MCP (Model Context Protocol) SERVERS
93+
# =============================================================================
94+
95+
# Local MCP server command (for testing)
96+
MCP_LOCAL_CMD=python -m mcp_server_weather
97+
98+
# Remote MCP server URL (for testing)
99+
MCP_REMOTE_URL=https://your-mcp-server.com
100+
101+
# MCP server headers (prefix with MCP_REMOTE_HEADERS_)
102+
# MCP_REMOTE_HEADERS_Authorization=Bearer your_token
103+
# MCP_REMOTE_HEADERS_X_API_Key=your_api_key
104+
105+
# =============================================================================
106+
# DEVELOPMENT & TESTING
107+
# =============================================================================
108+
109+
# Example base URL for demos
110+
EXAMPLE_BASE_URL=https://getstream.io/video/demos
111+
112+
# Test configuration
113+
TEST_MCP_CITY=New York
114+
115+
# GitHub (for MCP integration tests)
116+
GITHUB_PAT=your_github_personal_access_token_here
117+
118+
# =============================================================================
119+
# OPTIONAL CONFIGURATION
120+
# =============================================================================
121+
122+
# OpenAI model selection
123+
OPENAI_MODEL=gpt-4o-mini
124+
125+
# Logging level
126+
LOG_LEVEL=INFO
127+
128+
# Debug mode
129+
DEBUG=false
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Vision Agents Setup Script
4+
Creates a .env file from template and provides setup guidance.
5+
"""
6+
7+
import os
8+
import sys
9+
import shutil
10+
import argparse
11+
from pathlib import Path
12+
13+
14+
def create_env_file(target_dir=None, force=False):
15+
"""Create .env file from template if it doesn't exist."""
16+
# Get the package directory
17+
package_dir = Path(__file__).parent
18+
19+
# Template file path
20+
template_path = package_dir / "env_template.txt"
21+
22+
# Target directory
23+
if target_dir is None:
24+
target_dir = Path.cwd()
25+
else:
26+
target_dir = Path(target_dir)
27+
28+
# Target .env file path
29+
env_path = target_dir / ".env"
30+
31+
# Check if .env already exists
32+
if env_path.exists() and not force:
33+
print(f"✓ .env file already exists at {env_path}")
34+
print("💡 Use --force to overwrite existing .env file")
35+
return True
36+
37+
# Check if template exists
38+
if not template_path.exists():
39+
print(f"❌ Template file not found at {template_path}")
40+
return False
41+
42+
try:
43+
# Ensure target directory exists
44+
target_dir.mkdir(parents=True, exist_ok=True)
45+
46+
# Copy template to .env
47+
shutil.copy2(template_path, env_path)
48+
print(f"✓ Created .env file at: {env_path}")
49+
print()
50+
print("📁 File location:")
51+
print(f" {env_path.absolute()}")
52+
print()
53+
print("📝 Next steps:")
54+
print("1. Edit the .env file and add your actual API keys")
55+
print("2. See the comments in the .env file for where to get API keys")
56+
print("3. Start building your vision agent!")
57+
print()
58+
print("🔗 Quick links for API keys:")
59+
print(" • Stream: https://getstream.io/")
60+
print(" • OpenAI: https://platform.openai.com/api-keys")
61+
print(" • Deepgram: https://console.deepgram.com/")
62+
print(" • Cartesia: https://cartesia.ai/")
63+
print(" • FAL (Smart Turn): https://fal.ai/")
64+
return True
65+
66+
except Exception as e:
67+
print(f"❌ Failed to create .env file: {e}")
68+
return False
69+
70+
71+
def show_setup_guide():
72+
"""Show comprehensive setup guide."""
73+
print("🚀 Vision Agents Setup Guide")
74+
print("=" * 50)
75+
print()
76+
print("✅ Package already installed!")
77+
print()
78+
print("📝 Next steps:")
79+
print("1. Add your API keys to the .env file")
80+
print("2. Start building your vision agent:")
81+
print()
82+
print(" from vision_agents import Agent")
83+
print(" from vision_agents.plugins import openai, deepgram, cartesia")
84+
print()
85+
print("🔧 Setup commands:")
86+
print(" vision-agents-setup # Create .env file")
87+
print(" vision-agents-setup --force # Overwrite existing .env")
88+
print(" vision-agents-setup --guide # Show this guide")
89+
print()
90+
print("📚 Documentation: https://visionagents.ai/")
91+
print("💬 Examples: https://github.com/GetStream/Vision-Agents/tree/main/examples")
92+
93+
94+
def main():
95+
"""Main entry point for setup script."""
96+
parser = argparse.ArgumentParser(
97+
description="Vision Agents setup script",
98+
formatter_class=argparse.RawDescriptionHelpFormatter,
99+
epilog="""
100+
Examples:
101+
vision-agents-setup # Create .env in current directory
102+
vision-agents-setup --dir /path/to/project # Create .env in specific directory
103+
vision-agents-setup --force # Overwrite existing .env file
104+
vision-agents-setup --guide # Show setup guide
105+
"""
106+
)
107+
108+
parser.add_argument(
109+
"--dir", "-d",
110+
help="Directory to create .env file in (default: current directory)"
111+
)
112+
113+
parser.add_argument(
114+
"--force", "-f",
115+
action="store_true",
116+
help="Overwrite existing .env file"
117+
)
118+
119+
parser.add_argument(
120+
"--guide", "-g",
121+
action="store_true",
122+
help="Show setup guide"
123+
)
124+
125+
args = parser.parse_args()
126+
127+
if args.guide:
128+
show_setup_guide()
129+
return
130+
131+
try:
132+
success = create_env_file(target_dir=args.dir, force=args.force)
133+
if not success:
134+
sys.exit(1)
135+
except Exception as e:
136+
print(f"❌ Setup script failed: {e}")
137+
sys.exit(1)
138+
139+
140+
if __name__ == "__main__":
141+
main()

0 commit comments

Comments
 (0)