Skip to content

Commit

Permalink
add more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Douglas Reid committed May 24, 2023
1 parent 6d74753 commit ae3622a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/steamship/agents/service/agent_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,24 @@ def run_action(self, action: Action, context: AgentContext):
"Please use synchronous Tasks (Tools that return List[Block] for now."
)
else:
outputs = ",".join([f"{b.as_llm_input()}" for b in action.output])
logging.info(
f"Tool {action.tool.name} Completed ({outputs})",
extra={
AgentLogging.TOOL_NAME: action.tool.name,
AgentLogging.IS_MESSAGE: True,
AgentLogging.MESSAGE_TYPE: AgentLogging.ACTION,
AgentLogging.MESSAGE_AUTHOR: AgentLogging.AGENT,
},
)
action.output = blocks_or_task
context.completed_steps.append(action)

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

0 comments on commit ae3622a

Please sign in to comment.