Skip to content

Commit 55def0f

Browse files
committed
Adding pythonic tool calling to agents from rigging.
1 parent 3348ca9 commit 55def0f

File tree

4 files changed

+773
-765
lines changed

4 files changed

+773
-765
lines changed

.hooks/generate_docs.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def convert_details(self, el: t.Any, text: str, parent_tags: t.Any) -> t.Any: #
4242
classes = el.get("class", [])
4343

4444
# Handle source code details specially
45-
if "quote" in classes:
45+
if "mkdocstrings-source" in classes or "quote" in classes:
4646
summary = el.find("summary")
4747
if summary:
4848
file_path = summary.get_text().replace("Source code in ", "").strip()
@@ -128,6 +128,10 @@ def generate_docs_for_module(
128128
module_data = self.handler.collect(module_path, options)
129129
html = self.handler.render(module_data, options)
130130

131+
if "Source code in " in html:
132+
with open("debug.html", "w", encoding="utf-8") as f:
133+
f.write(html)
134+
131135
return str(
132136
CustomMarkdownConverter(
133137
code_language="python",

dreadnode/agent/agent.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ def _get_transforms(self) -> list[rg.Transform]:
272272
transforms.append(rg.transform.tools_to_json_with_tag_transform)
273273
case "json":
274274
transforms.append(rg.transform.tools_to_json_transform)
275+
case "pythonic":
276+
transforms.append(rg.transform.tools_to_pythonic_transform)
275277

276278
return transforms
277279

@@ -931,7 +933,7 @@ def model_post_init(self, context: t.Any) -> None:
931933
self.hooks.append(
932934
retry_with_feedback(
933935
event_type=AgentStalled,
934-
feedback="Continue the task if possible, use the 'finish_task' tool to complete it, or 'give_up_on_task' if it cannot be completed.",
936+
feedback="No tool calls were observed. Continue the task if possible, use the 'finish_task' tool to complete it, or 'give_up_on_task' if it cannot be completed.",
935937
)
936938
)
937939

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ dependencies = [
1515
"coolname>=2.2.0,<3.0.0",
1616
"pandas>=2.2.3,<3.0.0",
1717
"fsspec[s3]>=2023.1.0,<=2025.3.0",
18-
"rigging>=3.2.1,<4.0.0",
1918
"optuna>=4.5.0,<5.0.0",
2019
"numpy<=2.2.6", # 3.10 support was dropped in 2.3.0
2120
"universal-pathlib>=0.3.3,<0.4.0",
2221
"loguru>=0.7.3",
2322
"python-jsonpath>=2.0.1",
2423
"pyyaml>=6.0.2",
2524
"cyclopts>=4.2.0",
25+
"rigging>=3.3.4",
2626
]
2727

2828
[project.optional-dependencies]

0 commit comments

Comments
 (0)