sample_id stringlengths 21 196 | text stringlengths 105 936k | metadata dict | category stringclasses 6
values |
|---|---|---|---|
agno-agi/agno:libs/agno/tests/unit/agent/test_basic.py | from agno.agent.agent import Agent
from agno.utils.string import is_valid_uuid
def test_set_id():
agent = Agent(
id="test_id",
)
agent.set_id()
assert agent.id == "test_id"
def test_set_id_from_name():
agent = Agent(
name="Test Name",
)
agent.set_id()
# Asserting the... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/agent/test_basic.py",
"license": "Apache License 2.0",
"lines": 42,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/team/test_basic.py | from unittest.mock import MagicMock
import pytest
pytest.importorskip("duckduckgo_search")
pytest.importorskip("yfinance")
from agno.agent import Agent
from agno.models.message import Message
from agno.models.metrics import RunMetrics
from agno.models.openai import OpenAIChat
from agno.run import RunContext
from agn... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/team/test_basic.py",
"license": "Apache License 2.0",
"lines": 172,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/telemetry/test_agent_telemetry.py | from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from agno.agent.agent import Agent
def test_agent_telemetry():
"""Test that telemetry logging is called during sync agent run."""
agent = Agent()
# Assert telemetry is active by default
assert agent.telemetry
# Mock the teleme... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/telemetry/test_agent_telemetry.py",
"license": "Apache License 2.0",
"lines": 41,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/telemetry/test_eval_telemetry.py | from unittest.mock import MagicMock, patch
from agno.agent.agent import Agent
from agno.eval.accuracy import AccuracyEval
from agno.eval.agent_as_judge import AgentAsJudgeEval
from agno.eval.performance import PerformanceEval
from agno.eval.reliability import ReliabilityEval
def test_accuracy_evals_telemetry():
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/telemetry/test_eval_telemetry.py",
"license": "Apache License 2.0",
"lines": 93,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/telemetry/test_os_telemetry.py | from unittest.mock import patch
from agno.agent.agent import Agent
from agno.os import AgentOS
def test_accuracy_evals_telemetry():
"""Test that telemetry logging is called when initializing an AgentOS instance."""
agent = Agent()
# Mock the API call that gets made when telemetry is enabled
with pat... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/telemetry/test_os_telemetry.py",
"license": "Apache License 2.0",
"lines": 15,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/telemetry/test_team_telemetry.py | from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from agno.agent.agent import Agent
from agno.team.team import Team
def test_team_telemetry():
"""Test that telemetry logging is called during sync team run."""
agent = Agent()
team = Team(members=[agent])
# Assert telemetry is acti... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/telemetry/test_team_telemetry.py",
"license": "Apache License 2.0",
"lines": 46,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/telemetry/test_workflow_telemetry.py | from unittest.mock import patch
import pytest
from agno.workflow.step import Step
from agno.workflow.workflow import Workflow
def dummy_step(step_input):
"""Simple dummy step for testing"""
from agno.workflow.types import StepOutput
return StepOutput(content="Test step executed")
def test_workflow_te... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/telemetry/test_workflow_telemetry.py",
"license": "Apache License 2.0",
"lines": 41,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/utils/test_logging.py | from unittest.mock import Mock
from agno.utils import log as log_module
from agno.utils.log import configure_agno_logging
def test_configure_agno_logging_sets_global_logger():
"""Test that configure_agno_logging can set the global logger."""
mock_logger = Mock()
original_logger = log_module.logger
t... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/utils/test_logging.py",
"license": "Apache License 2.0",
"lines": 38,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/utils/test_team.py | import uuid
from unittest.mock import patch
import pytest
from agno.agent.agent import Agent
from agno.models.openai import OpenAIChat
from agno.team.team import Team
from agno.utils.team import get_member_id
@pytest.fixture
def team_show_member_responses_true():
agent = Agent(name="Test Agent", model=OpenAICha... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/utils/test_team.py",
"license": "Apache License 2.0",
"lines": 97,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/vectordb/test_upstashdb.py | import os
from typing import List
from unittest.mock import MagicMock, Mock, patch
import pytest
from agno.knowledge.document import Document
from agno.vectordb.upstashdb import UpstashVectorDb
@pytest.fixture
def mock_embedder():
"""Fixture to create a mock embedder"""
embedder = MagicMock()
embedder.d... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/vectordb/test_upstashdb.py",
"license": "Apache License 2.0",
"lines": 244,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno_infra/agno/aws/api_client.py | from typing import Any, Optional
from agno.utilities.logging import logger
class AwsApiClient:
def __init__(
self,
aws_region: Optional[str] = None,
aws_profile: Optional[str] = None,
):
super().__init__()
self.aws_region: Optional[str] = aws_region
self.aws_pr... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno_infra/agno/aws/api_client.py",
"license": "Apache License 2.0",
"lines": 36,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
agno-agi/agno:libs/agno_infra/agno/aws/app/base.py | from typing import TYPE_CHECKING, Any, Dict, List, Optional
from pydantic import Field, field_validator
from pydantic_core.core_schema import ValidationInfo
from agno.aws.context import AwsBuildContext
from agno.base.app import InfraApp
from agno.base.context import ContainerContext
from agno.utilities.logging import... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno_infra/agno/aws/app/base.py",
"license": "Apache License 2.0",
"lines": 672,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno_infra/agno/aws/app/celery/worker.py | from typing import List, Optional, Union
from agno.aws.app.base import AwsApp, AwsBuildContext, ContainerContext # noqa: F401
class CeleryWorker(AwsApp):
# -*- App Name
name: str = "celery-worker"
# -*- Image Configuration
image_name: str = "agnohq/celery-worker"
image_tag: str = "latest"
c... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno_infra/agno/aws/app/celery/worker.py",
"license": "Apache License 2.0",
"lines": 12,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
agno-agi/agno:libs/agno_infra/agno/aws/app/fastapi/fastapi.py | from typing import Dict, List, Optional, Union
from agno.aws.app.base import AwsApp, AwsBuildContext, ContainerContext # noqa: F401
class FastApi(AwsApp):
# -*- App Name
name: str = "fastapi"
# -*- Image Configuration
image_name: str = "agnohq/fastapi"
image_tag: str = "0.104"
command: Opti... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno_infra/agno/aws/app/fastapi/fastapi.py",
"license": "Apache License 2.0",
"lines": 47,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
agno-agi/agno:libs/agno_infra/agno/aws/app/streamlit/streamlit.py | from typing import Dict, List, Optional, Union
from agno.aws.app.base import AwsApp, AwsBuildContext, ContainerContext # noqa: F401
class Streamlit(AwsApp):
# -*- App Name
name: str = "streamlit"
# -*- Image Configuration
image_name: str = "agnohq/streamlit"
image_tag: str = "1.27"
command:... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno_infra/agno/aws/app/streamlit/streamlit.py",
"license": "Apache License 2.0",
"lines": 56,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
agno-agi/agno:libs/agno_infra/agno/aws/resource/base.py | from typing import Any, Optional
from agno.aws.api_client import AwsApiClient
from agno.base.resource import InfraResource
from agno.cli.console import print_info
from agno.utilities.logging import logger
class AwsResource(InfraResource):
"""Base class for AWS Resources."""
service_name: str
service_cli... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno_infra/agno/aws/resource/base.py",
"license": "Apache License 2.0",
"lines": 164,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno_infra/agno/aws/resource/ec2/volume.py | from typing import Any, Dict, Optional
from typing_extensions import Literal
from agno.aws.api_client import AwsApiClient
from agno.aws.resource.base import AwsResource
from agno.cli.console import print_info
from agno.utilities.logging import logger
class EbsVolume(AwsResource):
"""
Reference:
- https:... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno_infra/agno/aws/resource/ec2/volume.py",
"license": "Apache License 2.0",
"lines": 301,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno_infra/agno/aws/resource/ecs/cluster.py | from typing import Any, Dict, List, Optional
from agno.aws.api_client import AwsApiClient
from agno.aws.resource.base import AwsResource
from agno.cli.console import print_info
from agno.utilities.logging import logger
class EcsCluster(AwsResource):
"""
Reference:
- https://boto3.amazonaws.com/v1/documen... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno_infra/agno/aws/resource/ecs/cluster.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_infra/agno/aws/resource/ecs/container.py | from typing import Any, Dict, List, Optional, Union
from agno.aws.api_client import AwsApiClient
from agno.aws.resource.base import AwsResource
from agno.aws.resource.secret.manager import SecretsManager
from agno.aws.resource.secret.reader import read_secrets
from agno.utilities.logging import logger
class EcsConta... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno_infra/agno/aws/resource/ecs/container.py",
"license": "Apache License 2.0",
"lines": 201,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno_infra/agno/aws/resource/ecs/volume.py | from typing import Any, Dict, Optional
from agno.aws.resource.base import AwsResource
from agno.utilities.logging import logger
class EcsVolume(AwsResource):
"""
Reference:
- https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html
"""
resource_type: Optional[str] = "E... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno_infra/agno/aws/resource/ecs/volume.py",
"license": "Apache License 2.0",
"lines": 70,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno_infra/agno/aws/resource/elasticache/cluster.py | from pathlib import Path
from typing import Any, Dict, List, Optional
from typing_extensions import Literal
from agno.aws.api_client import AwsApiClient
from agno.aws.resource.base import AwsResource
from agno.aws.resource.ec2.security_group import SecurityGroup
from agno.aws.resource.elasticache.subnet_group import ... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno_infra/agno/aws/resource/elasticache/cluster.py",
"license": "Apache License 2.0",
"lines": 416,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno_infra/agno/aws/resource/emr/cluster.py | from typing import Any, Dict, List, Optional
from typing_extensions import Literal
from agno.aws.api_client import AwsApiClient
from agno.aws.resource.base import AwsResource
from agno.cli.console import print_info
from agno.utilities.logging import logger
class EmrCluster(AwsResource):
"""
Reference:
-... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno_infra/agno/aws/resource/emr/cluster.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_infra/agno/aws/resource/s3/bucket.py | from typing import Any, Dict, List, Optional
from typing_extensions import Literal
from agno.aws.api_client import AwsApiClient
from agno.aws.resource.base import AwsResource
from agno.aws.resource.s3.object import S3Object
from agno.cli.console import print_info
from agno.utilities.logging import logger
class S3Bu... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno_infra/agno/aws/resource/s3/bucket.py",
"license": "Apache License 2.0",
"lines": 170,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno_infra/agno/aws/resource/s3/object.py | from pathlib import Path
from typing import Any, Optional
from pydantic import Field
from agno.aws.api_client import AwsApiClient
from agno.aws.resource.base import AwsResource
from agno.utilities.logging import logger
class S3Object(AwsResource):
"""
Reference:
- https://boto3.amazonaws.com/v1/document... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno_infra/agno/aws/resource/s3/object.py",
"license": "Apache License 2.0",
"lines": 48,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
agno-agi/agno:libs/agno_infra/agno/aws/resource/secret/manager.py | import json
from pathlib import Path
from typing import Any, Dict, List, Optional
from agno.aws.api_client import AwsApiClient
from agno.aws.resource.base import AwsResource
from agno.cli.console import print_info
from agno.utilities.logging import logger
class SecretsManager(AwsResource):
"""
Reference:
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno_infra/agno/aws/resource/secret/manager.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_infra/agno/aws/resources.py | from typing import List, Optional, Tuple
from pydantic import Field, PrivateAttr
from agno.aws.api_client import AwsApiClient
from agno.aws.app.base import AwsApp
from agno.aws.context import AwsBuildContext
from agno.aws.resource.base import AwsResource
from agno.base.resources import InfraResources
from agno.utilit... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno_infra/agno/aws/resources.py",
"license": "Apache License 2.0",
"lines": 481,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno_infra/agno/base/app.py | from typing import Any, Dict, List, Optional, Union
from pydantic import Field, ValidationInfo, field_validator
from agno.base.base import InfraBase
from agno.base.context import ContainerContext
from agno.base.resource import InfraResource
from agno.utilities.logging import logger
class InfraApp(InfraBase):
""... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno_infra/agno/base/app.py",
"license": "Apache License 2.0",
"lines": 235,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno_infra/agno/base/base.py | from pathlib import Path
from typing import Any, Dict, List, Optional
from pydantic import BaseModel, ConfigDict
from agno.infra.settings import InfraSettings
class InfraBase(BaseModel):
"""Base class for all InfraResource, InfraApp and InfraResources objects."""
# Name of the infrastructure resource
n... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno_infra/agno/base/base.py",
"license": "Apache License 2.0",
"lines": 100,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno_infra/agno/base/context.py | from typing import Optional
from pydantic import BaseModel
class ContainerContext(BaseModel):
"""ContainerContext is a context object passed when creating containers."""
# Infra name
infra_name: str
# Path to the infra directory inside the container
infra_root: str
# Path to the infra parent... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno_infra/agno/base/context.py",
"license": "Apache License 2.0",
"lines": 12,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
agno-agi/agno:libs/agno_infra/agno/base/resources.py | from typing import Any, List, Optional, Tuple
from agno.base.base import InfraBase
class InfraResources(InfraBase):
"""InfraResources is a group of InfraResource and InfraApp objects
that are managed together.
"""
apps: Optional[List[Any]] = None
resources: Optional[List[Any]] = None
def cr... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno_infra/agno/base/resources.py",
"license": "Apache License 2.0",
"lines": 47,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
agno-agi/agno:libs/agno/tests/integration/models/anthropic/test_format_tools.py | from typing import Any, Dict, List, Optional, Union
from pydantic import BaseModel, Field
from agno.tools.function import Function
from agno.utils.models.claude import format_tools_for_model
def test_none_input():
"""Test that None input returns None."""
result = format_tools_for_model(None)
assert resu... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/anthropic/test_format_tools.py",
"license": "Apache License 2.0",
"lines": 207,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/tools/neo4j.py | import os
from typing import Any, List, Optional
try:
from neo4j import GraphDatabase
except ImportError:
raise ImportError("`neo4j` not installed. Please install using `pip install neo4j`")
from agno.tools import Toolkit
from agno.utils.log import log_debug, logger
class Neo4jTools(Toolkit):
def __init... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/tools/neo4j.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/unit/tools/test_neo4j.py | import os
from unittest.mock import MagicMock, patch
import pytest
from agno.tools.neo4j import Neo4jTools
def test_list_labels():
with patch("neo4j.GraphDatabase.driver") as mock_driver:
mock_session = mock_driver.return_value.session.return_value
# Patch the context manager's __enter__ to retu... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/test_neo4j.py",
"license": "Apache License 2.0",
"lines": 136,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/tools/brandfetch.py | """
Brandfetch API toolkit for retrieving brand data and searching brands.
"""
import warnings
from os import getenv
from typing import Any, List, Optional
try:
import httpx
except ImportError:
raise ImportError("`httpx` not installed.")
from agno.tools import Toolkit
class BrandfetchTools(Toolkit):
""... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/tools/brandfetch.py",
"license": "Apache License 2.0",
"lines": 183,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/agno/models/dashscope/dashscope.py | from dataclasses import dataclass
from os import getenv
from typing import Any, Dict, List, Optional, Type, Union
from pydantic import BaseModel
from agno.exceptions import ModelAuthenticationError
from agno.models.openai.like import OpenAILike
@dataclass
class DashScope(OpenAILike):
"""
A class for interac... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/models/dashscope/dashscope.py",
"license": "Apache License 2.0",
"lines": 72,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/tests/integration/models/dashscope/test_basic.py | import pytest
from pydantic import BaseModel, Field
from agno.agent import Agent, RunOutput # noqa
from agno.db.sqlite import SqliteDb
from agno.models.dashscope import DashScope
def _assert_metrics(response: RunOutput):
assert response.metrics is not None
input_tokens = response.metrics.input_tokens
ou... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/dashscope/test_basic.py",
"license": "Apache License 2.0",
"lines": 118,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/dashscope/test_multimodal.py | from pathlib import Path
import pytest
from agno.agent.agent import Agent
from agno.media import Image
from agno.models.dashscope import DashScope
def test_image_input_url():
agent = Agent(model=DashScope(id="qwen-vl-plus"), markdown=True, telemetry=False)
response = agent.run(
"Tell me about this ... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/dashscope/test_multimodal.py",
"license": "Apache License 2.0",
"lines": 41,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/dashscope/test_tool_use.py | from typing import Optional
import pytest
from agno.agent import Agent
from agno.models.dashscope import DashScope
from agno.tools.exa import ExaTools
from agno.tools.websearch import WebSearchTools
from agno.tools.yfinance import YFinanceTools
def test_tool_use():
agent = Agent(
model=DashScope(id="qwe... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/dashscope/test_tool_use.py",
"license": "Apache License 2.0",
"lines": 156,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/models/openai/test_openai_responses_id_handling.py | from typing import Any, Dict, List, Optional
from agno.models.message import Message
from agno.models.openai.responses import OpenAIResponses
from agno.models.response import ModelResponse
class _FakeError:
def __init__(self, message: str):
self.message = message
class _FakeOutputFunctionCall:
def ... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/models/openai/test_openai_responses_id_handling.py",
"license": "Apache License 2.0",
"lines": 153,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/tools/trafilatura.py | import json
from typing import Any, Callable, Dict, List, Optional, Set
from agno.tools import Toolkit
from agno.utils.log import log_debug, logger
try:
from trafilatura import (
extract,
extract_metadata,
fetch_url,
html2txt,
)
from trafilatura.meta import reset_caches
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/tools/trafilatura.py",
"license": "Apache License 2.0",
"lines": 322,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/tests/unit/tools/test_trafilatura.py | import json
from unittest.mock import Mock, patch
import pytest
from agno.tools.trafilatura import TrafilaturaTools
@pytest.fixture
def mock_trafilatura_modules():
"""Mock all trafilatura module imports."""
with (
patch("agno.tools.trafilatura.extract") as mock_extract,
patch("agno.tools.tra... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/test_trafilatura.py",
"license": "Apache License 2.0",
"lines": 371,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/agent/test_output_model.py | from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.models.openai import OpenAIChat
from agno.run.agent import IntermediateRunContentEvent, RunContentEvent
def test_claude_with_openai_output_model():
park_agent = Agent(
model=Claude(id="claude-sonnet-4-20250514"), # Main model... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/agent/test_output_model.py",
"license": "Apache License 2.0",
"lines": 127,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/agent/test_message_ordering.py | from agno.agent import Agent
from agno.models.openai import OpenAIChat
def test_message_ordering_run():
"""Test that historical messages come before current user message"""
agent = Agent(
model=OpenAIChat(id="gpt-4o-mini"),
user_id="test_user",
session_id="test_session",
add_hi... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/agent/test_message_ordering.py",
"license": "Apache License 2.0",
"lines": 99,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/teams/test_team_with_output_model.py | from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.models.openai import OpenAIChat
from agno.run.team import IntermediateRunContentEvent, RunContentEvent
from agno.team import Team
agent = Agent(
model=Claude(id="claude-sonnet-4-20250514"),
description="You are an expert on nationa... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/teams/test_team_with_output_model.py",
"license": "Apache License 2.0",
"lines": 81,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/tools/test_google_calendar.py | """Unit tests for Google Calendar Tools."""
import json
import os
import tempfile
from unittest.mock import MagicMock, Mock, patch
import pytest
from google.oauth2.credentials import Credentials
from agno.tools.google.calendar import GoogleCalendarTools
@pytest.fixture
def mock_credentials():
"""Mock Google OA... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/test_google_calendar.py",
"license": "Apache License 2.0",
"lines": 407,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/agent/test_agent_knowledge.py | import pytest
from agno.agent import Agent
# Create a mock knowledge object
class MockKnowledge:
def __init__(self):
self.max_results = 5
self.vector_db = None
def validate_filters(self, filters):
return filters or {}, []
async def avalidate_filters(self, filters):
retur... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/agent/test_agent_knowledge.py",
"license": "Apache License 2.0",
"lines": 73,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/tools/test_jina.py | from unittest.mock import MagicMock, patch
import httpx
import pytest
from agno.tools.jina import JinaReaderTools, JinaReaderToolsConfig
@pytest.fixture()
def jina_tools():
return JinaReaderTools(api_key="test_api_key")
@pytest.fixture
def sample_read_url_response():
"""Sample response for read_url functi... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/test_jina.py",
"license": "Apache License 2.0",
"lines": 204,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/litellm/test_multimodal.py | from typing import Any
import requests
from agno.agent.agent import Agent
from agno.media import Audio, Image
from agno.models.litellm import LiteLLM
from agno.tools.websearch import WebSearchTools
def _get_audio_input() -> bytes | Any:
"""Fetch an example audio file and return it as base64 encoded string"""
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/litellm/test_multimodal.py",
"license": "Apache License 2.0",
"lines": 63,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/litellm_openai/test_multimodal.py | from typing import Any, Union
import requests
from agno.agent.agent import Agent
from agno.media import Audio, Image
from agno.models.litellm import LiteLLMOpenAI
from agno.tools.websearch import WebSearchTools
def _get_audio_input() -> Union[bytes, Any]:
"""Fetch an example audio file and return it as base64 e... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/litellm_openai/test_multimodal.py",
"license": "Apache License 2.0",
"lines": 63,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/tools/models/morph.py | import os
from os import getenv
from textwrap import dedent
from typing import Optional
from agno.tools import Toolkit
from agno.utils.log import log_debug, log_error
try:
from openai import OpenAI
except ImportError:
raise ImportError("`openai` not installed. Please install using `pip install openai`")
cla... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/tools/models/morph.py",
"license": "Apache License 2.0",
"lines": 154,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/tests/unit/tools/models/test_morph.py | from unittest.mock import MagicMock, mock_open, patch
import pytest
from agno.tools.models.morph import MorphTools
# Fixture for mock OpenAI client
@pytest.fixture
def mock_openai_client():
client = MagicMock()
return client
# Fixture for mock MorphTools with mock client
@pytest.fixture
def mock_morph_too... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/models/test_morph.py",
"license": "Apache License 2.0",
"lines": 187,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/tools/linkup.py | from os import getenv
from typing import Any, List, Literal, Optional
from agno.tools import Toolkit
from agno.utils.log import logger
try:
from linkup import LinkupClient
except ImportError:
raise ImportError("`linkup-sdk` not installed. Please install using `pip install linkup-sdk`")
class LinkupTools(Too... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/tools/linkup.py",
"license": "Apache License 2.0",
"lines": 48,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
agno-agi/agno:libs/agno/agno/tools/evm.py | from os import getenv
from typing import Optional
from agno.tools import Toolkit
from agno.utils.log import log_debug, log_error
try:
from eth_account.account import LocalAccount
from eth_account.datastructures import SignedTransaction
from hexbytes import HexBytes
from web3 import Web3
from web3.... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/tools/evm.py",
"license": "Apache License 2.0",
"lines": 106,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/tests/unit/tools/test_evm.py | """Unit tests for EvmTools class."""
from unittest.mock import Mock, patch
import pytest
from agno.tools.evm import EvmTools
@pytest.fixture
def mock_web3_client():
"""Create a mocked Web3 client with all required methods."""
mock_client = Mock()
# Mock Web3 conversion methods
mock_client.to_wei =... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/test_evm.py",
"license": "Apache License 2.0",
"lines": 244,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/tools/test_postgres.py | from unittest.mock import Mock, mock_open, patch
import psycopg
import pytest
from agno.tools.postgres import PostgresTools
# --- Mock Data for Tests ---
MOCK_TABLES_RESULT = [{"table_name": "employees"}, {"table_name": "departments"}, {"table_name": "projects"}]
MOCK_DESCRIBE_RESULT = [
{"column_name": "id", "... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/test_postgres.py",
"license": "Apache License 2.0",
"lines": 252,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/portkey/test_basic.py | import pytest
from pydantic import BaseModel, Field
from agno.agent import Agent, RunOutput # noqa
from agno.db.sqlite import SqliteDb
from agno.models.portkey import Portkey
PORTKEY_MODEL_ID = "gpt-4o-mini"
def _assert_metrics(response: RunOutput):
assert response.metrics is not None
input_tokens = respon... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/portkey/test_basic.py",
"license": "Apache License 2.0",
"lines": 117,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/portkey/test_tool_use.py | from typing import Optional
import pytest
from agno.agent import Agent
from agno.models.portkey import Portkey
from agno.tools.exa import ExaTools
from agno.tools.websearch import WebSearchTools
from agno.tools.yfinance import YFinanceTools
PORTKEY_MODEL_ID = "gpt-4o-mini"
def test_tool_use():
agent = Agent(
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/portkey/test_tool_use.py",
"license": "Apache License 2.0",
"lines": 170,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/tools/test_daytona.py | """Test DaytonaTools functionality."""
import sys
from unittest.mock import MagicMock, patch
import pytest
# Create a proper mock Configuration class that can be patched
class MockConfiguration:
def __init__(self, *args, **kwargs):
self.verify_ssl = True
# Mock the daytona modules before importing Day... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/test_daytona.py",
"license": "Apache License 2.0",
"lines": 213,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/embedder/test_jina_embedder.py | import pytest
from agno.knowledge.embedder.jina import JinaEmbedder
@pytest.fixture
def embedder():
return JinaEmbedder()
def test_embedder_initialization(embedder):
"""Test that the embedder initializes correctly"""
assert embedder is not None
assert embedder.id == "jina-embeddings-v3" # Field is... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/embedder/test_jina_embedder.py",
"license": "Apache License 2.0",
"lines": 97,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/tools/bitbucket.py | import base64
import json
from os import getenv
from typing import Any, Dict, Optional, Union
import requests
from agno.tools import Toolkit
from agno.utils.log import logger
class BitbucketTools(Toolkit):
def __init__(
self,
server_url: str = "api.bitbucket.org",
username: Optional[str]... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/tools/bitbucket.py",
"license": "Apache License 2.0",
"lines": 247,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/tests/unit/tools/test_bitbucket.py | import json
import os
from unittest.mock import MagicMock, patch
import pytest
import requests
from agno.tools.bitbucket import BitbucketTools
class TestBitbucketTools:
"""Test suite for BitbucketTools class."""
@pytest.fixture
def mock_env_vars(self):
"""Mock environment variables for testing.... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/test_bitbucket.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/agno/models/portkey/portkey.py | from dataclasses import dataclass
from os import getenv
from typing import Any, Dict, Optional, cast
from agno.exceptions import ModelAuthenticationError
from agno.models.openai.like import OpenAILike
try:
from portkey_ai import PORTKEY_GATEWAY_URL, createHeaders
except ImportError:
raise ImportError("`portke... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/models/portkey/portkey.py",
"license": "Apache License 2.0",
"lines": 66,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/agno/vectordb/surrealdb/surrealdb.py | from typing import Any, Dict, Final, List, Optional, Union
try:
from surrealdb import (
AsyncHttpSurrealConnection,
AsyncWsSurrealConnection,
BlockingHttpSurrealConnection,
BlockingWsSurrealConnection,
)
except ImportError as e:
msg = "The `surrealdb` package is not installe... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/vectordb/surrealdb/surrealdb.py",
"license": "Apache License 2.0",
"lines": 541,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/tests/unit/vectordb/test_surrealdb.py | from typing import Generator, List
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from agno.knowledge.document import Document
from agno.vectordb.surrealdb import SurrealDb
try:
from surrealdb import Surreal
except ImportError:
raise ImportError("surrealdb is not installed")
@pytest.fi... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/vectordb/test_surrealdb.py",
"license": "Apache License 2.0",
"lines": 282,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/agent/test_memory_impact.py | import gc
import tracemalloc
from typing import List, Tuple
from agno.agent.agent import Agent
from agno.db.base import SessionType
from agno.models.openai.chat import OpenAIChat
class MemoryMonitor:
"""Utility class to monitor memory usage during agent operations using tracemalloc."""
def __init__(self):
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/agent/test_memory_impact.py",
"license": "Apache License 2.0",
"lines": 210,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/teams/test_memory_impact.py | import asyncio
import gc
import tracemalloc
from typing import List, Tuple
import pytest
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
class MemoryMonitor:
"""Utility class to monitor memory usage during tea... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/teams/test_memory_impact.py",
"license": "Apache License 2.0",
"lines": 403,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/response.py | import json
import time
from agno.models.message import Message, Metrics
from agno.models.response import ToolExecution
from agno.run.agent import RunOutput
def test_timer_serialization():
message_1 = Message(role="user", content="Hello, world!")
message_2 = Message(role="assistant", metrics=Metrics())
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/response.py",
"license": "Apache License 2.0",
"lines": 33,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/tools/oxylabs.py | import json
from os import getenv
from typing import Any, Callable, Dict, List, Optional
from urllib.parse import urlparse
from agno.tools import Toolkit
from agno.utils.log import log_debug, log_error, log_info
try:
from oxylabs import RealtimeClient
from oxylabs.sources.response import Response
from oxy... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/tools/oxylabs.py",
"license": "Apache License 2.0",
"lines": 318,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/tests/unit/tools/test_oxylabs.py | """Unit tests for OxylabsTools class."""
import json
from unittest.mock import Mock, patch
import pytest
from agno.agent import Agent
from agno.tools.oxylabs import OxylabsTools
@pytest.fixture
def mock_agent():
"""Create a mock Agent instance."""
return Mock(spec=Agent)
@pytest.fixture
def mock_oxylabs_... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/test_oxylabs.py",
"license": "Apache License 2.0",
"lines": 287,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/teams/test_team_with_member_with_parser_model.py | from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.team import Team
class ParkGuide(BaseModel):
park_name: str = Field(..., description="The official name of the national park.")
activities: List[str] = Field(
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/teams/test_team_with_member_with_parser_model.py",
"license": "Apache License 2.0",
"lines": 63,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/tools/test_duckdb.py | from unittest.mock import MagicMock, patch
import pytest
from agno.tools.duckdb import DuckDbTools
@pytest.fixture
def mock_duckdb_connection():
"""Mock DuckDB connection used by DuckDbTools."""
with patch("agno.tools.duckdb.duckdb") as mock_duckdb:
mock_connection = MagicMock()
mock_duckdb.... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/test_duckdb.py",
"license": "Apache License 2.0",
"lines": 244,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/tools/valyu.py | import json
from os import getenv
from typing import Any, List, Optional
from agno.tools import Toolkit
from agno.utils.log import log_debug, log_error, log_warning
try:
from valyu import Valyu
except ImportError:
raise ImportError("`valyu` not installed. Please install using `pip install valyu`")
class Val... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/tools/valyu.py",
"license": "Apache License 2.0",
"lines": 197,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/tests/unit/tools/test_valyu.py | import json
from unittest.mock import patch
import pytest
from agno.tools.valyu import ValyuTools
class MockSearchResult:
def __init__(
self,
title="Test Paper",
url="https://example.com",
content="Test content",
source="test",
relevance_score=0.8,
descrip... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/test_valyu.py",
"license": "Apache License 2.0",
"lines": 171,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/tools/test_serper.py | import json
from unittest.mock import Mock, patch
import pytest
import requests
from agno.tools.serper import SerperTools
@pytest.fixture(autouse=True)
def clear_env(monkeypatch):
"""Ensure SERPER_API_KEY is unset unless explicitly needed."""
monkeypatch.delenv("SERPER_API_KEY", raising=False)
@pytest.fix... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/test_serper.py",
"license": "Apache License 2.0",
"lines": 289,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/unit/utils/test_audio_utils.py | import base64
import os
import tempfile
from pathlib import Path
from unittest.mock import patch
import pytest
from agno.utils.audio import write_audio_to_file
def test_write_audio_to_file_basic():
"""Test basic audio file writing functionality."""
# Create test audio data
test_audio_data = b"test audio... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/utils/test_audio_utils.py",
"license": "Apache License 2.0",
"lines": 243,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/tools/opencv.py | import time
from pathlib import Path
from typing import Callable, List
from uuid import uuid4
from agno.agent import Agent
from agno.media import Image, Video
from agno.tools import Toolkit
from agno.tools.function import ToolResult
from agno.utils.log import log_debug, log_error, log_info
try:
import cv2
except ... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/tools/opencv.py",
"license": "Apache License 2.0",
"lines": 261,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/tests/unit/tools/test_opencv.py | """Unit tests for OpenCVTools class."""
from unittest.mock import Mock, patch
import numpy as np
import pytest
from agno.agent import Agent
from agno.media import Image, Video
from agno.tools.function import ToolResult
from agno.tools.opencv import OpenCVTools
@pytest.fixture
def mock_cv2():
"""Create a mock O... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/test_opencv.py",
"license": "Apache License 2.0",
"lines": 477,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/tools/brightdata.py | import base64
import json
from os import getenv
from typing import Any, Dict, List, Optional
from uuid import uuid4
from agno.agent import Agent
from agno.media import Image
from agno.tools import Toolkit
from agno.tools.function import ToolResult
from agno.utils.log import log_debug, log_error, log_info
try:
imp... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/tools/brightdata.py",
"license": "Apache License 2.0",
"lines": 304,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/tests/unit/tools/test_brightdata.py | """Unit tests for BrightDataTools class."""
import base64
import json
from unittest.mock import Mock, patch
import pytest
import requests
from agno.agent import Agent
from agno.media import Image
from agno.tools.brightdata import BrightDataTools
from agno.tools.function import ToolResult
@pytest.fixture
def mock_a... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/test_brightdata.py",
"license": "Apache License 2.0",
"lines": 301,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/run/base.py | from dataclasses import asdict, dataclass
from enum import Enum
from typing import Any, Dict, List, Optional, Type, Union
from pydantic import BaseModel
from agno.filters import FilterExpr
from agno.media import Audio, Image, Video
from agno.models.message import Citations, Message, MessageReferences
from agno.models... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/run/base.py",
"license": "Apache License 2.0",
"lines": 229,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/agno/run/workflow.py | from dataclasses import asdict, dataclass, field
from enum import Enum
from time import time
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
from pydantic import BaseModel
from agno.media import Audio, File, Image, Video
from agno.run.agent import RunEvent, RunOutput, run_output_event_from_dict
fro... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/run/workflow.py",
"license": "Apache License 2.0",
"lines": 665,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/agno/utils/events.py | from typing import Any, Dict, List, Optional, Union
from agno.media import Audio, Image
from agno.models.message import Citations
from agno.models.response import ToolExecution
from agno.reasoning.step import ReasoningStep
from agno.run.agent import (
CompressionCompletedEvent,
CompressionStartedEvent,
Mem... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/utils/events.py",
"license": "Apache License 2.0",
"lines": 938,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
agno-agi/agno:libs/agno/tests/integration/agent/test_event_streaming.py | from dataclasses import dataclass
from textwrap import dedent
import pytest
from pydantic import BaseModel
from agno.agent.agent import Agent
from agno.db.base import SessionType
from agno.models.openai.chat import OpenAIChat
from agno.run.agent import CustomEvent, RunEvent, RunInput, RunOutput
from agno.tools.decora... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/agent/test_event_streaming.py",
"license": "Apache License 2.0",
"lines": 1188,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/teams/test_event_streaming.py | from textwrap import dedent
import pytest
from pydantic import BaseModel
from agno.agent import RunEvent
from agno.agent.agent import Agent
from agno.db.in_memory.in_memory_db import InMemoryDb
from agno.models.openai.chat import OpenAIChat
from agno.run.team import TeamRunInput, TeamRunOutput
from agno.team import T... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/teams/test_event_streaming.py",
"license": "Apache License 2.0",
"lines": 981,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/utils/location.py | from typing import Any, Dict
import requests
from agno.utils.log import log_warning
def get_location() -> Dict[str, Any]:
"""Get approximate location using IP geolocation."""
try:
response = requests.get("https://api.ipify.org?format=json", timeout=5)
ip = response.json()["ip"]
respo... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/utils/location.py",
"license": "Apache License 2.0",
"lines": 15,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
agno-agi/agno:libs/agno/agno/tools/aws_ses.py | from typing import Optional
from agno.tools import Toolkit
from agno.utils.log import log_debug
try:
import boto3
except ImportError:
raise ImportError("boto3 is required for AWSSESTool. Please install it using `pip install boto3`.")
class AWSSESTool(Toolkit):
def __init__(
self,
sender_... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/tools/aws_ses.py",
"license": "Apache License 2.0",
"lines": 60,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/tests/unit/tools/test_aws_ses.py | """Unit tests for AWS SES Tool"""
from unittest.mock import Mock, patch
import pytest
from botocore.exceptions import ClientError
from agno.tools.aws_ses import AWSSESTool
class TestAWSSESTool:
"""Test cases for AWSSESTool"""
@patch("boto3.client")
def test_initialization_default_region(self, mock_bot... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/test_aws_ses.py",
"license": "Apache License 2.0",
"lines": 185,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/tools/daytona.py | import json
from os import getenv
from pathlib import Path
from textwrap import dedent
from typing import Any, Dict, List, Optional, Union
from agno.agent import Agent
from agno.team import Team
from agno.tools import Toolkit
from agno.utils.code_execution import prepare_python_code
from agno.utils.log import log_debu... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/tools/daytona.py",
"license": "Apache License 2.0",
"lines": 389,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/agno/utils/code_execution.py | """Utils for our multiple integrations with external code execution environments."""
import re
def prepare_python_code(code: str) -> str:
"""Fix common problems with LLM-generated Python code."""
python_keywords = {"true": "True", "false": "False", "none": "None"}
for lowercase, capitalized in python_key... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/utils/code_execution.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/tests/unit/tools/test_crawl4ai.py | """Unit tests for Crawl4aiTools class."""
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from agno.tools.crawl4ai import Crawl4aiTools
@pytest.fixture
def mock_async_crawler():
"""Create a mock AsyncWebCrawler."""
with patch("agno.tools.crawl4ai.AsyncWebCrawler") as mock_crawler:
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/test_crawl4ai.py",
"license": "Apache License 2.0",
"lines": 277,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/agent/test_parser_model.py | from typing import List
from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.models.google import Gemini
from agno.models.openai import OpenAIChat
class ParkGuide(BaseModel):
park_name: str = Field(..., description="The official name of the nation... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/agent/test_parser_model.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/agno/tools/webtools.py | import httpx
from agno.tools import Toolkit
from agno.utils.log import logger
class WebTools(Toolkit):
"""
A toolkit for working with web-related tools.
"""
def __init__(
self,
retries: int = 3,
enable_expand_url: bool = True,
all: bool = False,
**kwargs,
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/tools/webtools.py",
"license": "Apache License 2.0",
"lines": 35,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
agno-agi/agno:libs/agno/tests/unit/tools/test_webtools.py | """Unit tests for WebTools class."""
from unittest.mock import Mock, patch
import pytest
from agno.tools.webtools import WebTools
@pytest.fixture
def web_tools():
"""Fixture to create a WebTools instance."""
return WebTools(retries=3)
def test_expand_url_success(web_tools):
"""Test successful expansi... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/unit/tools/test_webtools.py",
"license": "Apache License 2.0",
"lines": 21,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/models/langdb/langdb.py | from dataclasses import dataclass, field
from os import getenv
from typing import Any, Dict, Optional
from agno.exceptions import ModelAuthenticationError
from agno.models.openai.like import OpenAILike
@dataclass
class LangDB(OpenAILike):
"""
A class for using models hosted on LangDB.
Attributes:
... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/models/langdb/langdb.py",
"license": "Apache License 2.0",
"lines": 47,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
agno-agi/agno:libs/agno/tests/integration/models/langdb/test_basic.py | import pytest
from pydantic import BaseModel, Field
from agno.agent import Agent, RunOutput # noqa
from agno.db.sqlite import SqliteDb
from agno.models.langdb import LangDB
def _assert_metrics(response: RunOutput):
assert response.metrics is not None
input_tokens = response.metrics.input_tokens
output_t... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/langdb/test_basic.py",
"license": "Apache License 2.0",
"lines": 116,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/langdb/test_tool_use.py | from typing import Optional
import pytest
from agno.agent import Agent, RunOutput # noqa
from agno.models.langdb import LangDB
from agno.tools.exa import ExaTools
from agno.tools.websearch import WebSearchTools
from agno.tools.yfinance import YFinanceTools
def test_tool_use():
agent = Agent(
model=Lang... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/langdb/test_tool_use.py",
"license": "Apache License 2.0",
"lines": 195,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/tests/integration/models/anthropic/test_prompt_caching.py | """
Integration tests for Claude model prompt caching functionality.
Tests the basic caching features including:
- System message caching with real API calls
- Cache performance tracking
- Usage metrics with standard field names
"""
from pathlib import Path
from unittest.mock import Mock
import pytest
from agno.age... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/anthropic/test_prompt_caching.py",
"license": "Apache License 2.0",
"lines": 116,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
agno-agi/agno:libs/agno/agno/models/vllm/vllm.py | from dataclasses import dataclass
from os import getenv
from typing import Any, Dict, List, Optional, Type, Union
from pydantic import BaseModel
from agno.exceptions import ModelAuthenticationError
from agno.models.openai.like import OpenAILike
from agno.utils.log import log_debug
@dataclass
class VLLM(OpenAILike):... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/agno/models/vllm/vllm.py",
"license": "Apache License 2.0",
"lines": 69,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
agno-agi/agno:libs/agno/tests/integration/models/vllm/test_basic.py | import pytest
from pydantic import BaseModel, Field
from agno.agent import Agent, RunOutput
from agno.db.sqlite.sqlite import SqliteDb
from agno.exceptions import ModelProviderError
from agno.models.vllm import VLLM
# Use default model id or override via env var
VLLM_MODEL_ID = "Qwen/Qwen2.5-7B-Instruct"
def _asser... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/vllm/test_basic.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/models/vllm/test_tool_use.py | from typing import Optional
import pytest
from agno.agent import Agent
from agno.models.vllm import VLLM
from agno.tools.exa import ExaTools
from agno.tools.websearch import WebSearchTools
from agno.tools.yfinance import YFinanceTools
VLLM_MODEL_ID = "Qwen/Qwen2.5-7B-Instruct"
def test_tool_use():
agent = Agen... | {
"repo_id": "agno-agi/agno",
"file_path": "libs/agno/tests/integration/models/vllm/test_tool_use.py",
"license": "Apache License 2.0",
"lines": 167,
"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.