Decision#
- class scikitplot.agent.Decision(kind, action=None, answer=None, rationale='', usage=None)[source]#
What the planner decided: call a tool, or finish with an answer.
- Parameters:
- kind{“act”, “finish”}
Call a tool, or finish with an answer.
- actionAction or None, default=None
The call, for an
actdecision.- answerobject, default=None
The answer, a JSON value, for a
finishdecision.- rationalestr, default=””
Why, in the planner’s words; recorded, never acted on.
- usageUsage or None, default=None
What the decision cost. Required when the run has a token limit.
- Parameters:
Examples
>>> from scikitplot.agent import Decision >>> Decision.act("search", {"query": "spans"}).kind 'act' >>> Decision.finish("42", rationale="found it").kind 'finish'
- classmethod act(tool, arguments=None, *, rationale='', usage=None)[source]#
Decide to call
toolwitharguments.
- classmethod finish(answer, *, rationale='', usage=None)[source]#
Decide to finish with
answer(a JSON value).