Skip to content

Commit 9e241d6

Browse files
committed
chore: cleanup
1 parent 1b1605e commit 9e241d6

File tree

3 files changed

+4
-22
lines changed

3 files changed

+4
-22
lines changed

src/llmling_agent/prompts/builtin_provider.py

-4
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,8 @@ class BuiltinPromptProvider(BasePromptProvider):
2222
def __init__(self, manifest_prompts: dict[str, SystemPrompt]):
2323
from jinjarope import Environment
2424

25-
from llmling_agent_functional.run import run_agent, run_agent_sync
26-
2725
self.prompts = manifest_prompts
2826
self.env = Environment(autoescape=False, enable_async=True)
29-
self.env.globals["run_agent"] = run_agent
30-
self.env.globals["run_agent_sync"] = run_agent_sync
3127

3228
async def get_prompt(
3329
self,

src/llmling_agent/tools/manager.py

+2-14
Original file line numberDiff line numberDiff line change
@@ -159,22 +159,10 @@ def _validate_item(self, item: Tool | ToolType | dict[str, Any]) -> Tool:
159159
return Tool.from_callable(item)
160160
case Callable():
161161
return Tool.from_callable(item)
162-
case {"callable": callable_item, **config} if callable(
163-
callable_item
164-
) or isinstance(callable_item, LLMCallableTool):
165-
# First convert callable to LLMCallableTool if needed
166-
tool = (
167-
callable_item
168-
if isinstance(callable_item, LLMCallableTool)
169-
else LLMCallableTool.from_callable(callable_item)
170-
)
171-
172-
# Get valid fields from Tool dataclass (excluding 'callable')
162+
case {"callable": callable_item, **config} if callable(callable_item):
173163
valid_keys = {f.name for f in fields(Tool)} - {"callable"}
174164
tool_config = {k: v for k, v in config.items() if k in valid_keys}
175-
176-
return Tool(callable=tool, **tool_config) # type: ignore
177-
165+
return Tool.from_callable(callable_item, **tool_config) # type: ignore
178166
case _:
179167
typ = type(item)
180168
msg = f"Item must be Tool or callable. Got {typ}"

src/llmling_agent_cli/history.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,8 @@ def reset_history(
187187
if input(msg).lower() != "y":
188188
print("Operation cancelled.")
189189
return
190-
191-
conv_count, msg_count = provider.run_task_sync(
192-
provider.reset(agent_name=agent_name, hard=hard)
193-
)
190+
coro = provider.reset(agent_name=agent_name, hard=hard)
191+
conv_count, msg_count = provider.run_task_sync(coro)
194192

195193
what = f" for {agent_name}" if agent_name else ""
196194
print(f"Deleted {conv_count} conversations and {msg_count} messages{what}.")

0 commit comments

Comments
 (0)