Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions frameworks/agno/youtube-agent/.agentuity-crash-1756999032.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"id": "c9aca38c-9807-48bb-988d-edec595c53b9",
"timestamp": "2025-09-04T11:17:12-04:00",
"error": "failed to install dependencies (exit code 2): exit status 2. error: Unable to find lockfile at `uv.lock`. To create a lockfile, run `uv lock` or `uv sync`.\n",
"error_type": {
"code": "CLI-0006",
"message": "Invalid configuration"
},
"username": "dhilanfye",
"os_name": "darwin",
"os_arch": "arm64",
"cli_version": "0.0.166",
"attributes": {
"message": "Failed to bundle project: failed to install dependencies (exit code 2): exit status 2. error: Unable to find lockfile at `uv.lock`. To create a lockfile, run `uv lock` or `uv sync`.\n",
"user_id": "user_2x3CH4tR8dMwfWSkzUsyLznYKQT"
},
"stack_trace": "goroutine 125 [running]:\nruntime/debug.Stack()\n\t/home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64/src/runtime/debug/stack.go:26 +0x64\ngithub.com/agentuity/cli/internal/errsystem.(*errSystem).ShowErrorAndExit(0x14000156230)\n\t/home/runner/_work/cli/cli/internal/errsystem/console.go:103 +0x7c\ngithub.com/agentuity/cli/cmd.init.func31.2.1()\n\t/home/runner/_work/cli/cli/cmd/dev.go:168 +0x188\ngithub.com/agentuity/go-common/tui.ShowSpinner.func1()\n\t/home/runner/go/pkg/mod/github.com/agentuity/go-common@v1.0.72/tui/spinner.go:31 +0x48\ngithub.com/agentuity/go-common/tui.ShowSpinner.(*Spinner).Action.func2({0x0?, 0x0?})\n\t/home/runner/go/pkg/mod/github.com/charmbracelet/huh/spinner@v0.0.0-20250313000648-36d9de46d64e/spinner.go:74 +0x24\ngithub.com/charmbracelet/huh/spinner.(*Spinner).Init.func1()\n\t/home/runner/go/pkg/mod/github.com/charmbracelet/huh/spinner@v0.0.0-20250313000648-36d9de46d64e/spinner.go:131 +0x34\ngithub.com/charmbracelet/bubbletea.(*Program).handleCommands.func1.1()\n\t/home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea@v1.3.4/tea.go:352 +0x5c\ncreated by github.com/charmbracelet/bubbletea.(*Program).handleCommands.func1 in goroutine 122\n\t/home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea@v1.3.4/tea.go:346 +0xf4\n"
}
1 change: 1 addition & 0 deletions frameworks/agno/youtube-agent/.agentuity/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"agents":[{"id":"agent_5bf6fcde1d06b2dc696ac4eea1ae6902","name":"YouTubeAgent","filename":"agents/YouTubeAgent/agent.py"}],"app":{"name":"youtube-agent","version":"0.1.0"},"cli_version":"0.0.166","environment":"development"}
15 changes: 15 additions & 0 deletions frameworks/agno/youtube-agent/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.py]
indent_size = 4

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions frameworks/agno/youtube-agent/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This file is used to store development environment variables
132 changes: 132 additions & 0 deletions frameworks/agno/youtube-agent/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# UV
uv.lock
152 changes: 152 additions & 0 deletions frameworks/agno/youtube-agent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
<div align="center">
<img src="https://raw.githubusercontent.com/agentuity/cli/refs/heads/main/.github/Agentuity.png" alt="Agentuity" width="100"/> <br/>
<strong>Build Agents, Not Infrastructure</strong> <br/>
<br/>
<a target="_blank" href="https://app.agentuity.com/deploy" alt="Agentuity">
<img src="https://app.agentuity.com/img/deploy.svg" />
</a>
<br />
</div>

# 🎬 YouTube Content Analyzer Agent

