Skip to content

Latest commit

 

History

History
19 lines (17 loc) · 552 Bytes

File metadata and controls

19 lines (17 loc) · 552 Bytes

使用方法

from checkpoint_mysql.aio import MySQLSaver

async with MySQLSaver.from_conn_string(conn_string) as saver:
    await saver.setup()  # 创建表
    agent = create_agent(
        state_schema=Test_State,
        system_prompt="你需要调用get_weather_info函数来获取天气信息",
        model=glm_5,
        tools=[get_weather_info],
        checkpointer=saver,
    )

    res = await agent.ainvoke(
        input={"messages":[{"role":"human","content":"成都的天气怎么样?"}]},
        config=config
    )