
陈泽西/开放PTC-agent是从[[T0]导入的特工技能候选人。
概览
陈泽西/开放PTC-agent是从[[T0]导入的特工技能候选人。
概述(AI 翻译)
英文 |中文
入门指南 |CLI参考 |配置 |更新日志 |路线图
演示:利用DeepSeek V3.2分析两年NVDA、AMD和SPY股票数据(15,000+行原始JSON
什么是程序化工具调用?
该项目是Anthropic最近推出的程序化工具调用(PTC)的开源实现,使代理能够调用代码执行工具,而不必单独调用JSON工具。这一范式也出现在他们早期的工程博客《用MCP执行代码》中。
为什么是PTC?
-
LLM在写代码方面非常出色!他们擅长理解上下文、推理数据流和生成精确逻辑。PTC让他们能够发挥最擅长的优势——编写协调整个工作流程的代码,而不是一次推理一个工具调用。
-
传统工具调用将完整结果返回到模型的上下文窗口。假设获取10个股票代码的1年每日股票价格。这意味着需要2500+OHLCV数据点污染上下文——仅计算投资组合摘要就需要数万个代币。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Open PTC Agent
Getting Started | CLI Reference | Configuration | Changelog | Roadmap
Demo: Analyzing 2 years of NVDA, AMD & SPY stock data (15,000+ lines of raw JSON) using DeepSeek V3.2
What is Programmatic Tool Calling?
This project is an open source implementation of Anthropic recently introduced Programmatic Tool Calling (PTC), which enables agents to invoke tools with code execution rather than making individual JSON tool calls. This paradigm is also featured in their earlier engineering blog Code execution with MCP.
Why PTC?
-
LLMs are exceptionally good at writing code! They excel at understanding context, reasoning about data flows, and generating precise logic. PTC lets them do what they do best - write code that orchestrates entire workflows rather than reasoning through one tool call at a time.
-
Traditional tool calling returns full results to the model’s context window. Suppose fetching 1 year of daily stock prices for 10 tickers. This means 2,500+ OHLCV data points polluting context - tens of thousands of tokens just to compute a portfolio summary. With PTC, code runs in a sandbox, processes data locally, and only the final output returns to the model. Result: 85-98% token reduction.
-
PTC particularly shines when working with large volumes of structured data, time series data (like financial market data), and scenarios requiring further data processing - filtering, aggregating, transforming, or visualizing results before returning them to the model.
How It Works
User Task
|
v
+-------------------+
| PTCAgent | Tool discovery -> Writes Python code
+-------------------+
| ^
v |
+-------------------+
| Daytona Sandbox | Executes code
| +-------------+ |
| | MCP Tools | | tool() -> process / filter / aggregate -> dump to data/ directory
| | (Python) | |
| +-------------+ |
+-------------------+
|
v
+-------------------+
|Final deliverables | Files and data can be downloaded from sandbox
+-------------------+
推荐工具
换一个关键词,或者移除筛选条件。
安装
npx skillfish add chen-zexi/open-ptc-agent