chdb agent tools
chdb 从4.2.0 开始支持了agent 玩法,同时提供了一个smolagents 专属的agent 集成
参考玩法
- smolagents
from chdb.agents.smolagents import chdb_smol_tools
from smolagents import CodeAgent, InferenceClientModel
agent = CodeAgent(
tools=chdb_smol_tools(attachments={"events": "data/events.parquet"}),
model=InferenceClientModel(),
)
agent.run("What are the top 5 event types by count?")
- ChDBTool 模式
当然实际是需要集成到agent 中的
tool = ChDBTool(path="./rong")
tool.query("select concatv3('Hello', 'World') as combined_string")
说明
实际上chdb 支持连接配置llm,然后可以通过问答模式进行数据处理,内部处理还是有一些差异的,一个是显示python 级别的,一个是直接内部的
参考资料
https://github.com/chdb-io/chdb/releases
https://github.com/chdb-io/chdb/blob/main/tests/test_agents_chdbtool.py
浙公网安备 33010602011771号