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,22 @@
|
||||
{
|
||||
"Chatbot ID": "Chatbot ID",
|
||||
"API key": "API key",
|
||||
"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": "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",
|
||||
"Process input text": "Process input text",
|
||||
"Input text processed by the chatbot": "Input text processed by the chatbot",
|
||||
"Question": "Question",
|
||||
"Prompt": "Prompt",
|
||||
"Model": "Model",
|
||||
"Citations": "Citations",
|
||||
"The question to be processed by the chatbot": "The question to be processed by the chatbot",
|
||||
"The prompt to be used by the chatbot e.g., \"Please provide your answer in the following format: ...\"": "The prompt to be used by the chatbot e.g., \"Please provide your answer in the following format: ...\"",
|
||||
"The model to be used by the chatbot (e.g., gpt-3.5, gpt-4)": "The model to be used by the chatbot (e.g., gpt-3.5, gpt-4)",
|
||||
"Whether to include citations in the response": "Whether to include citations in the response",
|
||||
"gpt-3.5": "gpt-3.5",
|
||||
"gpt-4o-mini": "gpt-4o-mini",
|
||||
"gpt-4": "gpt-4",
|
||||
"gpt-4o": "gpt-4o",
|
||||
"claude-3-5-sonnet": "claude-3-5-sonnet",
|
||||
"claude-3-5-haiku": "claude-3-5-haiku",
|
||||
"claude-3-7-sonnet": "claude-3-7-sonnet"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { createPiece, PieceAuth } from '@activepieces/pieces-framework';
|
||||
import { denserAiAuth } from './lib/common/auth';
|
||||
import { PieceCategory } from '@activepieces/shared';
|
||||
import { processInputText } from './lib/actions/process-input-text';
|
||||
|
||||
export const denserAi = createPiece({
|
||||
displayName: 'Denser.ai',
|
||||
auth: denserAiAuth,
|
||||
minimumSupportedRelease: '0.36.1',
|
||||
logoUrl: 'https://cdn.activepieces.com/pieces/denser-ai.png',
|
||||
categories: [PieceCategory.ARTIFICIAL_INTELLIGENCE],
|
||||
authors: ['sanket-a11y'],
|
||||
actions: [processInputText],
|
||||
triggers: [],
|
||||
});
|
||||
@@ -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