Add Activepieces integration for workflow automation
- Add Activepieces fork with SmoothSchedule custom piece - Create integrations app with Activepieces service layer - Add embed token endpoint for iframe integration - Create Automations page with embedded workflow builder - Add sidebar visibility fix for embed mode - Add list inactive customers endpoint to Public API - Include SmoothSchedule triggers: event created/updated/cancelled - Include SmoothSchedule actions: create/update/cancel events, list resources/services/customers 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
import { createAction, Property } from '@activepieces/pieces-framework';
|
||||
import { denserAiAuth } from '../common/auth';
|
||||
import { makeRequest } from '../common/client';
|
||||
import { HttpMethod } from '@activepieces/pieces-common';
|
||||
|
||||
export const processInputText = createAction({
|
||||
auth: denserAiAuth,
|
||||
name: 'processInputText',
|
||||
displayName: 'Process input text',
|
||||
description: 'Input text processed by the chatbot',
|
||||
props: {
|
||||
question: Property.LongText({
|
||||
displayName: 'Question',
|
||||
description: 'The question to be processed by the chatbot',
|
||||
required: true,
|
||||
}),
|
||||
prompt: Property.LongText({
|
||||
displayName: 'Prompt',
|
||||
description:
|
||||
'The prompt to be used by the chatbot e.g., "Please provide your answer in the following format: ..."',
|
||||
required: false,
|
||||
}),
|
||||
model: Property.StaticDropdown({
|
||||
displayName: 'Model',
|
||||
description: 'The model to be used by the chatbot (e.g., gpt-3.5, gpt-4)',
|
||||
required: false,
|
||||
options: {
|
||||
options: [
|
||||
{ label: 'gpt-3.5', value: 'gpt-3.5' },
|
||||
{ label: 'gpt-4o-mini', value: 'gpt-4o-mini' },
|
||||
{ label: 'gpt-4', value: 'gpt-4' },
|
||||
{ label: 'gpt-4o', value: 'gpt-4o' },
|
||||
{ label: 'claude-3-5-sonnet', value: 'claude-3-5-sonnet' },
|
||||
{ label: 'claude-3-5-haiku', value: 'claude-3-5-haiku' },
|
||||
{ label: 'claude-3-7-sonnet', value: 'claude-3-7-sonnet' },
|
||||
],
|
||||
},
|
||||
defaultValue: ' gpt-4o-mini',
|
||||
}),
|
||||
citation: Property.Checkbox({
|
||||
displayName: 'Citations',
|
||||
description: 'Whether to include citations in the response',
|
||||
required: false,
|
||||
defaultValue: false,
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const { question, prompt, model, citation } = context.propsValue;
|
||||
const { apiKey, chatbotId } = context.auth.props;
|
||||
const response = await makeRequest(HttpMethod.POST, `/query`, {
|
||||
question,
|
||||
prompt,
|
||||
model,
|
||||
citation,
|
||||
key: apiKey,
|
||||
chatbotId: chatbotId,
|
||||
});
|
||||
return response;
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,18 @@
|
||||
import { PieceAuth, Property } from '@activepieces/pieces-framework';
|
||||
|
||||
export const denserAiAuth = PieceAuth.CustomAuth({
|
||||
props: {
|
||||
chatbotId: Property.ShortText({
|
||||
displayName: 'Chatbot ID',
|
||||
description:
|
||||
'The Chatbot ID is available on the [main dashboard of Denser Chatbot](https://denser.ai/u/chatbots). Simply choose the ID of the chatbot you want',
|
||||
required: true,
|
||||
}),
|
||||
apiKey: Property.ShortText({
|
||||
displayName: 'API key',
|
||||
description: '',
|
||||
required: true,
|
||||
}),
|
||||
},
|
||||
required: true,
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
|
||||
|
||||
export const BASE_URL = `https://denser.ai/api`;
|
||||
|
||||
export async function makeRequest(
|
||||
method: HttpMethod,
|
||||
path: string,
|
||||
body?: unknown
|
||||
) {
|
||||
try {
|
||||
const response = await httpClient.sendRequest({
|
||||
method,
|
||||
url: `${BASE_URL}${path}`,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body,
|
||||
});
|
||||
return response.body;
|
||||
} catch (error: any) {
|
||||
throw new Error(`Unexpected error: ${error.message || String(error)}`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user