repo stringclasses 454
values | file_path stringlengths 5 201 | extension stringclasses 1
value | content stringlengths 8 509k | num_lines int64 3 16.9k | size_bytes int64 8 511k |
|---|---|---|---|---|---|
deepagents | libs/evals/tests/evals/test_iterative_constraint_satisfaction.py | .py | """Eval test for iterative constraint satisfaction.
Asks a deep agent to produce a paragraph under two simultaneous hard
constraints: exact word count AND every sentence must start with the
phrase `Zebra protocol`. The agent is wired with `RubricMiddleware`, so
a separate grader sub-agent evaluates each draft against ... | 195 | 7,369 |
deepagents | libs/evals/tests/evals/llm_judge.py | .py | """LLM-as-judge assertion for agent trajectory evaluation.
Thin adapter around `openevals.llm.create_llm_as_judge` that exposes a
`SuccessAssertion` for the deepagents `TrajectoryScorer` framework. Each
criterion is evaluated independently; the overall assertion fails when any
single criterion fails.
Source: adapted ... | 262 | 9,505 |
deepagents | libs/evals/tests/evals/test_goal_tools.py | .py | """Behavioral evals for the static goal-tool prompt and state notices."""
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from deepagents_code.goal_state_notice import build_goal_state_notice
from deepagents_code.goal_tools import GOAL_TOOL_NAMES, GoalToolsMiddleware
from langchain.... | 253 | 7,508 |
deepagents | libs/evals/tests/evals/test_tool_usage_relational.py | .py | """Eval tests for relational data tool usage.
Recreates the relational data environment from langchain-benchmarks: fake
users, locations, and foods connected by IDs. The agent receives *only* the
lookup / search tools (no filesystem) and must chain them to answer questions.
"""
from __future__ import annotations
fr... | 1,207 | 40,301 |
deepagents | libs/evals/tests/evals/test_external_benchmarks.py | .py | """Eval tests drawn from curated external benchmarks.
Runs a focused hard-set of 15 cases across three public benchmarks:
- FRAMES: multi-hop retrieval with arithmetic/temporal reasoning
- Nexus: deeply nested function composition (depth 4-6)
- BFCL v3: multi-turn stateful tool calling across API domains
Each benchma... | 86 | 2,865 |
deepagents | libs/evals/tests/evals/test_followup_quality.py | .py | """Eval tests for followup question quality.
Tests whether the agent asks relevant, non-redundant followup questions when
given underspecified requests. Uses the LLM-as-judge to evaluate semantic
quality of the questions.
Ported from the agent-builder-graphs followup eval suite and adapted for
deepagents.
"""
from _... | 109 | 4,361 |
deepagents | libs/evals/tests/evals/test_memory.py | .py | """Eval tests for memory recall and persistence.
Tests whether the agent can load context from seeded memory files,
use that context to guide behavior (naming conventions, code style),
handle missing memory files gracefully, and correctly distinguish
durable preferences from transient information.
Written internally ... | 527 | 18,248 |
deepagents | libs/evals/tests/evals/conftest.py | .py | from __future__ import annotations
import os
from datetime import UTC, datetime
from typing import TYPE_CHECKING, Any, Literal
import pytest
from langchain.chat_models import init_chat_model
if TYPE_CHECKING:
from langchain_core.language_models import BaseChatModel
from deepagents import __version__ as deepagen... | 280 | 10,389 |
deepagents | libs/evals/tests/evals/tau2_airline/test_tau2_airline.py | .py | """Parametrized pytest tests for 15 tau2 airline tasks.
Each test creates a fresh airline environment, runs a multi-turn conversation
between a deepagents agent and an LLM user simulator, then evaluates the
result using tau2's DB state + communicate info scoring.
Based on τ-bench / τ²-bench / τ³-bench by Sierra Resea... | 179 | 5,579 |
deepagents | libs/evals/tests/evals/tau2_airline/evaluation.py | .py | """Evaluation logic for tau2 airline tasks.
Reimplements the core tau2 evaluation strategy:
- **DB check**: replay expected actions on a fresh database, compare final
state against the actual database after the conversation.
- **Communicate check**: verify that expected information substrings appear
in agent messa... | 369 | 11,962 |
deepagents | libs/evals/tests/evals/tau2_airline/runner.py | .py | """Multi-turn conversation orchestrator for tau2 airline evaluations.
Drives a back-and-forth conversation between a deepagents agent and an
LLM-powered user simulator, collecting the full transcript and tool call
log for later evaluation.
Based on τ-bench / τ²-bench / τ³-bench by Sierra Research (MIT License).
See L... | 118 | 3,523 |
deepagents | libs/evals/tests/evals/tau2_airline/domain.py | .py | """Airline domain models and LangChain tool wrappers for tau2 benchmark evaluation.
Reimplements the essential tau2 airline domain (data models, database, tools) as
self-contained code so the evals run without a cross-repo dependency.
Based on τ-bench / τ²-bench / τ³-bench by Sierra Research (MIT License).
See LICENS... | 891 | 32,886 |
deepagents | libs/evals/tests/evals/tau2_airline/user_sim.py | .py | """LLM-powered user simulator for multi-turn airline customer service evaluation.
Uses a cheap model to play the customer role based on a tau2 task scenario.
The simulator follows tau2's simulation guidelines: disclose information
progressively, stay in character, and emit stop tokens when the task is done.
Based on ... | 131 | 5,039 |
deepagents | libs/evals/tests/evals/memory_agent_bench/test_memory_agent_bench.py | .py | """MemoryAgentBench evaluation tests for deepagents.
Runs the MemoryAgentBench benchmark (ICLR 2026) using the deepagents runner.
Data is loaded from the `ai-hyz/MemoryAgentBench` HuggingFace dataset.
Each test feeds context chunks to the agent, then poses questions and evaluates
responses against ground-truth answers... | 460 | 16,205 |
deepagents | libs/evals/tests/evals/memory_agent_bench/eval_utils.py | .py | """Evaluation utilities for MemoryAgentBench integration.
Adapted from https://github.com/HUST-AI-HYZ/MemoryAgentBench
(ICLR 2026: Evaluating Memory in LLM Agents via Incremental Multi-Turn Interactions)
Only the subset needed for Conflict Resolution and Test-Time Learning splits is
included here.
"""
from __future_... | 67 | 1,926 |
deepagents | libs/evals/tests/evals/memory_agent_bench/configs.py | .py | """Dataset configurations for MemoryAgentBench.
Each config mirrors one of the YAML files from the original benchmark at
https://github.com/HUST-AI-HYZ/MemoryAgentBench/tree/main/configs/data_conf
Only the fields used by our adapter are included.
"""
from __future__ import annotations
from dataclasses import datacl... | 253 | 6,438 |
deepagents | libs/evals/tests/evals/memory_agent_bench/data_utils.py | .py | """Data loading utilities for MemoryAgentBench integration.
Loads data from the `ai-hyz/MemoryAgentBench` HuggingFace dataset and
prepares it for consumption by the deepagents eval runner.
Adapted from https://github.com/HUST-AI-HYZ/MemoryAgentBench
"""
from __future__ import annotations
import logging
from datacla... | 201 | 6,233 |
deepagents | libs/evals/tests/evals/data/bfcl_apis/travel_booking.py | .py | import random
from copy import deepcopy
from datetime import datetime
from typing import Dict, List, Optional, Tuple, Union
from .long_context import (
BOOKING_RECORD_EXTENSION,
CREDIT_CARD_EXTENSION,
)
DEFAULT_STATE = {
"random_seed": 141053,
"credit_card_list": {},
"booking_record": {},
"acc... | 924 | 36,592 |
deepagents | libs/evals/tests/evals/data/bfcl_apis/long_context.py | .py | # Stub for BFCL long_context constants.
# We set long_context=False for all cases, so these are never accessed.
# Vendoring the real file would add ~92K tokens of constant data.
CAR_STATUS_METADATA_EXTENSION = ""
INTERMEDIARY_CITIES: list[str] = []
LONG_WEATHER_EXTENSION: dict = {}
PARKING_BRAKE_INSTRUCTION = ""
AUTOM... | 18 | 611 |
deepagents | libs/evals/tests/evals/data/bfcl_apis/message_api.py | .py | import random
from copy import deepcopy
from typing import Dict, List, Optional, Union
DEFAULT_STATE = {
"generated_ids": set(),
"user_count": 4,
"user_map": {
"Alice": "USR001",
"Bob": "USR002",
"Catherine": "USR003",
"Daniel": "USR004",
},
"inbox": [
{
... | 321 | 12,534 |
deepagents | libs/evals/tests/evals/data/bfcl_apis/trading_bot.py | .py | import random
from copy import deepcopy
from datetime import datetime, time, timedelta
from typing import Dict, List, Optional, Union
from .long_context import (
AUTOMOBILE_EXTENSION,
MA_5_EXTENSION,
MA_20_EXTENSION,
ORDER_DETAIL_EXTENSION,
TECHNOLOGY_EXTENSION,
TRANSACTION_HISTORY_EXTENSION,
... | 684 | 23,740 |
deepagents | libs/evals/tests/evals/data/bfcl_apis/vehicle_control.py | .py | import random
from copy import deepcopy
from typing import Dict, List, Union
from .long_context import (
CAR_STATUS_METADATA_EXTENSION,
INTERMEDIARY_CITIES,
LONG_WEATHER_EXTENSION,
PARKING_BRAKE_INSTRUCTION,
)
MAX_FUEL_LEVEL = 50
MIN_FUEL_LEVEL = 0.0
MILE_PER_GALLON = 20.0
MAX_BATTERY_VOLTAGE = 14.0
M... | 704 | 29,504 |
deepagents | libs/evals/tests/evals/data/bfcl_apis/ticket_api.py | .py | from copy import deepcopy
from typing import Dict, List, Optional, Union
DEFAULT_STATE = {
"ticket_queue": [],
"ticket_counter": 1,
"current_user": None,
}
class TicketAPI:
"""
A class representing the Ticket API for managing support tickets.
This class provides methods for creating, retriev... | 266 | 9,677 |
deepagents | libs/evals/scripts/harbor_langsmith.py | .py | #!/usr/bin/env python3
"""CLI for LangSmith integration with Harbor.
Thin CLI wrapper around `deepagents_harbor.langsmith`. All business logic
lives in that module; this script only handles argument parsing.
"""
import argparse
import asyncio
import json
import sys
from pathlib import Path
from dotenv import load_do... | 196 | 6,484 |
deepagents | libs/evals/scripts/analyze.py | .py | #!/usr/bin/env python3
"""Analyze job trials from a jobs directory.
Scans through trial directories, extracts trajectory data and success metrics.
"""
import argparse
import asyncio
import json
from dataclasses import dataclass
from enum import Enum
from functools import lru_cache
from pathlib import Path
from typing... | 890 | 33,849 |
deepagents | libs/evals/scripts/generate_radar.py | .py | """Generate radar charts from eval results.
Usage:
# Toy data (experimentation)
python scripts/generate_radar.py --toy -o charts/radar.png
# From evals_summary.json (CI / post-run)
python scripts/generate_radar.py --summary evals_summary.json -o charts/radar.png
# From per-category JSON (alternat... | 271 | 9,725 |
deepagents | libs/evals/scripts/generate_eval_catalog.py | .py | """Generate `EVAL_CATALOG.md` from eval test files and `categories.json`.
Usage:
python scripts/generate_eval_catalog.py # writes EVAL_CATALOG.md
python scripts/generate_eval_catalog.py --check # exits 1 if file is stale
"""
from __future__ import annotations
import argparse
import ast
import dif... | 192 | 6,428 |
deepagents | libs/evals/scripts/run_trials.py | .py | """Run the eval suite N times for the same model/config and aggregate stats.
Each trial invokes `pytest tests/evals` with the same flags as `make evals`,
writes its own per-trial report to `--out-dir`, and creates its own LangSmith
experiment. After all trials complete, per-metric mean / median / stdev / min /
max are... | 640 | 22,574 |
deepagents | libs/evals/scripts/composite_radar.py | .py | r"""Generate a composite radar chart by overlaying multiple GitHub Actions eval runs.
Each `📊 Evals` run uploads an `evals-summary` artifact whose payload is a
JSON array of model results. To compare results across separate dispatches
(e.g. a bake-off where each model was run as its own workflow dispatch), this
scrip... | 225 | 7,527 |
deepagents | libs/evals/scripts/generate_model_groups.py | .py | """Generate MODEL_GROUPS.md from the canonical model registry.
Usage:
python scripts/generate_model_groups.py # writes MODEL_GROUPS.md
python scripts/generate_model_groups.py --check # exits 1 if file is stale
"""
from __future__ import annotations
import argparse
import importlib.util
from pathli... | 131 | 4,614 |
deepagents | libs/evals/deepagents_evals/radar.py | .py | """Radar chart generation for eval results.
Produces per-model radar (spider) charts where each axis represents an
eval category (e.g. file_operations, memory, tool_use) and the radial position
encodes the score (0-1 correctness).
"""
from __future__ import annotations
import importlib
import importlib.util
import j... | 541 | 16,170 |
deepagents | libs/evals/deepagents_evals/tau3_subset.py | .py | """Curated tau3-bench subset for probing deep-agent conversation behavior.
30 tasks (drawn from telecom + banking_knowledge) stratified by difficulty for a
behavior spread, not leaderboard parity. Tiers are the **measured** pass rate of
`anthropic:claude-opus-4-8` over 3 rollouts per task at full agent timeout
(langsm... | 218 | 8,780 |
deepagents | libs/evals/deepagents_evals/trial_summary.py | .py | """Helpers for rendering trial summary tables in the GHA step summary."""
from __future__ import annotations
def _esc(value: object) -> str:
"""Escape characters that would break a markdown table row.
Pipes terminate cells, backslashes need to be doubled before pipe
escapes survive a second pass, and ne... | 66 | 2,368 |
deepagents | libs/evals/deepagents_evals/cli.py | .py | """Unified, agent-friendly CLI for the Deep Agents evaluation suite.
Wraps the scattered `Makefile` targets and `scripts/*.py` entry points behind
a single `deepagents-evals` console script with discoverable subcommands and
machine-readable output.
Subcommands:
run Run the eval suite once (single trial... | 726 | 27,466 |
deepagents | libs/partners/quickjs/tests/_common.py | .py | """Shared test helpers for QuickJS test suites."""
from __future__ import annotations
from collections.abc import (
Iterator, # noqa: TC003 — pydantic resolves field annotations at runtime
Sequence, # noqa: TC003 — pydantic resolves field annotations at runtime
)
from typing import Any
from langchain_core.... | 30 | 977 |
deepagents | libs/partners/quickjs/tests/unit_tests/test_end_to_end.py | .py | """End-to-end tests for `CodeInterpreterMiddleware` with a fake LLM.
Regression gate for the sync tool handler: before the worker-thread
refactor, sync `invoke` ran `ctx.eval`, which cannot dispatch async
host functions (PTC bridges are `is_async=True`). Any eval that
referenced `tools.*` surfaced as:
<error type... | 433 | 14,629 |
deepagents | libs/partners/quickjs/tests/unit_tests/test_snapshot.py | .py | """Unit tests for the QuickJS snapshot patch-chain delta encoding.
Covers the pure encoding helpers in ``langchain_quickjs._snapshot``
(``coerce_record``, ``replay_snapshot_chain``, the snap/patch/clear records)
and the ``CodeInterpreterMiddleware`` policy around them: ``_snapshot_update``
encoding decisions, ``before... | 515 | 20,133 |
deepagents | libs/partners/quickjs/tests/unit_tests/test_thread_affinity.py | .py | """Thread/loop-affinity regression tests for QuickJS PTC async dispatch."""
from __future__ import annotations
import asyncio
from collections.abc import (
Iterator, # noqa: TC003 — pydantic resolves annotations at runtime
)
from typing import TYPE_CHECKING, Any
from deepagents import create_deep_agent
from lan... | 203 | 6,777 |
deepagents | libs/partners/quickjs/tests/unit_tests/test_ptc.py | .py | """Tests for programmatic tool calling (PTC).
PTC exposes agent tools as `tools.<camelCase>` async functions inside
the REPL so one `eval` can orchestrate many tool invocations.
"""
from __future__ import annotations
import json
from typing import Any, Literal
import pytest
from langchain_core.messages import ToolM... | 898 | 29,589 |
deepagents | libs/partners/quickjs/tests/unit_tests/test_snapshot_persistence.py | .py | """Unit tests for cross-turn REPL snapshot persistence."""
from __future__ import annotations
from typing import Any, Literal
import pytest
from deepagents import create_deep_agent
from langchain_core.messages import AIMessage, HumanMessage, ToolMessage
from langgraph.checkpoint.memory import InMemorySaver
from lan... | 305 | 9,552 |
deepagents | libs/partners/quickjs/tests/unit_tests/test_prompt_modes.py | .py | """Unit tests for mode-specific prompt rendering."""
from typing import Literal
import pytest
from langchain_quickjs._prompt import (
render_eval_tool_code_doc,
render_eval_tool_description,
render_repl_system_prompt,
)
@pytest.mark.parametrize(
("mode", "expected_fragment"),
[
(
... | 95 | 2,850 |
deepagents | libs/partners/quickjs/tests/unit_tests/test_subagent_events.py | .py | """Tests for live subagent lifecycle events emitted on the custom stream.
`call_subagent_task_tool` emits start/complete (or error) events via the
runtime's `stream_writer` so a UI can render a live fan-out panel. These tests
cover event shape, ordering, id propagation, truncation, and that telemetry
failures never br... | 230 | 6,674 |
deepagents | libs/partners/quickjs/tests/unit_tests/test_end_to_end_async.py | .py | """Async end-to-end tests for `CodeInterpreterMiddleware` with a fake LLM.
Covers the same integration surfaces as the prior quickjs e2e suite:
agent wiring, REPL execution, PTC tool calls, runtime propagation,
error surfacing, and concurrent agent runs.
"""
from __future__ import annotations
import asyncio
from col... | 262 | 8,536 |
deepagents | libs/partners/quickjs/tests/unit_tests/test_repl_middleware.py | .py | """Unit tests for CodeInterpreterMiddleware and its backing REPL wrapper."""
from __future__ import annotations
import asyncio
import threading
from typing import TYPE_CHECKING, Any, cast
from unittest.mock import MagicMock, patch
import pytest
from deepagents.backends.state import StateBackend
from deepagents.middl... | 1,438 | 46,404 |
deepagents | libs/partners/quickjs/tests/unit_tests/smoke_tests/test_system_prompt.py | .py | """Snapshot smoke tests for the quickjs system prompt.
These tests render the system prompt that `CodeInterpreterMiddleware` injects
into a `create_deep_agent` agent and compare it against committed snapshots in
`snapshots/`. Their purpose is to catch *drift in the deepagents SDK* that
silently changes the prompt the ... | 234 | 6,968 |
deepagents | libs/partners/quickjs/tests/unit_tests/smoke_tests/conftest.py | .py | from __future__ import annotations
from pathlib import Path
import pytest
def pytest_addoption(parser: pytest.Parser) -> None:
parser.addoption(
"--update-snapshots",
action="store_true",
default=False,
help="Update smoke test snapshots on disk.",
)
@pytest.fixture
def snap... | 27 | 592 |
deepagents | libs/partners/quickjs/tests/benchmarks/_common.py | .py | """Shared helpers for QuickJS CodSpeed benchmark suites."""
from __future__ import annotations
from collections.abc import (
Iterator, # noqa: TC003 # pydantic resolves this annotation at runtime
)
from typing import TYPE_CHECKING, Any
from deepagents import create_deep_agent
from langchain_core.messages impor... | 155 | 4,965 |
deepagents | libs/partners/quickjs/tests/benchmarks/test_quickjs_throughput.py | .py | """Wall-time throughput benchmarks for QuickJS REPL middleware.
Run locally: `make benchmark`
Run with CodSpeed: `uv run --group test pytest ./tests -m benchmark --codspeed`
These tests measure throughput for many single-thread eval iterations where the
workload combines PTC tool calls with `console.log` output.
""... | 116 | 3,765 |
deepagents | libs/partners/quickjs/tests/benchmarks/test_quickjs_memory.py | .py | """Memory benchmarks for QuickJS REPL middleware.
Run locally: `make benchmark`
Run with CodSpeed: `uv run --group test pytest ./tests -m benchmark --codspeed`
These tests exercise memory-targeted workloads for QuickJS eval execution under
different thread counts and tool shapes.
"""
from __future__ import annotat... | 134 | 3,907 |
deepagents | libs/partners/quickjs/tests/integration_tests/test_postgres.py | .py | from __future__ import annotations
import uuid
from collections.abc import (
Iterator, # noqa: TC003 — pydantic resolves annotations at runtime
)
from typing import Any
import pytest
from deepagents.middleware.subagents import SubAgentMiddleware
from langchain.agents import create_agent
from langchain_core.langu... | 157 | 5,420 |
deepagents | libs/partners/quickjs/tests/integration_tests/test_rlm.py | .py | """Integration tests for PTC against real deepagents middlewares.
Uses a real model and a real `SubAgentMiddleware`-provided
`task` tool. The assertion is coarse — "the subagent actually ran" —
because the model's phrasing is not deterministic, but the wiring
between PTC, `task`, and a spawned subagent graph is covere... | 178 | 6,223 |
deepagents | libs/partners/quickjs/langchain_quickjs/middleware.py | .py | """`CodeInterpreterMiddleware`: exposes a sandboxed JavaScript REPL tool."""
import asyncio
import contextlib
import logging
import uuid
from collections.abc import Awaitable, Callable
from typing import TYPE_CHECKING, Annotated, Any, Literal, NotRequired
from deepagents.middleware._utils import append_to_system_mess... | 576 | 22,526 |
deepagents | libs/partners/quickjs/langchain_quickjs/_snapshot.py | .py | """Patch-chain delta encoding for the QuickJS REPL heap snapshot.
The QuickJS snapshot is a full serialization of the REPL heap, rewritten in its
entirety on every turn. Persisting it through a plain ``LastValue`` channel
copies the whole payload (~1.4 MB in practice) into every checkpoint, so
checkpoint storage grows... | 126 | 4,896 |
deepagents | libs/partners/quickjs/langchain_quickjs/_repl.py | .py | """Thread-keyed QuickJS REPL registry, console bridge, and result formatter.
Kept separate from `middleware.py` so the REPL mechanics stay testable
without constructing an agent or wiring up LangGraph state.
"""
from __future__ import annotations
import asyncio
import contextlib
import hashlib
import json
import log... | 1,063 | 41,248 |
deepagents | libs/partners/quickjs/langchain_quickjs/_ptc.py | .py | """Programmatic tool calling (PTC) support for `CodeInterpreterMiddleware`.
PTC exposes the agent's LangChain tools inside the JavaScript REPL as
`tools.<camelCaseName>(input)` async functions. Instead of issuing
N serial tool calls, the model writes one `eval` that loops / parallelises
/ chains tools in-code:
co... | 153 | 5,361 |
deepagents | libs/partners/quickjs/langchain_quickjs/__init__.py | .py | """langchain-quickjs: persistent JS REPL middleware for agents."""
from langchain_quickjs._ptc import PTCOption
from langchain_quickjs._subagent import (
SUBAGENT_STREAM_EVENT_TYPE,
SubagentCompleteEvent,
SubagentErrorEvent,
SubagentStartEvent,
SubagentStreamEvent,
)
from langchain_quickjs.middlewa... | 22 | 563 |
deepagents | libs/partners/quickjs/langchain_quickjs/_prompt.py | .py | """Prompt/rendering helpers for REPL and PTC system prompts."""
from __future__ import annotations
import contextlib
import inspect
import json
import re
from typing import TYPE_CHECKING, Any, Literal, get_type_hints
from pydantic import TypeAdapter
if TYPE_CHECKING:
from collections.abc import Sequence
fr... | 544 | 22,479 |
deepagents | libs/partners/quickjs/langchain_quickjs/_subagent.py | .py | """QuickJS adapter for the Deep Agents `task` subagent tool."""
from __future__ import annotations
import json
import logging
import time
import uuid
from dataclasses import replace
from typing import TYPE_CHECKING, Any, Final, Literal, NotRequired, TypedDict
from langchain.agents.structured_output import AutoStrate... | 357 | 12,322 |
deepagents | libs/partners/quickjs/langchain_quickjs/_format.py | .py | """Formatting and output-coercion helpers for the QuickJS REPL."""
from __future__ import annotations
import json
from typing import TYPE_CHECKING, Any
from langchain_core.messages import ToolMessage
from langgraph.types import Command
from pydantic import BaseModel
from quickjs_rs import UNDEFINED
if TYPE_CHECKING... | 227 | 8,278 |
deepagents | libs/partners/runloop/tests/test_import.py | .py | import langchain_runloop
def test_import_runloop() -> None:
assert langchain_runloop is not None
| 6 | 103 |
deepagents | libs/partners/runloop/tests/unit_tests/test_provider.py | .py | """Unit tests for RunloopProvider blueprint bootstrapping."""
from __future__ import annotations
from unittest.mock import MagicMock, patch
import httpx
import pytest
from langchain_runloop.provider import (
RunloopProvider,
_default_resolve_env,
_ensure_blueprint,
)
def _make_provider(*, env: dict[st... | 394 | 15,388 |
deepagents | libs/partners/runloop/tests/unit_tests/test_import.py | .py | from __future__ import annotations
import langchain_runloop
from langchain_runloop import RunloopProvider, RunloopSandbox
def test_public_exports() -> None:
"""Stable public surface for downstream imports."""
assert set(langchain_runloop.__all__) == {"RunloopProvider", "RunloopSandbox"}
assert RunloopPro... | 12 | 425 |
deepagents | libs/partners/runloop/tests/integration_tests/test_integration.py | .py | from __future__ import annotations
import os
from typing import TYPE_CHECKING
import pytest
from langchain_tests.integration_tests import SandboxIntegrationTests
if TYPE_CHECKING:
from collections.abc import Iterator
from deepagents.backends.protocol import SandboxBackendProtocol
from langchain_runloop imp... | 43 | 1,204 |
deepagents | libs/partners/runloop/langchain_runloop/provider.py | .py | """Runloop devbox lifecycle (create, attach, delete)."""
from __future__ import annotations
import logging
import os
from typing import TYPE_CHECKING, Any
from runloop_api_client import (
APIConnectionError,
APITimeoutError,
AuthenticationError,
NotFoundError,
PermissionDeniedError,
)
from runloo... | 247 | 9,202 |
deepagents | libs/partners/runloop/langchain_runloop/_version.py | .py | """Version information for `langchain-runloop`."""
# Keep the `x-release-please-version` annotation — release-please uses it to
# bump `__version__` in sync with `pyproject.toml` on every release PR.
__version__ = "0.0.7" # x-release-please-version
| 6 | 253 |
deepagents | libs/partners/runloop/langchain_runloop/__init__.py | .py | """Runloop sandbox integration for Deep Agents."""
from langchain_runloop.provider import RunloopProvider
from langchain_runloop.sandbox import RunloopSandbox
__all__ = ["RunloopProvider", "RunloopSandbox"]
| 7 | 209 |
deepagents | libs/partners/runloop/langchain_runloop/sandbox.py | .py | """Runloop sandbox implementation."""
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from runloop_api_client.sdk import Devbox
from deepagents.backends.protocol import (
ExecuteResponse,
FileDownloadResponse,
FileUploadResponse,
)
from deepagents.backends.sandb... | 79 | 2,577 |
deepagents | libs/partners/vercel/tests/unit_tests/test_sandbox.py | .py | from __future__ import annotations
import logging
import threading
from typing import TYPE_CHECKING, cast
from unittest.mock import MagicMock, patch
import pytest
from langchain_vercel_sandbox import VercelSandbox
from langchain_vercel_sandbox.sandbox import MAX_OUTPUT_BYTES
if TYPE_CHECKING:
from vercel.sandbo... | 447 | 13,963 |
deepagents | libs/partners/vercel/tests/unit_tests/test_import.py | .py | from __future__ import annotations
from deepagents.backends.sandbox import BaseSandbox
import langchain_vercel_sandbox
from langchain_vercel_sandbox import VercelSandbox
def test_import_vercel_sandbox() -> None:
assert langchain_vercel_sandbox is not None
assert issubclass(VercelSandbox, BaseSandbox)
| 12 | 314 |
deepagents | libs/partners/vercel/tests/integration_tests/test_integration.py | .py | from __future__ import annotations
from datetime import timedelta
from typing import TYPE_CHECKING
import pytest
from langchain_tests.integration_tests import SandboxIntegrationTests
from langchain_vercel_sandbox import VercelSandbox
vercel_sandbox = pytest.importorskip("vercel.sandbox")
if TYPE_CHECKING:
from... | 31 | 844 |
deepagents | libs/partners/vercel/langchain_vercel_sandbox/_version.py | .py | """Version information for `langchain-vercel-sandbox`."""
# Keep the `x-release-please-version` annotation — release-please uses it to
# bump `__version__` in sync with `pyproject.toml` on every release PR.
__version__ = "0.0.2" # x-release-please-version
| 6 | 260 |
deepagents | libs/partners/vercel/langchain_vercel_sandbox/__init__.py | .py | """Vercel Sandbox integration for Deep Agents."""
from langchain_vercel_sandbox.sandbox import (
VercelSandbox,
)
__all__ = ["VercelSandbox"]
| 8 | 148 |
deepagents | libs/partners/vercel/langchain_vercel_sandbox/sandbox.py | .py | """Vercel Sandbox backend implementation."""
from __future__ import annotations
import logging
import queue
import threading
import time
from typing import TYPE_CHECKING
from deepagents.backends.protocol import (
FILE_NOT_FOUND,
INVALID_PATH,
IS_DIRECTORY,
PERMISSION_DENIED,
ExecuteResponse,
... | 272 | 10,122 |
deepagents | libs/partners/modal/langchain_modal/_version.py | .py | """Version information for `langchain-modal`."""
# Keep the `x-release-please-version` annotation — release-please uses it to
# bump `__version__` in sync with `pyproject.toml` on every release PR.
__version__ = "0.0.6" # x-release-please-version
| 6 | 251 |
deepagents | libs/partners/modal/langchain_modal/__init__.py | .py | """Modal sandbox integration for Deep Agents."""
from langchain_modal.sandbox import ModalSandbox
__all__ = ["ModalSandbox"]
| 6 | 127 |
deepagents | libs/partners/modal/langchain_modal/sandbox.py | .py | """Modal sandbox implementation."""
from __future__ import annotations
import contextlib
import modal
from deepagents.backends.protocol import (
ExecuteResponse,
FileDownloadResponse,
FileUploadResponse,
)
from deepagents.backends.sandbox import BaseSandbox
class ModalSandbox(BaseSandbox):
"""Modal... | 114 | 3,922 |
deepagents | libs/partners/modal/tests/test_import.py | .py | import langchain_modal
def test_import_modal() -> None:
assert langchain_modal is not None
| 6 | 97 |
deepagents | libs/partners/modal/tests/unit_tests/test_import.py | .py | from __future__ import annotations
import langchain_modal
def test_import_modal() -> None:
assert langchain_modal is not None
| 8 | 133 |
deepagents | libs/partners/modal/tests/integration_tests/test_integration.py | .py | from __future__ import annotations
import os
from typing import TYPE_CHECKING
import modal
import pytest
from langchain_tests.integration_tests import SandboxIntegrationTests
if TYPE_CHECKING:
from collections.abc import Iterator
from deepagents.backends.protocol import SandboxBackendProtocol
from langchai... | 45 | 1,243 |
deepagents | libs/partners/daytona/tests/test_import.py | .py | from __future__ import annotations
import langchain_daytona
def test_import_daytona() -> None:
assert langchain_daytona is not None
| 8 | 139 |
deepagents | libs/partners/daytona/tests/unit_tests/test_import.py | .py | from __future__ import annotations
from types import SimpleNamespace
from typing import TYPE_CHECKING
from unittest.mock import MagicMock, patch
import langchain_daytona
from langchain_daytona.sandbox import DaytonaSandbox
if TYPE_CHECKING:
from collections.abc import Callable
ADAPTIVE_POLLING_FAST_THRESHOLD = ... | 127 | 4,185 |
deepagents | libs/partners/daytona/tests/integration_tests/test_integration.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING
import daytona
import pytest
from langchain_tests.integration_tests import SandboxIntegrationTests
from langchain_daytona import DaytonaSandbox
if TYPE_CHECKING:
from collections.abc import Iterator
from deepagents.backends.protocol import... | 27 | 697 |
deepagents | libs/partners/daytona/langchain_daytona/_version.py | .py | """Version information for `langchain-daytona`."""
# Keep the `x-release-please-version` annotation — release-please uses it to
# bump `__version__` in sync with `pyproject.toml` on every release PR.
__version__ = "0.0.8" # x-release-please-version
| 6 | 253 |
deepagents | libs/partners/daytona/langchain_daytona/__init__.py | .py | """Daytona sandbox integration for Deep Agents."""
from langchain_daytona.sandbox import (
DaytonaSandbox,
)
__all__ = ["DaytonaSandbox"]
| 8 | 144 |
deepagents | libs/partners/daytona/langchain_daytona/sandbox.py | .py | """Daytona sandbox backend implementation."""
from __future__ import annotations
import time
from collections.abc import Callable
from typing import cast
from uuid import uuid4
import daytona
from daytona import FileDownloadRequest, FileUpload, SessionExecuteRequest
from deepagents.backends.protocol import (
Exe... | 202 | 7,267 |
heretic | tests/test_config.py | .py | # SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (C) 2025-2026 Philipp Emanuel Weidmann <pew@worldwidemann.com> + contributors
import unittest
from pydantic import ValidationError
from heretic.config import ScorerConfig
class ScorerConfigTests(unittest.TestCase):
def test_accepts_slug_like_instance_na... | 52 | 1,805 |
heretic | tests/run_tests.py | .py | # SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (C) 2025-2026 Philipp Emanuel Weidmann <pew@worldwidemann.com> + contributors
import hashlib
import subprocess
import sys
from pathlib import Path
# TODO: Replace this with hashlib.file_digest when we drop support for Python 3.10.
def get_file_sha256(file_pat... | 88 | 2,777 |
heretic | src/heretic/evaluator.py | .py | # SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (C) 2025-2026 Philipp Emanuel Weidmann <pew@worldwidemann.com> + contributors
from dataclasses import dataclass
from typing import Any
from optuna.study import StudyDirection
from pydantic import BaseModel
from .config import DatasetSpecification, ScorerConfi... | 268 | 9,595 |
heretic | src/heretic/scorer.py | .py | # SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (C) 2025-2026 Philipp Emanuel Weidmann <pew@worldwidemann.com> + contributors
from abc import ABC, abstractmethod
from dataclasses import dataclass
from pydantic import BaseModel
from heretic.plugin import Context, Plugin
from .config import Settings as Here... | 69 | 1,914 |
heretic | src/heretic/progress.py | .py | # SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (C) 2025-2026 Philipp Emanuel Weidmann <pew@worldwidemann.com> + contributors
from typing import Any
import tqdm
import tqdm.auto
from rich.progress import Progress
# A class that provides the same interface as tqdm,
# but displays progress bars using Rich.
... | 41 | 1,314 |
heretic | src/heretic/main.py | .py | # SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (C) 2025-2026 Philipp Emanuel Weidmann <pew@worldwidemann.com> + contributors
# ruff: noqa: E402
import sys
# Ensure standard output/error use UTF-8 instead of system default charmap (e.g. cp1252 on Windows).
for stream in (sys.stdout, sys.stderr):
if (
... | 1,475 | 63,785 |
heretic | src/heretic/utils.py | .py | # SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (C) 2025-2026 Philipp Emanuel Weidmann <pew@worldwidemann.com> + contributors
import hashlib
import json
import os
import platform
import tempfile
import traceback
from dataclasses import dataclass
from datetime import datetime, timezone
from importlib.metadata... | 741 | 25,157 |
heretic | src/heretic/analyzer.py | .py | # SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (C) 2025-2026 Philipp Emanuel Weidmann <pew@worldwidemann.com> + contributors
from pathlib import Path
import numpy as np
import torch
import torch.linalg as LA
import torch.nn.functional as F
from numpy.typing import NDArray
from rich.progress import track
fr... | 358 | 13,376 |
heretic | src/heretic/model.py | .py | # SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (C) 2025-2026 Philipp Emanuel Weidmann <pew@worldwidemann.com> + contributors
import math
from contextlib import suppress
from dataclasses import dataclass
from typing import Any, Type, cast
import bitsandbytes as bnb
import torch
import torch.linalg as LA
imp... | 868 | 36,059 |
heretic | src/heretic/system.py | .py | # SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (C) 2025-2026 Philipp Emanuel Weidmann <pew@worldwidemann.com> + contributors
import gc
import importlib.metadata
import json
import os
import platform
import re
import subprocess
import sys
from dataclasses import dataclass
from typing import Any
import cpuin... | 479 | 15,916 |
heretic | src/heretic/reproduce.py | .py | # SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (C) 2025-2026 Philipp Emanuel Weidmann <pew@worldwidemann.com> + contributors
import json
import platform
import random
import shutil
from dataclasses import asdict
from enum import IntEnum
from pathlib import Path
from typing import Any, cast
from urllib.reque... | 392 | 12,041 |
heretic | src/heretic/config.py | .py | # SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (C) 2025-2026 Philipp Emanuel Weidmann <pew@worldwidemann.com> + contributors
from enum import Enum
from typing import Dict, Literal
from pydantic import (
BaseModel,
Field,
NonNegativeInt,
PositiveInt,
field_validator,
)
from pydantic_sett... | 591 | 20,591 |
heretic | src/heretic/plugin.py | .py | # SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (C) 2025-2026 Philipp Emanuel Weidmann <pew@worldwidemann.com> + contributors
import importlib
import importlib.util
import inspect
import sys
import types
from pathlib import Path
from types import ModuleType
from typing import Annotated, Any, TypeVar, Union, ... | 306 | 11,003 |
heretic | src/heretic/scorers/kl_divergence.py | .py | # SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (C) 2025-2026 Philipp Emanuel Weidmann <pew@worldwidemann.com> + contributors
import torch.nn.functional as F
from pydantic import BaseModel, Field
from heretic.config import DatasetSpecification
from heretic.plugin import Context
from heretic.scorer import Sc... | 76 | 2,229 |
heretic | src/heretic/scorers/keyword_rate.py | .py | # SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (C) 2025-2026 Philipp Emanuel Weidmann <pew@worldwidemann.com> + contributors
from pydantic import BaseModel, Field
from heretic.config import DatasetSpecification
from heretic.scorer import Context, Score, Scorer
from heretic.utils import print
DEFAULT_KEYWO... | 139 | 3,945 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.