Skip to content

Commit 4ad0704

Browse files
committed
Some Study bug fixes. Expose Message better in imports. Version to 1.17.1.
1 parent 3c676cf commit 4ad0704

8 files changed

Lines changed: 2640 additions & 2611 deletions

File tree

dreadnode/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
if t.TYPE_CHECKING:
3939
from dreadnode import agent, airt, eval, optimization, scorers, transforms # noqa: A004
4040
from dreadnode.agent import Agent, tool, tool_method
41-
from dreadnode.data_types import Audio, Image, Table, Video
41+
from dreadnode.data_types import Audio, Image, Message, Table, Video
4242

4343
logger.disable("dreadnode")
4444

@@ -88,6 +88,7 @@
8888
"EnvVar",
8989
"Image",
9090
"Markdown",
91+
"Message",
9192
"Metric",
9293
"MetricDict",
9394
"Object",
@@ -151,6 +152,7 @@
151152
"Image": "dreadnode.data_types",
152153
"Table": "dreadnode.data_types",
153154
"Video": "dreadnode.data_types",
155+
"Message": "dreadnode.data_types",
154156
"Agent": "dreadnode.agent",
155157
"tool": "dreadnode.agent",
156158
"tool_method": "dreadnode.agent",

dreadnode/cli/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from dreadnode.user_config import ServerConfig, UserConfig
3636

3737
cli = cyclopts.App(
38+
name="dreadnode",
3839
help="Interact with Dreadnode platforms",
3940
version_flags=[],
4041
help_on_error=True,

dreadnode/data_types/__init__.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,30 @@
88
if t.TYPE_CHECKING:
99
from dreadnode.data_types.audio import Audio
1010
from dreadnode.data_types.image import Image
11+
from dreadnode.data_types.message import Message
1112
from dreadnode.data_types.table import Table
1213
from dreadnode.data_types.video import Video
1314

14-
__all__ = ["Audio", "Code", "Image", "Markdown", "Object3D", "Table", "Text", "Video", "WithMeta"]
15+
__all__ = [
16+
"Audio",
17+
"Code",
18+
"Image",
19+
"Markdown",
20+
"Message",
21+
"Object3D",
22+
"Table",
23+
"Text",
24+
"Video",
25+
"WithMeta",
26+
]
1527

1628
__lazy_submodules__: list[str] = []
1729
__lazy_components__: dict[str, str] = {
1830
"Audio": "dreadnode.data_types.audio",
1931
"Image": "dreadnode.data_types.image",
2032
"Table": "dreadnode.data_types.table",
2133
"Video": "dreadnode.data_types.video",
34+
"Message": "dreadnode.data_types.message",
2235
}
2336

2437

dreadnode/logging_.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
To just enable dreadnode logs to flow, call `logger.enable("dreadnode")` after importing the module.
55
"""
66

7-
import os
87
import pathlib
98
import typing as t
109
from textwrap import dedent
@@ -27,10 +26,6 @@
2726
)
2827
)
2928

30-
# In vscode jupyter, disable rich's jupyter detection to avoid issues with styling
31-
if "VSCODE_PID" in os.environ:
32-
console.is_jupyter = False
33-
3429

3530
def configure_logging(
3631
log_level: LogLevel = "info",

dreadnode/optimization/collectors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def get_parent(trial: Trial[CandidateT]) -> Trial[CandidateT] | None:
2626
trials: list[Trial[CandidateT]] = []
2727
parent = get_parent(current_trial)
2828
while parent:
29-
trials.insert(0, parent)
29+
trials.append(parent)
3030
parent = get_parent(parent)
3131

3232
return trials[:depth]

dreadnode/optimization/study.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -379,17 +379,17 @@ async def _run_evaluation(
379379
)
380380
logger.trace(f"Candidate: {trial.candidate!r}")
381381

382-
if dataset == [{}] or (isinstance(dataset, list) and len(dataset) == 1 and not dataset[0]):
383-
# Dataset is empty - this is a Study/Attack where the candidate IS the input
384-
dataset = [{"message": trial.candidate}]
385-
dataset_input_mapping = ["message"]
386-
else:
387-
dataset_input_mapping = None
382+
# if dataset == [{}] or (isinstance(dataset, list) and len(dataset) == 1 and not dataset[0]):
383+
# # Dataset is empty - this is a Study/Attack where the candidate IS the input
384+
# dataset = [{"message": trial.candidate}]
385+
# dataset_input_mapping = ["message"]
386+
# else:
387+
# dataset_input_mapping = None
388388

389389
evaluator = Eval(
390390
task=task,
391391
dataset=dataset,
392-
dataset_input_mapping=dataset_input_mapping,
392+
# dataset_input_mapping=dataset_input_mapping,
393393
scorers=scorers,
394394
hooks=self.hooks,
395395
max_consecutive_errors=self.max_consecutive_errors,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "dreadnode"
3-
version = "1.17.0"
3+
version = "1.17.1"
44
description = "Dreadnode SDK"
55
authors = [{ name = "Nick Landers", email = "monoxgas@gmail.com" }]
66
readme = "README.md"

uv.lock

Lines changed: 2613 additions & 2595 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)