sample_id stringlengths 21 196 | text stringlengths 105 936k | metadata dict | category stringclasses 6
values |
|---|---|---|---|
agno-agi/agno:libs/agno/tests/unit/tools/test_shopify.py | """Unit tests for ShopifyTools class."""
import json
from unittest.mock import MagicMock, patch
import pytest
from agno.tools.shopify import ShopifyTools
@pytest.fixture
def mock_httpx_client():
"""Create a mock httpx client."""
with patch("agno.tools.shopify.httpx.Client") as mock_client:
mock_ins... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/test_shopify.py",
"license": "Apache License 2.0",
"lines": 716,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/models/test_generator_session_state.py | """
Tests for session_state persistence in generator-based tools.
This test suite verifies that session_state modifications made during
generator iteration are properly captured and not overwritten by stale state.
The bug: When a tool is a generator function, updated_session_state was captured
before the generator bo... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/models/test_generator_session_state.py",
"license": "Apache License 2.0",
"lines": 209,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/os/routers/agents/router.py | import json
from typing import TYPE_CHECKING, Any, AsyncGenerator, List, Optional, Union, cast
from uuid import uuid4
from fastapi import (
APIRouter,
BackgroundTasks,
Depends,
File,
Form,
HTTPException,
Query,
Request,
UploadFile,
)
from fastapi.responses import JSONResponse, Strea... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/os/routers/agents/router.py",
"license": "Apache License 2.0",
"lines": 749,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/agno/os/routers/agents/schema.py | from typing import Any, Dict, Optional
from uuid import uuid4
from pydantic import BaseModel
from agno.agent import Agent
from agno.models.message import Message
from agno.os.schema import ModelResponse
from agno.os.utils import (
format_tools,
)
from agno.run import RunContext
from agno.run.agent import RunOutpu... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/os/routers/agents/schema.py",
"license": "Apache License 2.0",
"lines": 274,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/agno/os/routers/teams/router.py | from typing import TYPE_CHECKING, Any, AsyncGenerator, List, Optional, Union
from uuid import uuid4
from fastapi import (
APIRouter,
BackgroundTasks,
Depends,
File,
Form,
HTTPException,
Query,
Request,
UploadFile,
)
from fastapi.responses import JSONResponse, StreamingResponse
from... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/os/routers/teams/router.py",
"license": "Apache License 2.0",
"lines": 618,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/agno/os/routers/teams/schema.py | from typing import Any, Dict, List, Optional, Union
from uuid import uuid4
from pydantic import BaseModel
from agno.agent import Agent
from agno.os.routers.agents.schema import AgentResponse
from agno.os.schema import ModelResponse
from agno.os.utils import (
format_team_tools,
)
from agno.run import RunContext
f... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/os/routers/teams/schema.py",
"license": "Apache License 2.0",
"lines": 267,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/agno/os/routers/workflows/router.py | import json
from typing import TYPE_CHECKING, Any, AsyncGenerator, Dict, List, Optional, Union
from uuid import uuid4
from fastapi import (
APIRouter,
BackgroundTasks,
Depends,
Form,
HTTPException,
Query,
Request,
WebSocket,
)
from fastapi.responses import JSONResponse, StreamingRespons... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/os/routers/workflows/router.py",
"license": "Apache License 2.0",
"lines": 705,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/agno/os/routers/workflows/schema.py | from typing import Any, Dict, List, Optional
from pydantic import BaseModel, Field
from agno.os.routers.agents.schema import AgentResponse
from agno.os.routers.teams.schema import TeamResponse
from agno.workflow.agent import WorkflowAgent
from agno.workflow.workflow import Workflow
def _generate_schema_from_params(... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/os/routers/workflows/schema.py",
"license": "Apache License 2.0",
"lines": 119,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/agno/eval/agent_as_judge.py | from dataclasses import asdict, dataclass, field
from inspect import iscoroutinefunction
from os import getenv
from textwrap import dedent
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Literal, Optional, Union
from uuid import uuid4
from pydantic import BaseModel, Field
from agno.agent import Agent
fro... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/eval/agent_as_judge.py",
"license": "Apache License 2.0",
"lines": 771,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/agno/eval/base.py | from abc import ABC, abstractmethod
from typing import Union
from agno.run.agent import RunInput, RunOutput
from agno.run.team import TeamRunInput, TeamRunOutput
class BaseEval(ABC):
"""Abstract base class for all evaluations."""
@abstractmethod
def pre_check(self, run_input: Union[RunInput, TeamRunInpu... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/eval/base.py",
"license": "Apache License 2.0",
"lines": 22,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
agno-agi/agno:libs/agno/tests/unit/eval/test_agent_as_judge_eval.py | """Unit tests for AgentAsJudgeEval"""
from unittest.mock import AsyncMock, MagicMock
from agno.agent import Agent
from agno.db.in_memory import InMemoryDb
from agno.eval.agent_as_judge import AgentAsJudgeEval, BinaryJudgeResponse, NumericJudgeResponse
from agno.models.openai import OpenAIChat
from agno.run.agent impo... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/eval/test_agent_as_judge_eval.py",
"license": "Apache License 2.0",
"lines": 436,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/models/google/utils.py | from enum import Enum
class GeminiFinishReason(Enum):
"""Gemini API finish reasons"""
STOP = "STOP"
MAX_TOKENS = "MAX_TOKENS"
SAFETY = "SAFETY"
RECITATION = "RECITATION"
MALFORMED_FUNCTION_CALL = "MALFORMED_FUNCTION_CALL"
OTHER = "OTHER"
# Guidance message used to retry a Gemini invocat... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/models/google/utils.py",
"license": "Apache License 2.0",
"lines": 16,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | documentation |
agno-agi/agno:libs/agno/tests/integration/models/google/test_retryable_exceptions.py | """Test the regeneration mechanism for known Gemini errors."""
from unittest.mock import Mock, patch
import pytest
from agno.agent import Agent
from agno.models.google import Gemini
from agno.models.google.gemini import RetryableModelProviderError
from agno.models.google.utils import MALFORMED_FUNCTION_CALL_GUIDANCE... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/google/test_retryable_exceptions.py",
"license": "Apache License 2.0",
"lines": 342,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/agent/test_introduction.py | import uuid
from agno.agent.agent import Agent
from agno.db.base import SessionType
from agno.models.openai.chat import OpenAIChat
def test_agent_with_introduction(shared_db):
"""Test that introduction is added to the session as the first assistant message."""
session_id = str(uuid.uuid4())
introduction_... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/agent/test_introduction.py",
"license": "Apache License 2.0",
"lines": 265,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/teams/test_introduction.py | import uuid
from agno.agent.agent import Agent
from agno.db.base import SessionType
from agno.models.openai.chat import OpenAIChat
from agno.team.team import Team
def test_team_with_introduction(shared_db):
"""Test that introduction is added to the session as the first assistant message."""
session_id = str(... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/teams/test_introduction.py",
"license": "Apache License 2.0",
"lines": 316,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/tools/test_hackernews.py | """Unit tests for HackerNewsTools class."""
import json
from unittest.mock import MagicMock, patch
import pytest
from agno.tools.hackernews import HackerNewsTools
@pytest.fixture
def hackernews_tools():
"""Create a HackerNewsTools instance with all tools enabled."""
return HackerNewsTools()
@pytest.fixtu... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/test_hackernews.py",
"license": "Apache License 2.0",
"lines": 313,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/db/mysql/async_mysql.py | import time
from datetime import date, datetime, timedelta, timezone
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
from uuid import uuid4
if TYPE_CHECKING:
from agno.tracing.schemas import Span, Trace
from agno.db.base import AsyncBaseDb, SessionType
from agno.db.migrations.manager imp... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/db/mysql/async_mysql.py",
"license": "Apache License 2.0",
"lines": 2516,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/tests/integration/db/async_mysql/test_db.py | """Integration tests for the setup and main methods of the AsyncMySQLDb class"""
from datetime import datetime, timezone
from unittest.mock import AsyncMock, patch
import pytest
from sqlalchemy import text
from agno.db.mysql import AsyncMySQLDb
@pytest.mark.asyncio
async def test_init_with_db_url():
"""Test in... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/db/async_mysql/test_db.py",
"license": "Apache License 2.0",
"lines": 128,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/db/async_mysql/test_evals.py | """Integration tests for AsyncMySQLDb eval methods"""
import time
import pytest
from agno.db.schemas.evals import EvalRunRecord, EvalType
@pytest.mark.asyncio
async def test_create_and_get_eval_run(async_mysql_db_real):
"""Test creating and retrieving an eval run"""
eval_run = EvalRunRecord(
run_id... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/db/async_mysql/test_evals.py",
"license": "Apache License 2.0",
"lines": 129,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/db/async_mysql/test_knowledge.py | """Integration tests for AsyncMySQLDb knowledge methods"""
import time
import pytest
from agno.db.schemas.knowledge import KnowledgeRow
@pytest.mark.asyncio
async def test_upsert_and_get_knowledge_content(async_mysql_db_real):
"""Test upserting and retrieving knowledge content"""
knowledge = KnowledgeRow(
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/db/async_mysql/test_knowledge.py",
"license": "Apache License 2.0",
"lines": 83,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/db/async_mysql/test_memory.py | """Integration tests for AsyncMySQLDb memory methods"""
import pytest
from agno.db.schemas.memory import UserMemory
@pytest.mark.asyncio
async def test_upsert_and_get_user_memory(async_mysql_db_real):
"""Test upserting and retrieving a user memory"""
memory = UserMemory(
memory_id="test-memory-1",
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/db/async_mysql/test_memory.py",
"license": "Apache License 2.0",
"lines": 158,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/db/async_mysql/test_metrics.py | """Integration tests for AsyncMySQLDb metrics methods"""
from datetime import date
import pytest
@pytest.mark.asyncio
async def test_calculate_and_get_metrics(async_mysql_db_real):
"""Test calculating and retrieving metrics"""
# This test requires sessions to exist first
# For now, just test that the me... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/db/async_mysql/test_metrics.py",
"license": "Apache License 2.0",
"lines": 29,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/db/async_mysql/test_session.py | """Integration tests for AsyncMySQLDb session methods"""
import pytest
from agno.db.base import SessionType
from agno.session import AgentSession, TeamSession, WorkflowSession
@pytest.mark.asyncio
async def test_upsert_and_get_agent_session(async_mysql_db_real):
"""Test upserting and retrieving an agent session... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/db/async_mysql/test_session.py",
"license": "Apache License 2.0",
"lines": 208,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/agent/test_memory.py | import pytest
from agno.agent.agent import Agent
from agno.db.base import UserMemory
def test_get_user_memories(shared_db):
shared_db.clear_memories()
shared_db.upsert_user_memory(memory=UserMemory(user_id="test_user", memory="test_memory"))
agent = Agent(db=shared_db)
memories = agent.get_user_mem... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/agent/test_memory.py",
"license": "Apache License 2.0",
"lines": 20,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/agent/test_retries.py | """Integration tests for agent retry functionality."""
from unittest.mock import patch
import pytest
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.run.base import RunStatus
def test_agent_retry():
"""Test that agent retries on failure and eventually succeeds."""
model = O... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/agent/test_retries.py",
"license": "Apache License 2.0",
"lines": 100,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/test_retries.py | """Integration tests for model retry functionality."""
from unittest.mock import patch
import pytest
from agno.agent import Agent
from agno.exceptions import ModelProviderError
from agno.models.openai import OpenAIChat
from agno.run.base import RunStatus
def test_model_retry():
"""Test that model retries on fa... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/test_retries.py",
"license": "Apache License 2.0",
"lines": 111,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/teams/test_retries.py | """Integration tests for team retry functionality."""
from unittest.mock import patch
import pytest
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.run.base import RunStatus
from agno.team import Team
def test_team_retry():
"""Test that team retries on failure and eventually su... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/teams/test_retries.py",
"license": "Apache License 2.0",
"lines": 107,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/integrations/test_memori.py | """
Unit tests for Memori integration with Agno agents.
Tests the integration pattern using Memori.llm.register().
"""
import os
import tempfile
from unittest.mock import patch
import pytest
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from agno.agent import Agent
from agno.models.op... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/integrations/test_memori.py",
"license": "Apache License 2.0",
"lines": 175,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/tools/redshift.py | import csv
from os import getenv
from typing import Any, Dict, List, Optional
try:
import redshift_connector
from redshift_connector import Connection
except ImportError:
raise ImportError("`redshift_connector` not installed. Please install using `pip install redshift-connector`.")
from agno.tools import ... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/tools/redshift.py",
"license": "Apache License 2.0",
"lines": 339,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/tests/unit/tools/test_redshift.py | from unittest.mock import Mock, mock_open, patch
import pytest
try:
import redshift_connector
except ImportError:
raise ImportError("`redshift_connector` not installed. Please install using `pip install redshift-connector`.")
from agno.tools.redshift import RedshiftTools
# --- Mock Data for Tests ---
MOCK_T... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/test_redshift.py",
"license": "Apache License 2.0",
"lines": 155,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/run/requirement.py | from dataclasses import dataclass, field
from datetime import datetime, timezone
from typing import Any, Dict, List, Optional
from uuid import uuid4
from agno.models.response import ToolExecution, UserFeedbackQuestion, UserInputField
@dataclass
class RunRequirement:
"""Requirement to complete a paused run (used ... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/run/requirement.py",
"license": "Apache License 2.0",
"lines": 233,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/tests/integration/agent/human_in_the_loop/test_external_execution_flows.py | import pytest
from agno.agent import Agent, RunOutput # noqa
from agno.models.openai import OpenAIChat
from agno.tools.decorator import tool
def test_tool_call_requires_external_execution(shared_db):
@tool(external_execution=True)
def send_email(to: str, subject: str, body: str):
pass
agent = A... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/agent/human_in_the_loop/test_external_execution_flows.py",
"license": "Apache License 2.0",
"lines": 324,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ... | test |
agno-agi/agno:libs/agno/tests/integration/agent/human_in_the_loop/test_run_requirement.py | """Tests for the RunRequirement class, used to handle HITL flows"""
import pytest
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.decorator import tool
def test_run_requirement_needs_confirmation_flag(shared_db):
"""Test that needs_confirmation flag is set correctly"""
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/agent/human_in_the_loop/test_run_requirement.py",
"license": "Apache License 2.0",
"lines": 143,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/agent/human_in_the_loop/test_user_confirmation_flows.py | import pytest
from agno.agent import Agent, RunOutput # noqa
from agno.models.openai import OpenAIChat
from agno.tools.decorator import tool
def test_tool_call_requires_confirmation(shared_db):
@tool(requires_confirmation=True)
def get_the_weather(city: str):
return f"It is currently 70 degrees and ... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/agent/human_in_the_loop/test_user_confirmation_flows.py",
"license": "Apache License 2.0",
"lines": 422,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": "... | test |
agno-agi/agno:libs/agno/agno/tools/spotify.py | """
Spotify Toolkit for Agno SDK
A toolkit for searching songs, creating playlists, and updating playlists on Spotify.
Requires a valid Spotify access token with appropriate scopes.
Required scopes:
- user-read-private (for getting user ID)
- playlist-modify-public (for public playlists)
- playlist-modify-private (fo... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/tools/spotify.py",
"license": "Apache License 2.0",
"lines": 748,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/agno/table.py | import sqlite3
db_path = "tmp/traces.db"
table_name = "agno_spans"
conn = sqlite3.connect(db_path)
cur = conn.cursor()
cur.execute(f"DROP TABLE IF EXISTS {table_name}")
conn.commit()
conn.close()
| {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/table.py",
"license": "Apache License 2.0",
"lines": 8,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
agno-agi/agno:libs/agno/agno/os/routers/traces/schemas.py | from datetime import datetime
from enum import Enum
from typing import Any, Dict, List, Optional
from pydantic import BaseModel, Field
from agno.os.utils import format_duration_ms
class TraceSearchGroupBy(str, Enum):
"""Grouping options for trace search results."""
RUN = "run" # Returns individual traces ... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/os/routers/traces/schemas.py",
"license": "Apache License 2.0",
"lines": 495,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/agno/os/routers/traces/traces.py | import logging
from typing import Optional, Union
from fastapi import Depends, HTTPException, Query, Request
from fastapi.routing import APIRouter
from agno.db.base import AsyncBaseDb, BaseDb
from agno.os.auth import get_auth_token_from_request, get_authentication_dependency
from agno.os.routers.traces.schemas import... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/os/routers/traces/traces.py",
"license": "Apache License 2.0",
"lines": 686,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/agno/tracing/exporter.py | """
Custom OpenTelemetry SpanExporter that writes traces to Agno database.
"""
import asyncio
from collections import defaultdict
from typing import Dict, List, Sequence, Union
from opentelemetry.sdk.trace import ReadableSpan # type: ignore
from opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult #... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/tracing/exporter.py",
"license": "Apache License 2.0",
"lines": 132,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/agno/tracing/schemas.py | """
Trace data models for Agno tracing.
"""
from dataclasses import asdict, dataclass
from datetime import datetime, timezone
from typing import Any, Dict, List, Optional
from opentelemetry.sdk.trace import ReadableSpan # type: ignore
from opentelemetry.trace import SpanKind, StatusCode # type: ignore
@dataclass
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/tracing/schemas.py",
"license": "Apache License 2.0",
"lines": 234,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/agno/hooks/decorator.py | from functools import wraps
from typing import Any, Callable, TypeVar, Union, overload
# Type variable for better type hints
F = TypeVar("F", bound=Callable[..., Any])
# Attribute name used to mark hooks for background execution
HOOK_RUN_IN_BACKGROUND_ATTR = "_agno_run_in_background"
def _is_async_function(func: Ca... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/hooks/decorator.py",
"license": "Apache License 2.0",
"lines": 125,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/tests/integration/os/test_backround_tasks.py | """Integration tests for background tasks in AgentOS.
Note on Testing Background Tasks:
When using httpx.AsyncClient with ASGITransport for testing, the ASGI transport
waits for all background tasks to complete before returning the response. This is
by design in the ASGI specification to ensure background tasks finish... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/os/test_backround_tasks.py",
"license": "Apache License 2.0",
"lines": 285,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/agent/test_instructions.py | import pytest
from agno.agent import Agent
from agno.team import Team
def test_callable_instructions():
def instructions(agent: Agent, team: Team) -> str:
return "You are a helpful assistant."
agent = Agent(instructions=instructions)
team = Team(instructions=instructions, members=[])
agent.... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/agent/test_instructions.py",
"license": "Apache License 2.0",
"lines": 35,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/compression/manager.py | import asyncio
from dataclasses import dataclass, field
from textwrap import dedent
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Type, Union
from pydantic import BaseModel
from agno.models.base import Model
from agno.models.message import Message
from agno.models.utils import get_model
from agno.utils... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/compression/manager.py",
"license": "Apache License 2.0",
"lines": 228,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/tests/integration/agent/test_tool_compression.py | import pytest
from agno.agent import Agent
from agno.compression.manager import CompressionManager
from agno.models.openai import OpenAIChat
def search_tool(query: str) -> str:
"""Search tool that returns large content to trigger compression."""
return f"Search results for '{query}': " + ("This is detailed i... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/agent/test_tool_compression.py",
"license": "Apache License 2.0",
"lines": 91,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/teams/test_tool_compression.py | import pytest
from agno.agent import Agent
from agno.compression.manager import CompressionManager
from agno.models.openai import OpenAIChat
from agno.team.team import Team
def search_tool(query: str) -> str:
"""Search tool that returns large content to trigger compression."""
return f"Search results for '{q... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/teams/test_tool_compression.py",
"license": "Apache License 2.0",
"lines": 125,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/memory/strategies/base.py | from abc import ABC, abstractmethod
from typing import List
from agno.db.schemas import UserMemory
from agno.models.base import Model
from agno.utils.tokens import count_text_tokens
class MemoryOptimizationStrategy(ABC):
"""Abstract base class for memory optimization strategies.
Subclasses must implement op... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/memory/strategies/base.py",
"license": "Apache License 2.0",
"lines": 52,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | documentation |
agno-agi/agno:libs/agno/agno/memory/strategies/summarize.py | """Summarize strategy: Combine all memories into single comprehensive summary."""
from textwrap import dedent
from typing import List
from uuid import uuid4
from agno.db.schemas import UserMemory
from agno.memory.strategies import MemoryOptimizationStrategy
from agno.models.base import Model
from agno.models.message ... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/memory/strategies/summarize.py",
"license": "Apache License 2.0",
"lines": 153,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/agno/memory/strategies/types.py | """Memory optimization strategy types and factory."""
from enum import Enum
from agno.memory.strategies import MemoryOptimizationStrategy
class MemoryOptimizationStrategyType(str, Enum):
"""Enumeration of available memory optimization strategies."""
SUMMARIZE = "summarize"
class MemoryOptimizationStrateg... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/memory/strategies/types.py",
"license": "Apache License 2.0",
"lines": 25,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
agno-agi/agno:libs/agno/agno/utils/tokens.py | import json
import math
from functools import lru_cache
from pathlib import Path
from typing import Any, Dict, List, Optional, Sequence, Tuple, Type, Union
from pydantic import BaseModel
from agno.media import Audio, File, Image, Video
from agno.models.message import Message
from agno.tools.function import Function
f... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/utils/tokens.py",
"license": "Apache License 2.0",
"lines": 536,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/tests/unit/memory/test_memory_optimization.py | from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from agno.db.base import AsyncBaseDb, BaseDb
from agno.memory.manager import MemoryManager, UserMemory
from agno.memory.strategies import (
MemoryOptimizationStrategy,
MemoryOptimizationStrategyType,
)
@pytest.fixture
def mock_db():
db ... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/memory/test_memory_optimization.py",
"license": "Apache License 2.0",
"lines": 159,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/utils/test_tokens.py | import pytest
from agno.media import Audio, File, Image, Video
from agno.models.message import Message
from agno.utils.tokens import (
count_audio_tokens,
count_file_tokens,
count_image_tokens,
count_schema_tokens,
count_text_tokens,
count_tokens,
count_video_tokens,
)
def test_count_text... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/utils/test_tokens.py",
"license": "Apache License 2.0",
"lines": 311,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/agent/test_output_schema_override.py | import pytest
from pydantic import BaseModel, Field
from agno.agent import Agent, RunOutput
from agno.models.openai import OpenAIChat
class PersonSchema(BaseModel):
name: str = Field(..., description="Person's name")
age: int = Field(..., description="Person's age")
class BookSchema(BaseModel):
title: ... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/agent/test_output_schema_override.py",
"license": "Apache License 2.0",
"lines": 720,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/os/test_output_schema_override.py | """
Integration tests for AgentOS dynamic output_schema.
Tests passing output_schema as JSON schema string via AgentOS API endpoints.
"""
import json
import pytest
from fastapi.testclient import TestClient
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.openai import OpenAIChat
f... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/os/test_output_schema_override.py",
"license": "Apache License 2.0",
"lines": 832,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/teams/test_output_schema_override.py | import pytest
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.team import Team
@pytest.fixture(autouse=True)
def reset_async_client():
"""Reset global async HTTP client between tests to avoid event loop conflicts."""
import agno.utils.htt... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/teams/test_output_schema_override.py",
"license": "Apache License 2.0",
"lines": 730,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/knowledge/test_async_knowledge_retriever.py | """
Test for issue #5490: Async knowledge_retriever not properly awaited
when add_knowledge_to_context is enabled.
This test verifies that async knowledge retrievers are properly awaited
when using add_knowledge_to_context=True with async execution paths.
"""
import asyncio
from typing import Optional
import pytest
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/knowledge/test_async_knowledge_retriever.py",
"license": "Apache License 2.0",
"lines": 82,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/db/sqlite/test_memory.py | """Integration tests for the Memory related methods of the SqliteDb class"""
from typing import cast
import pytest
from agno.db.schemas.memory import UserMemory
from agno.db.sqlite.sqlite import SqliteDb
@pytest.fixture(autouse=True)
def cleanup_memories(sqlite_db_real: SqliteDb):
"""Fixture to clean-up sessio... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/db/sqlite/test_memory.py",
"license": "Apache License 2.0",
"lines": 45,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/os/test_memory.py | """Integration tests for the Memory routes in AgentOS."""
def test_create_memory(test_os_client):
"""Test creating a new memory."""
response = test_os_client.post(
"/memories",
json={
"memory": "User prefers technical explanations with code examples",
"user_id": "test-u... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/os/test_memory.py",
"license": "Apache License 2.0",
"lines": 259,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/os/test_team_runs.py | """Integration tests for running Teams in AgentOS."""
import json
from unittest.mock import AsyncMock, patch
from agno.run import RunContext
from agno.team.team import Team
def test_create_team_run(test_os_client, test_team: Team):
"""Test creating a team run using form input."""
response = test_os_client.p... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/os/test_team_runs.py",
"license": "Apache License 2.0",
"lines": 122,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/os/test_workflow_runs.py | """Integration tests for running Workflows in AgentOS."""
import json
from unittest.mock import AsyncMock, patch
from agno.workflow.workflow import Workflow
def test_create_workflow_run(test_os_client, test_workflow: Workflow):
"""Test creating a workflow run using form input."""
response = test_os_client.p... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/os/test_workflow_runs.py",
"license": "Apache License 2.0",
"lines": 89,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/tools/nano_banana.py | from __future__ import annotations
import os
from io import BytesIO
from typing import Any, List, Optional
from uuid import uuid4
from agno.media import Image
from agno.tools import Toolkit
from agno.tools.function import ToolResult
from agno.utils.log import log_debug, logger
try:
from google import genai
f... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/tools/nano_banana.py",
"license": "Apache License 2.0",
"lines": 120,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/tests/integration/workflows/test_convenience_functions.py | import uuid
import pytest
from agno.agent.agent import Agent
from agno.db.sqlite.async_sqlite import AsyncSqliteDb
from agno.db.sqlite.sqlite import SqliteDb
from agno.team.team import Team
from agno.workflow.step import Step
from agno.workflow.workflow import Workflow
# -- 1. Workflow class convenience functions --... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/workflows/test_convenience_functions.py",
"license": "Apache License 2.0",
"lines": 131,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/models/test_client_caching.py | """
Tests for httpx client caching and resource leak prevention.
This test suite verifies that:
1. Global httpx clients are singletons and reused across models
2. OpenAI clients are cached per model instance
3. No new httpx clients are created on every request
"""
import os
import httpx
import pytest
# Set test API... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/models/test_client_caching.py",
"license": "Apache License 2.0",
"lines": 267,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/db/async_mongo/test_db.py | """Integration tests for the setup and main methods of the AsyncMongoDb class
Required to have a running MongoDB instance to run these tests.
These tests assume:
- Username=mongoadmin
- Password=secret
"""
from datetime import datetime, timezone
import pytest
try:
from agno.db.mongo import AsyncMongoDb
except ... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/db/async_mongo/test_db.py",
"license": "Apache License 2.0",
"lines": 141,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/db/test_async_mongo.py | import asyncio
from unittest.mock import Mock, patch
import pytest
from pymongo import AsyncMongoClient
from agno.db.mongo import AsyncMongoDb
def test_id_is_deterministic():
"""Test that two db instances with same URL have same ID"""
db1 = AsyncMongoDb(db_url="mongodb://localhost:27017", db_name="test_db")... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/db/test_async_mongo.py",
"license": "Apache License 2.0",
"lines": 202,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/workflows/test_custom_executor_events.py | """Integration tests for workflow streaming events."""
from pydantic import BaseModel
from agno.agent.agent import Agent
from agno.workflow import Step, Workflow
from agno.workflow.types import StepInput, StepOutput
def test_agent_stream_basic_events():
def test_step_one_executor(step_input: StepInput) -> StepO... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/workflows/test_custom_executor_events.py",
"license": "Apache License 2.0",
"lines": 144,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/filters.py | """Search filter expressions for filtering knowledge base documents and search results.
This module provides a set of filter operators for constructing complex search queries
that can be applied to knowledge bases, vector databases, and other searchable content.
Filter Types:
- Comparison: EQ (equals), NEQ (not e... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/filters.py",
"license": "Apache License 2.0",
"lines": 386,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | documentation |
agno-agi/agno:libs/agno/tests/unit/test_filters.py | """Unit tests for search filter expressions.
Tests cover:
- Basic filter operators (EQ, IN, GT, LT, NEQ, GTE, LTE)
- String matching operators (CONTAINS, STARTSWITH)
- Logical operators (AND, OR, NOT)
- Operator overloading (&, |, ~)
- Serialization (to_dict)
- Deserialization (from_dict)
- Complex nested expressions
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/test_filters.py",
"license": "Apache License 2.0",
"lines": 1122,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/tools/parallel.py | import json
from os import getenv
from typing import Any, Dict, List, Optional
from agno.tools import Toolkit
from agno.utils.log import log_error
try:
from parallel import Parallel as ParallelClient
except ImportError:
raise ImportError("`parallel-web` not installed. Please install using `pip install paralle... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/tools/parallel.py",
"license": "Apache License 2.0",
"lines": 249,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/tests/unit/tools/test_parallel_tools.py | """Unit tests for ParallelTools"""
import json
from unittest.mock import Mock, patch
import pytest
from agno.tools.parallel import ParallelTools
@pytest.fixture
def mock_parallel_client():
"""Mock Parallel client."""
with patch("agno.tools.parallel.ParallelClient") as mock_client:
yield mock_client... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/test_parallel_tools.py",
"license": "Apache License 2.0",
"lines": 98,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/anthropic/test_betas.py | """Tests for Anthropic beta features support."""
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from agno.agent import Agent
from agno.models.anthropic import Claude
def _create_mock_response():
"""Create a properly structured mock response."""
mock_content_block = MagicMock()
mock... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/anthropic/test_betas.py",
"license": "Apache License 2.0",
"lines": 184,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/workflows/test_workflow_metrics.py | """Integration tests for Workflow metrics including duration tracking."""
import asyncio
import pytest
from agno.models.metrics import RunMetrics
from agno.run.workflow import WorkflowCompletedEvent
from agno.workflow import Condition, Parallel, Step, StepInput, StepOutput, Workflow
from agno.workflow.types import W... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/workflows/test_workflow_metrics.py",
"license": "Apache License 2.0",
"lines": 331,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/aimlapi/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.aimlapi import AIMLAPI
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: str = Field(
...,
desc... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/aimlapi/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/azure/ai_foundry/test_structured_response.py | import enum
from typing import Dict, List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.azure import AzureAIFoundry
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: str = Field(
...,
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/azure/ai_foundry/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 66,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/azure/openai/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.azure import AzureOpenAI
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: str = Field(
...,
de... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/azure/openai/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/cerebras/cerebras_openai/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.cerebras import CerebrasOpenAI
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: str = Field(
...,
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/cerebras/cerebras_openai/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template"... | test |
agno-agi/agno:libs/agno/tests/integration/models/cerebras/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.cerebras import Cerebras
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: str = Field(
...,
de... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/cerebras/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 113,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/cometapi/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.cometapi import CometAPI
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: str = Field(
...,
de... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/cometapi/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/dashscope/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.dashscope import DashScope
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: str = Field(
...,
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/dashscope/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/deepinfra/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.deepinfra import DeepInfra
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: str = Field(
...,
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/deepinfra/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/deepseek/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.deepseek import DeepSeek
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: str = Field(
...,
de... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/deepseek/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/fireworks/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.fireworks import Fireworks
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: str = Field(
...,
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/fireworks/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/langdb/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.langdb import LangDB
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: str = Field(
...,
descri... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/langdb/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/lmstudio/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.lmstudio import LMStudio
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: str = Field(
...,
de... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/lmstudio/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/meta/llama_openai/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.meta import LlamaOpenAI
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: str = Field(
...,
des... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/meta/llama_openai/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/nebius/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.nebius import Nebius
NEBIUS_MODEL_ID = "Qwen/Qwen3-4B-fast"
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: ... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/nebius/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 62,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/nvidia/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.nvidia import Nvidia
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: str = Field(
...,
descri... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/nvidia/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/openrouter/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.openrouter import OpenRouter
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: str = Field(
...,
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/openrouter/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/perplexity/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.perplexity import Perplexity
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: str = Field(
...,
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/perplexity/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/portkey/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.portkey import Portkey
PORTKEY_MODEL_ID = "gpt-4o-mini"
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: str ... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/portkey/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 62,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/sambanova/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.sambanova import Sambanova
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: str = Field(
...,
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/sambanova/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/together/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.together import Together
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: str = Field(
...,
de... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/together/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/vercel/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.vercel import V0
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: str = Field(
...,
descriptio... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/vercel/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/vllm/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.vllm import VLLM
VLLM_MODEL_ID = "Qwen/Qwen2.5-7B-Instruct"
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: ... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/vllm/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 62,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/xai/test_structured_response.py | import enum
from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.xai import xAI
class MovieScript(BaseModel):
setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.")
ending: str = Field(
...,
description=... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/xai/test_structured_response.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/test_basic.py | import pytest
from agno.agent.agent import Agent
from agno.knowledge.knowledge import Knowledge
from agno.models.openai import OpenAIChat
from agno.run.agent import RunOutput
from agno.team.team import Team
from agno.vectordb.chroma import ChromaDb
@pytest.fixture
def vector_db():
"""Setup a temporary vector DB ... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/test_basic.py",
"license": "Apache License 2.0",
"lines": 24,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/test_os_basic.py | import pytest
from fastapi.testclient import TestClient
from agno.agent.agent import Agent
from agno.knowledge.knowledge import Knowledge
from agno.models.openai import OpenAIChat
from agno.os import AgentOS
from agno.vectordb.chroma import ChromaDb
@pytest.fixture
def vector_db():
"""Setup a temporary vector DB... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/test_os_basic.py",
"license": "Apache License 2.0",
"lines": 37,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/knowledge/embedder/vllm.py | import asyncio
from dataclasses import dataclass
from os import getenv
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple
from agno.knowledge.embedder.base import Embedder
from agno.utils.log import logger
try:
from vllm import LLM # type: ignore
from vllm.outputs import EmbeddingRequestOutpu... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/knowledge/embedder/vllm.py",
"license": "Apache License 2.0",
"lines": 231,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/agno/vectordb/redis/redisdb.py | import asyncio
from typing import Any, Dict, List, Optional, Union
try:
from redis import Redis
from redis.asyncio import Redis as AsyncRedis
from redisvl.index import AsyncSearchIndex, SearchIndex
from redisvl.query import FilterQuery, HybridQuery, TextQuery, VectorQuery
from redisvl.query.filter ... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/vectordb/redis/redisdb.py",
"license": "Apache License 2.0",
"lines": 595,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/tests/unit/vectordb/test_redisdb.py | import sys
import types
from typing import Any, Dict, List
from unittest.mock import MagicMock
import pytest
from agno.knowledge.document import Document
from agno.vectordb.search import SearchType
@pytest.fixture()
def stub_redisvl(monkeypatch):
"""Patch installed redis/redisvl to avoid real network and return... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/vectordb/test_redisdb.py",
"license": "Apache License 2.0",
"lines": 237,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.