Skip to content

recorder

dandy.processor.agent.recorder

recorder_add_llm_agent_create_plan_event

Source code in dandy/processor/agent/recorder.py
def recorder_add_llm_agent_create_plan_event(
        prompt: PromptOrStr,
        processors_strategy: ProcessorsStrategy,
        event_id: str,
):
    _recorder_add_llm_agent_event(
        action_description='Create Plan',
        event_id=event_id,
        attributes=[
            EventAttribute(
                key='Goal',
                value=str(prompt),
                is_card=True,
            ),
            EventAttribute(
                key=pascal_to_title_case(processors_strategy.__class__.__qualname__),
                value=json.dumps(
                    processors_strategy.as_dict(),
                    indent=4,
                    default=json_default
                ),
                is_card=True,
            )
        ]
    )

recorder_add_llm_agent_finished_creating_plan_event

Source code in dandy/processor/agent/recorder.py
def recorder_add_llm_agent_finished_creating_plan_event(
        plan_intel: PlanIntel,
        event_id: str,
):
    _recorder_add_llm_agent_event(
        action_description='Finished Creating Plan',
        event_id=event_id,
        attributes=[
            EventAttribute(
                key='Base Plan',
                value=plan_intel.to_prompt().to_str(),
                is_card=True,
            )
        ]
    )

recorder_add_llm_agent_running_plan_event

Source code in dandy/processor/agent/recorder.py
def recorder_add_llm_agent_running_plan_event(
        plan_intel: PlanIntel,
        event_id: str,
):
    _recorder_add_llm_agent_event(
        action_description='Running Plan',
        event_id=event_id,
        attributes=[
            EventAttribute(
                key='Plan',
                value=plan_intel.to_prompt().to_str(),
                is_card=True,
            )
        ]
    )

recorder_add_llm_agent_start_task_event

Source code in dandy/processor/agent/recorder.py
def recorder_add_llm_agent_start_task_event(
        task_intel: TaskIntel,
        processors_strategy: ProcessorsStrategy,
        event_id: str,
):
    _recorder_add_llm_agent_event(
        action_description=f'Starting Task #{task_intel.number}',
        event_id=event_id,
        attributes=[
            EventAttribute(
                key='Resource Processor',
                value=processors_strategy.get_processor_module_and_qualname_from_key(
                    task_intel.processors_key
                )
            ),
            EventAttribute(
                key='Starting State',
                value=task_intel.to_prompt().to_str(),
                is_card=True,
            )
        ]
    )

recorder_add_llm_agent_completed_task_event

Source code in dandy/processor/agent/recorder.py
def recorder_add_llm_agent_completed_task_event(
        task_intel: TaskIntel,
        processors_strategy: ProcessorsStrategy,
        event_id: str,
):
    _recorder_add_llm_agent_event(
        action_description=f'Completed Task #{task_intel.number}',
        event_id=event_id,
        attributes=[
            EventAttribute(
                key='Resource Processor',
                value=processors_strategy.get_processor_module_and_qualname_from_key(
                    task_intel.processors_key
                )
            ),
            EventAttribute(
                key='Completed State',
                value=task_intel.to_prompt().to_str(),
                is_card=True,
            )
        ]
    )

recorder_add_llm_agent_done_executing_plan_event

Source code in dandy/processor/agent/recorder.py
def recorder_add_llm_agent_done_executing_plan_event(
        plan_intel: PlanIntel,
        event_id: str,
):
    _recorder_add_llm_agent_event(
        action_description='Done Executing Plan',
        event_id=event_id,
        attributes=[
            EventAttribute(
                key='Final Plan',
                value=plan_intel.to_prompt().to_str(),
                is_card=True,
            )
        ]
    )

recorder_add_llm_agent_processing_final_result_event

Source code in dandy/processor/agent/recorder.py
def recorder_add_llm_agent_processing_final_result_event(
        plan_intel: PlanIntel,
        event_id: str,
):
    _recorder_add_llm_agent_event(
        action_description='Processing Final Result',
        event_id=event_id,
        attributes=[
            EventAttribute(
                key='Final Results',
                value='\n\n'.join(
                    [task.actual_result for task in plan_intel.tasks]
                ),
                is_card=True,
            )
        ]
    )