LoveLogicAI commited on
Commit
012f9fd
·
verified ·
1 Parent(s): 1931f9e

agent.tool audit events in _agent_reply

Browse files
Files changed (1) hide show
  1. freestream/bot.py +6 -2
freestream/bot.py CHANGED
@@ -321,11 +321,15 @@ class BotSession:
321
  self._spec_cancel = None
322
 
323
  def _agent_reply(self, text: str) -> str:
324
- """Agent reply + event-log the character's physical actions (they are
325
- *not* spoken — TTS gets the spoken text only)."""
326
  reply = self.agent.reply(text)
327
  for action in getattr(self.agent, "last_actions", []):
328
  self.log.append("agent.action", text=action[:200])
 
 
 
 
329
  return reply
330
 
331
  async def handle_utterance(self, utt: np.ndarray, speculative: bool = False):
 
321
  self._spec_cancel = None
322
 
323
  def _agent_reply(self, text: str) -> str:
324
+ """Agent reply + event-log the character's physical actions (never
325
+ spoken) and tool calls (always audited — docs/CONSENT.md §6)."""
326
  reply = self.agent.reply(text)
327
  for action in getattr(self.agent, "last_actions", []):
328
  self.log.append("agent.action", text=action[:200])
329
+ for tc in getattr(self.agent, "last_tool_calls", []):
330
+ self.log.append("agent.tool", tool=tc["tool"],
331
+ args=json.dumps(tc["args"])[:200],
332
+ ok=tc["ok"], output=tc["output"][:300])
333
  return reply
334
 
335
  async def handle_utterance(self, utt: np.ndarray, speculative: bool = False):