prebuilt.essay_grading.agentΒΆ

ClassesΒΆ

EssayGradingAgent

Enhanced Agent with engine-focused generics and full backward compatibility.

Module ContentsΒΆ

class prebuilt.essay_grading.agent.EssayGradingAgentΒΆ

Bases: haive.agents.base.Agent

Enhanced Agent with engine-focused generics and full backward compatibility.

Agent = Workflow + Engine. The engine type is the primary generic parameter, enabling type-safe engine-specific functionality while maintaining full backward compatibility.

Generic Parameters:

EngineT: Type of engine (defaults to InvokableEngine for backward compatibility)

Key Benefits:
  • Engine-specific type safety: Agent[AugLLMConfig] vs Agent[ReactEngine]

  • Backward compatible: existing Agent() calls work unchanged

  • Engine-specific methods: BaseRAGAgent[RetrieverEngine] gets retriever methods

  • Flexible composition: Any engine type can be used

Examples

# Backward compatible - works unchanged agent = SimpleAgent(name=”test”)

# Engine-specific typing aug_agent: SimpleAgent[AugLLMConfig] = SimpleAgent(engine=aug_config) rag_agent: BaseRAGAgent[RetrieverEngine] = BaseRAGAgent(engine=retriever_engine)

# Mixed usage - all compatible agents = [agent, aug_agent, rag_agent]

set_workflow()ΒΆ

Set Workflow.