tools.cross_channel_query module
Cross-channel query tool – privately ask the LLM about another channel.
Fetches recent messages from a target channel’s Redis cache, builds a one-shot LLM sub-call with that transcript as context, and returns the response. Nothing is posted to the target channel.
- async tools.cross_channel_query.run(channel_id='', question='', message_count=100, *, ctx=None)[source]
Public tool entry point that delegates to
_query_channel().Thin wrapper exposing the cross-channel query under the loader’s expected
runsignature: it forwards every argument straight to the private_query_channel()implementation, which does the real work (fetching the target channel’s transcript from the Redis message cache or platform API, optionally folding in the cached summary, and running a tool-less one-shot LLM sub-call). All side effects live in that callee.Called by the tool dispatcher:
tool_loader.pyresolves this module’srunviagetattr(module, "run")and registers it underTOOL_NAME(“query_channel”); no direct in-repo callers were found.- Parameters:
channel_id (
str) – Target channel/room ID to read from.question (
str) – The question to answer about that channel’s activity.message_count (
int) – Number of recent messages to include as context (default 100, capped at 500 inside the callee).ctx (
ToolContext|None) – Injected tool context (Redis, adapter, config, message cache).
- Returns:
The JSON result string produced by
_query_channel().- Return type: