diff --git a/lumen/ai/analysis.py b/lumen/ai/analysis.py index 5593b3cc..45c07c9b 100644 --- a/lumen/ai/analysis.py +++ b/lumen/ai/analysis.py @@ -29,6 +29,8 @@ class Analysis(param.ParameterizedFunction): # Whether to allow the analysis to be called multiple times in a row _consecutive_calls = False + _callable_by_llm = True + _field_params = [] @classmethod @@ -60,6 +62,8 @@ class Join(Analysis): context = param.String(doc="Additional context to provide to the LLM.") + _callable_by_llm = False + _previous_table = param.Parameter() _previous_source = param.Parameter() diff --git a/lumen/ai/assistant.py b/lumen/ai/assistant.py index 4fdfad20..8ede84b3 100644 --- a/lumen/ai/assistant.py +++ b/lumen/ai/assistant.py @@ -344,7 +344,7 @@ async def _choose_agent(self, messages: list | str, agents: list[Agent]): if isinstance(agent, AnalysisAgent): analyses = "\n".join( f"- `{analysis.__name__}`: {(analysis.__doc__ or '').strip()}" - for analysis in agent.analyses + for analysis in agent.analyses if analysis._callable_by_llm ) agent.__doc__ = f"Available analyses include:\n{analyses}\nSelect this agent to perform one of these analyses." break