Skip to content

Commit

Permalink
produce use step outside of the agent
Browse files Browse the repository at this point in the history
  • Loading branch information
ollmer committed Mar 6, 2025
1 parent 8432668 commit dc21026
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "TapeAgents"
version = "0.1.6"
version = "0.1.7"
requires-python = ">= 3.10, <3.13"
description = "TapeAgents framework for building, tuning and evaluating LLM Agents"
authors = [
Expand Down
6 changes: 3 additions & 3 deletions tapeagents/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from tapeagents.agent import TapeType
from tapeagents.core import Action, LLMOutputParsingFailureAction, Observation, Tape
from tapeagents.dialog_tape import AssistantStep, DialogTape
from tapeagents.dialog_tape import AssistantStep, DialogTape, UserStep
from tapeagents.tool_calling import FunctionCall, ToolCalls, ToolResult, ToolSpec
from tapeagents.tools.base import StatefulTool, Tool
from tapeagents.tools.container_executor import CodeBlock, CommandLineCodeResult, ContainerExecutor
Expand Down Expand Up @@ -176,15 +176,15 @@ def tools_description(self) -> list[str]:

def react(self, tape: Tape) -> Tape:
for action in self.last_actions(tape):
if isinstance(action, LLMOutputParsingFailureAction):
continue
observation = self.step(action)
tape = tape.append(observation)
return tape

def step(self, action: Action) -> Observation:
t = time.perf_counter()
action_type = type(action)
if isinstance(action, LLMOutputParsingFailureAction):
return UserStep(content="Try again")
if action_type not in self.action_map:
raise Exception(f"Unknown action: {action_type}")
tool = self.action_map[action_type]
Expand Down
1 change: 0 additions & 1 deletion tapeagents/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ def generate_steps(
yield self.postprocess_step(tape, new_steps[:i], step)
if isinstance(step, LLMOutputParsingFailureAction):
yield SetNextNode(next_node=self.name) # loop to the same node to retry
yield UserStep(content="Try again")
break
if not new_steps:
raise FatalError("No completions!")
Expand Down

0 comments on commit dc21026

Please sign in to comment.