[![Deploy with Agentuity](https://app.agentuity.com/img/deploy.svg)](https://app.agentuity.com/deploy)

## 🔗 Agno Framework Integration

This project demonstrates how to seamlessly integrate [Agno's YouTube Agent](https://docs.agno.com/examples/agents/youtube-agent) with Agentuity. The original Agno YouTube agent provides powerful YouTube content analysis capabilities, and Agentuity makes it incredibly easy to deploy and scale in production.

**Ported from:** https://docs.agno.com/examples/agents/youtube-agent

## 🎯 What This Agent Does

This intelligent YouTube content analyzer provides detailed video breakdowns, timestamps, and summaries. Perfect for content creators, researchers, and viewers who efficiently navigate video content.

### Key Features

- **Video Overview**: Analyzes video length, type, and basic metadata
- **Smart Timestamps**: Creates precise, meaningful timestamps for key segments
- **Content Organization**: Groups related segments and identifies main themes
- **Comprehensive Analysis**: Provides detailed summaries and highlight notes

### Example Prompts to Try

- "Analyze this tech review: [video_url]"
- "Get timestamps for this coding tutorial: [video_url]"
- "Break down the key points of this lecture: [video_url]"
- "Summarize the main topics in this documentary: [video_url]"
- "Create a study guide from this educational video: [video_url]"

## 🚀 How It Works

With just a simple wrapper function, you can take the original Agno YouTube agent and deploy it to Agentuity's cloud platform:

```python
from agentuity import AgentRequest, AgentResponse, AgentContext
from agents.YouTubeAgent.youtube_agent import youtube_agent

# Agentuity handler - wraps the original Agno YouTube agent
async def run(request: AgentRequest, response: AgentResponse, context: AgentContext):
# Get user input from Agentuity
prompt = await request.data.text()

# Run the original Agno YouTube agent
raw = await loop.run_in_executor(None, lambda: youtube_agent.run(prompt))

# Return response through Agentuity
return response.text(output)
```
Comment on lines +44 to +58
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix broken example: undefined loop and output.

Current snippet won’t run copy-paste. Minimal fixes below.

 ```python
+import asyncio
 from agentuity import AgentRequest, AgentResponse, AgentContext
 from agents.YouTubeAgent.youtube_agent import youtube_agent
 
 # Agentuity handler - wraps the original Agno YouTube agent
 async def run(request: AgentRequest, response: AgentResponse, context: AgentContext):
     # Get user input from Agentuity
     prompt = await request.data.text()
     
     # Run the original Agno YouTube agent
-    raw = await loop.run_in_executor(None, lambda: youtube_agent.run(prompt))
+    loop = asyncio.get_running_loop()
+    raw = await loop.run_in_executor(None, lambda: youtube_agent.run(prompt))
+    output = raw if isinstance(raw, str) else getattr(raw, "text", str(raw))
     
     # Return response through Agentuity
-    return response.text(output)
+    return response.text(output)  # If AgentResponse.text is async, use: `return await response.text(output)`

<details>
<summary>🤖 Prompt for AI Agents</summary>

In frameworks/agno/youtube-agent/README.md around lines 44 to 58, the example
references undefined variables loop and output; fix by importing asyncio at
top, obtain the running event loop via asyncio.get_running_loop() before using
run_in_executor, capture the executor result into raw, convert raw into a
string response by using output = raw if isinstance(raw, str) else getattr(raw, "text", str(raw)), then return the response via response.text(output) and if
AgentResponse.text is an async method, await it (i.e., return await
response.text(output)).


</details>

<!-- fingerprinting:phantom:poseidon:chinchilla -->

<!-- This is an auto-generated comment by CodeRabbit -->


This integration gives you the best of both worlds: Agno's powerful YouTube analysis framework combined with Agentuity's enterprise-grade deployment, monitoring, and scaling capabilities.

## 📋 Prerequisites

Before you begin, ensure you have the following installed:

- **Python**: Version 3.10 or higher
- **UV**: Version 0.5.25 or higher ([Documentation](https://docs.astral.sh/uv/))

## 🚀 Getting Started

### Authentication

Before using Agentuity, you need to authenticate:

```bash
agentuity login
```

This command will open a browser window where you can log in to your Agentuity account.

### Development Mode

Run your project in development mode with:

```bash
agentuity dev
```

This will start your project and open a new browser window connecting your Agent to the Agentuity Console in Live Mode, allowing you to test and debug your agent in real-time.

## 🌐 Deployment

When you're ready to deploy your agent to the Agentuity Cloud:

```bash
agentuity deploy
```

This command will bundle your agent and deploy it to the cloud, making it accessible via the Agentuity platform.

## 📚 Project Structure

```
├── agents/
│ └── YouTubeAgent/
│ ├── agent.py # Agentuity wrapper
│ ├── youtube_agent.py # Original Agno agent (preserved)
│ └── __init__.py
├── .venv/ # Virtual environment (created by UV)
├── pyproject.toml # Project dependencies and metadata
├── server.py # Server entry point
└── agentuity.yaml # Agentuity project configuration
```

## 🔧 Configuration

Your project configuration is stored in `agentuity.yaml`. This file defines your agents, development settings, and deployment configuration.

## 🛠️ Advanced Usage

### Environment Variables

You can set environment variables for your project:

```bash
agentuity env set KEY VALUE
```

### Secrets Management

For sensitive information, use secrets:

```bash
agentuity env set --secret KEY VALUE
```

## 📖 Documentation

For comprehensive documentation on the Agentuity Python SDK, visit:
[https://agentuity.dev/SDKs/python](https://agentuity.dev/SDKs/python)

## 🆘 Troubleshooting

If you encounter any issues:

1. Check the [documentation](https://agentuity.dev/SDKs/python)
2. Join our [Discord community](https://discord.gg/agentuity) for support
3. Contact the Agentuity support team

## 📝 License

This project is licensed under the terms specified in the LICENSE file.
Empty file.
36 changes: 36 additions & 0 deletions frameworks/agno/youtube-agent/agents/YouTubeAgent/agent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from agentuity import AgentRequest, AgentResponse, AgentContext
import asyncio

from agents.YouTubeAgent.youtube_agent import youtube_agent

def welcome():
return {
"welcome": "🎬 I'm a YouTube Content Analyzer. Paste any YouTube link and tell me what you need!",
}

async def run(request: AgentRequest, response: AgentResponse, context: AgentContext):
prompt = await request.data.text()
context.logger.info(f"[YouTubeAgent] prompt: {prompt!r}")

try:
loop = asyncio.get_running_loop()
raw = await loop.run_in_executor(None, lambda: youtube_agent.run(prompt))

if isinstance(raw, str):
output = raw
elif hasattr(raw, "content"):
output = raw.content
elif hasattr(raw, "reply"):
output = raw.reply
else:
output = str(raw)

if not output.strip():
context.logger.error("[YouTubeAgent] empty output")
return response.text("⚠️ Analyzer produced no content.")

return response.text(output)

except Exception as exc:
context.logger.error(f"[YouTubeAgent] fatal error: {exc}", exc_info=True)
return response.text("❌ An internal error occurred while analyzing the video.")
Loading