diff --git a/packages/bot-engine/forge/executeForgedBlock.ts b/packages/bot-engine/forge/executeForgedBlock.ts index a5406bf175..b0f8750c6a 100644 --- a/packages/bot-engine/forge/executeForgedBlock.ts +++ b/packages/bot-engine/forge/executeForgedBlock.ts @@ -136,7 +136,10 @@ export const executeForgedBlock = async ( clientSideActions.push({ type: 'codeToExecute', codeToExecute: action?.run?.web?.parseFunction({ + credentials: credentialsData ?? {}, options: parsedOptions, + variables, + logs: logsStore, }), }) } @@ -151,14 +154,23 @@ export const executeForgedBlock = async ( type: 'custom-embed', content: { url: action.run.web.displayEmbedBubble.parseUrl({ + credentials: credentialsData ?? {}, options: parsedOptions, + variables, + logs: logsStore, }), initFunction: action.run.web.displayEmbedBubble.parseInitFunction({ + credentials: credentialsData ?? {}, options: parsedOptions, + variables, + logs: logsStore, }), waitForEventFunction: action.run.web.displayEmbedBubble.waitForEvent?.parseFunction?.({ + credentials: credentialsData ?? {}, options: parsedOptions, + variables, + logs: logsStore, }), }, } diff --git a/packages/forge/blocks/anthropic/actions/createChatMessage.tsx b/packages/forge/blocks/anthropic/actions/createChatMessage.tsx index 4059a0b8eb..5716be1f62 100644 --- a/packages/forge/blocks/anthropic/actions/createChatMessage.tsx +++ b/packages/forge/blocks/anthropic/actions/createChatMessage.tsx @@ -123,7 +123,7 @@ export const createChatMessage = createAction({ getSetVariableIds: ({ responseMapping }) => responseMapping?.map((res) => res.variableId).filter(isDefined) ?? [], run: { - server: async ({ credentials: { apiKey }, options, variables, logs }) => { + server: async ({ credentials: { apiKey }, options, variables }) => { const modelName = options.model ?? defaultAnthropicOptions.model const model = createAnthropic({ apiKey, diff --git a/packages/forge/core/types.ts b/packages/forge/core/types.ts index 8d246be7f8..461445f0e8 100644 --- a/packages/forge/core/types.ts +++ b/packages/forge/core/types.ts @@ -79,22 +79,34 @@ export type ActionDefinition< * Used to determine the URL to be displayed as a text bubble in runtimes where the code can't be executed. (i.e. WhatsApp) */ parseUrl: (params: { + credentials: CredentialsFromAuthDef options: z.infer & z.infer + variables: VariableStore + logs: LogsStore }) => string | undefined waitForEvent?: { getSaveVariableId?: ( options: z.infer & z.infer ) => string | undefined parseFunction: (params: { + credentials: CredentialsFromAuthDef options: z.infer & z.infer + variables: VariableStore + logs: LogsStore }) => FunctionToExecute } parseInitFunction: (params: { + credentials: CredentialsFromAuthDef options: z.infer & z.infer + variables: VariableStore + logs: LogsStore }) => FunctionToExecute } parseFunction?: (params: { + credentials: CredentialsFromAuthDef options: z.infer & z.infer + variables: VariableStore + logs: LogsStore }) => FunctionToExecute } }