Skip to content

Commit

Permalink
Make Join Analysis inaccessible by LLM (#677)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuang11 authored Aug 21, 2024
1 parent e731e33 commit c50ead0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lumen/ai/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion lumen/ai/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c50ead0

Please sign in to comment.