Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/quiet-llamas-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@thirdweb-dev/ai-sdk-provider": patch
---

Update sign swap action type
Comment on lines +1 to +5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Semver: use a minor bump (public API changed)

SignSwapInput gained new required fields (from_token, to_token). Per repo guidelines, this is a public API modification → minor, not patch.

Apply:

-"@thirdweb-dev/ai-sdk-provider": patch
+"@thirdweb-dev/ai-sdk-provider": minor

Consider updating the summary to reference the exact tool/action name for consistency (“sign_swap” vs “sign swap”).

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
---
"@thirdweb-dev/ai-sdk-provider": patch
---
Update sign swap action type
---
"@thirdweb-dev/ai-sdk-provider": minor
---
Update sign swap action type
🤖 Prompt for AI Agents
.changeset/quiet-llamas-chew.md around lines 1 to 5: the changeset currently
uses "patch" but the public API changed (SignSwapInput added required fields),
so update the semver bump to "minor" instead of "patch" and adjust the summary
line to reference the exact tool/action name for consistency (use "sign_swap" or
the canonical action identifier instead of "sign swap"); save the file so the
changeset reflects a minor release and consistent naming.

2 changes: 2 additions & 0 deletions packages/ai-sdk-provider/src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,8 @@ class ThirdwebLanguageModel implements LanguageModelV2 {
action: parsed.data.action,
intent: parsed.data.intent,
transaction: parsed.data.transaction,
from_token: parsed.data.from_token,
to_token: parsed.data.to_token,
} satisfies SignSwapInput;
break;

Expand Down
11 changes: 11 additions & 0 deletions packages/ai-sdk-provider/src/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,21 @@ const AgentActionSignSwapDataIntent = z.object({
max_steps: z.number(),
});

const AgentActionSignSwapDataToken = z.object({
address: z.string(),
chain_id: z.number(),
amount: z.string(),
symbol: z.string(),
decimals: z.number(),
price: z.number().nullable(),
});

const AgentActionSignSwapData = z.object({
action: z.string(),
intent: AgentActionSignSwapDataIntent,
transaction: AgentActionSignTransactionData,
from_token: AgentActionSignSwapDataToken,
to_token: AgentActionSignSwapDataToken,
});

const AgentActionTransactionOutputData = z.object({
Expand Down
Loading