Skip to content

Commit ae3622a

Browse files
author
Douglas Reid
committed
add more logging
1 parent 6d74753 commit ae3622a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/steamship/agents/service/agent_service.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,24 @@ def run_action(self, action: Action, context: AgentContext):
2929
"Please use synchronous Tasks (Tools that return List[Block] for now."
3030
)
3131
else:
32+
outputs = ",".join([f"{b.as_llm_input()}" for b in action.output])
33+
logging.info(
34+
f"Tool {action.tool.name} Completed ({outputs})",
35+
extra={
36+
AgentLogging.TOOL_NAME: action.tool.name,
37+
AgentLogging.IS_MESSAGE: True,
38+
AgentLogging.MESSAGE_TYPE: AgentLogging.ACTION,
39+
AgentLogging.MESSAGE_AUTHOR: AgentLogging.AGENT,
40+
},
41+
)
3242
action.output = blocks_or_task
3343
context.completed_steps.append(action)
3444

3545
def run_agent(self, agent: Agent, context: AgentContext):
3646
action = agent.next_action(context=context)
3747
while not isinstance(action, FinishAction):
3848
# TODO: Arrive at a solid design for the details of this structured log object
39-
inputs = ",".join([f'"{b.as_llm_input()}"' for b in action.input])
49+
inputs = ",".join([f"{b.as_llm_input()}" for b in action.input])
4050
logging.info(
4151
f"Running Tool {action.tool.name} ({inputs})",
4252
extra={

0 commit comments

Comments
 (0)