Skip to content

Agents lats

LATSPack #

Bases: BaseLlamaPack

Pack for running the LATS agent.

Source code in llama_index/packs/agents_lats/base.py
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
class LATSPack(BaseLlamaPack):
    """Pack for running the LATS agent."""

    def __init__(
        self, tools: List[BaseTool], llm: Optional[LLM] = None, **kwargs: Any
    ) -> None:
        """初始化参数。"""
        self.agent_worker = LATSAgentWorker(tools=tools, llm=llm, **kwargs)
        self.agent = AgentRunner(self.agent_worker)

    def get_modules(self) -> Dict[str, Any]:
        """获取模块。"""
        return {
            "agent_worker": self.agent_worker,
            "agent": self.agent,
        }

    def run(self, *args: Any, **kwargs: Any) -> Any:
        """运行。"""
        return self.agent.chat(*args, **kwargs)

get_modules #

get_modules() -> Dict[str, Any]

获取模块。

Source code in llama_index/packs/agents_lats/base.py
21
22
23
24
25
26
def get_modules(self) -> Dict[str, Any]:
    """获取模块。"""
    return {
        "agent_worker": self.agent_worker,
        "agent": self.agent,
    }

run #

run(*args: Any, **kwargs: Any) -> Any

运行。

Source code in llama_index/packs/agents_lats/base.py
28
29
30
def run(self, *args: Any, **kwargs: Any) -> Any:
    """运行。"""
    return self.agent.chat(*args, **kwargs)