Skip to content

Commit 9e0730b

Browse files
committed
Use Spread
1 parent fb6c19b commit 9e0730b

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎packages/agent-sdk/src/autonomous.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ export async function callAgent<T = Record<string, unknown>>(
4343
accountId: string,
4444
message: string,
4545
agentId: string,
46-
systemPrompt: string,
4746
evmAddress: string = "",
4847
suiAddress: string = "",
4948
solanaAddress: string = "",
49+
systemPrompt?: string,
5050
): Promise<AgentResponse<T>> {
5151
const chatId = `chat_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
5252

@@ -63,7 +63,11 @@ export async function callAgent<T = Record<string, unknown>>(
6363
messageId: Math.random().toString(36).substr(2, 9),
6464
},
6565
],
66-
config: { mode: "debug", agentId, promptOverride: systemPrompt },
66+
config: {
67+
mode: "debug",
68+
agentId,
69+
...(systemPrompt ? { promptOverride: systemPrompt } : {}),
70+
},
6771
};
6872

6973
const response = await fetch(BITTE_API_URL, {

0 commit comments

Comments
 (0)