Agent 工具
参考原型,探索基于 TypeSafe/Jev 到 Axiom、Argent、Silverscript 在 Kaspa 上的 agentic 商业模式。
Reference prototype exploring agentic commerce: TypeSafe/Jev → Axiom → Argent → Silverscript on Kaspa.
const DEFAULT_ENDPOINT = "https://api.typesafe.ai/v1/systemone";链接指向我们抓取当天的那个 commit,行号是准的。
下面是从这个项目源码里原样取出来的 question 组合。
action选项Which economic action does the user explicitly intend? Choose BUY, SELL, PAY, or TRANSFER.
BUY — The user intends to purchase an asset.SELL — The user intends to sell an asset.PAY — The user intends to pay or spend funds.TRANSFER — The user intends to transfer assets between accounts or parties.asset选项Which asset is the user referring to? Choose the exact ticker if explicitly identifiable. Choose UNKNOWN if it cannot be determined.
KAS — Kaspa (KAS) is the asset being discussed.BTC — Bitcoin (BTC) is the asset being discussed.USD — United States dollars (USD) are the asset being discussed.UNKNOWN — The asset cannot be determined from the input.condition_operator选项What price condition does the user express? LT means below/under, LTE means at or below, GT means above/over, GTE means at or above, EQ means exactly equal, NONE means no price condition.
LT — The user specifies a price below a threshold.LTE — The user specifies a price at or below a threshold.GT — The user specifies a price above a threshold.GTE — The user specifies a price at or above a threshold.EQ — The user specifies an exact price match.NONE — The user does not specify a price condition.import { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
action: { type: 'choice', instructions: 'Which economic action does the user explicitly intend? Choose BUY, SELL, PAY, or TRANSFER.',
criteria: { BUY: 'The user intends to purchase an asset.', SELL: 'The user intends to sell an asset.', PAY: 'The user intends to pay or spend funds.', TRANSFER: 'The user intends to transfer assets between accounts or parties.' } },
asset: { type: 'choice', instructions: 'Which asset is the user referring to? Choose the exact ticker if explicitly identifiable. Choose UNKNOWN if it cannot be determined.',
criteria: { KAS: 'Kaspa (KAS) is the asset being discussed.', BTC: 'Bitcoin (BTC) is the asset being discussed.', USD: 'United States dollars (USD) are the asset being discussed.', UNKNOWN: 'The asset cannot be determined from the input.' } },
condition_operator: { type: 'choice', instructions: 'What price condition does the user express? LT means below/under, LTE means at or below, GT means above/over, GTE means at or above, EQ means exactly equal, NONE means no price condition.',
criteria: { LT: 'The user specifies a price below a threshold.', LTE: 'The user specifies a price at or below a threshold.', GT: 'The user specifies a price above a threshold.', GTE: 'The user specifies a price at or above a threshold.', EQ: 'The user specifies an exact price match.', NONE: 'The user does not specify a price condition.' } },
},
});