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
4 changes: 2 additions & 2 deletions components/elevenlabs/actions/add-voice/add-voice.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import elevenlabs from "../../elevenlabs.app.mjs";
export default {
key: "elevenlabs-add-voice",
name: "Add Voice",
version: "0.0.1",
version: "0.0.2",
description: "Add a voice from one or more audio files. [See the documentation](https://elevenlabs.io/docs/api-reference/add-voice)",
type: "action",
props: {
Expand Down Expand Up @@ -59,7 +59,7 @@ export default {
data,
});

$.export("$summary", `Sucessfully added voice (ID: ${response.voice_id})`);
$.export("$summary", `Successfully added voice (ID: ${response.voice_id})`);
return response;
},
};
133 changes: 133 additions & 0 deletions components/elevenlabs/actions/create-agent/create-agent.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
import elevenlabs from "../../elevenlabs.app.mjs";

export default {
key: "elevenlabs-create-agent",
name: "Create Agent",
description: "Create an agent in Eleventlabs. [See the documentation](https://elevenlabs.io/docs/api-reference/agents/create-agent)",
version: "0.0.1",
type: "action",
props: {
elevenlabs,
prompt: {
type: "string",
label: "Prompt",
description: "The prompt for the agent",
},
name: {
type: "string",
label: "Name",
description: "A name to make the agent easier to find",
optional: true,
},
llm: {
type: "string",
label: "LLM",
description: "The LLM to query with the prompt and the chat history",
options: [
"gpt-4o-mini",
"gpt-4o",
"gpt-4",
"gpt-4-turbo",
"gpt-3.5-turbo",
"gemini-1.5-pro",
"gemini-1.5-flash",
"gemini-2.0-flash-001",
"gemini-2.0-flash-lite",
"gemini-1.0-pro",
"claude-3-7-sonnet",
"claude-3-5-sonnet",
],
optional: true,
},
temperature: {
type: "string",
label: "Temperature",
description: "The temperature for the LLM. Defaults to `0`",
optional: true,
},
maxTokens: {
type: "integer",
label: "Max Tokens",
description: "If greater than 0, maximum number of tokens the LLM can predict",
optional: true,
},
firstMessage: {
type: "string",
label: "First Message",
description: "If non-empty, the first message the agent will say. If empty, the agent waits for the user to start the discussion.",
optional: true,
},
language: {
type: "string",
label: "Language",
description: "Language of the agent - used for ASR and TTS. Defaults to `en`",
optional: true,
},
maxDurationSeconds: {
type: "integer",
label: "Max Duration in Seconds",
description: "The maximum duration of a conversation in seconds. Defaults to `600`",
optional: true,
},
turnTimeout: {
type: "string",
label: "Turn Timeout",
description: "Maximum wait time for the user’s reply before re-engaging the user. Defaults to `7`",
optional: true,
},
voiceId: {
propDefinition: [
elevenlabs,
"voiceId",
],
description: "The voice ID to use for TTS",
optional: true,
},
ttsModelId: {
type: "string",
label: "TTS Model ID",
description: "The model to use for TTS",
options: [
"eleven_turbo_v2",
"eleven_turbo_v2_5",
"eleven_flash_v2",
"eleven_flash_v2_5",
],
optional: true,
},
},
async run({ $ }) {
const response = await this.elevenlabs.createAgent({
$,
data: {
conversation_config: {
conversation: {
max_duration_seconds: this.maxDurationSeconds,
},
turn: {
turn_timeout: this.turnTimeout && +this.turnTimeout,
},
agent: {
first_message: this.firstMessage,
language: this.language,
prompt: {
prompt: this.prompt,
llm: this.llm,
temperature: this.temperature && +this.temperature,
max_tokens: this.maxTokens,
},
},
tts: {
voice_id: this.voiceId,
model_id: this.ttsModelId,
},
},
name: this.name,
},
});
if (response?.agent_id) {
$.export("$summary", `Successfully created agent with ID: ${response.agent_id}`);
}
return response;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import elevenlabs from "../../elevenlabs.app.mjs";
export default {
key: "elevenlabs-download-history-items",
name: "Download History Items",
version: "0.0.2",
version: "0.0.3",
description: "Download one or more history items to your workflow's `tmp` directory. If one history item ID is provided, we will return a single audio file. If more than one history item IDs are provided, we will provide the history items packed into a .zip file. [See the documentation](https://docs.elevenlabs.io/api-reference/history-download)",
type: "action",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import elevenlabs from "../../elevenlabs.app.mjs";
export default {
key: "elevenlabs-get-audio-from-history-item",
name: "Get Audio From History Item",
version: "0.0.2",
version: "0.0.3",
description: "Returns the audio of an history item and converts it to a file. [See the documentation](https://docs.elevenlabs.io/api-reference/history-audio)",
type: "action",
props: {
Expand Down
2 changes: 1 addition & 1 deletion components/elevenlabs/actions/list-models/list-models.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import elevenlabs from "../../elevenlabs.app.mjs";
export default {
key: "elevenlabs-list-models",
name: "Get Models",
version: "0.0.2",
version: "0.0.3",
description: "Gets a list of available models. [See the documentation](https://docs.elevenlabs.io/api-reference/models-get)",
type: "action",
props: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import elevenlabs from "../../elevenlabs.app.mjs";

export default {
key: "elevenlabs-make-outbound-call",
name: "Make Outbound Call",
description: "Handle an outbound call via Twilio with Elevenlabs. [See the documentation](https://elevenlabs.io/docs/api-reference/conversations/twilio-outbound-call)",
version: "0.0.1",
type: "action",
props: {
elevenlabs,
agentId: {
propDefinition: [
elevenlabs,
"agentId",
],
},
agentPhoneNumberId: {
propDefinition: [
elevenlabs,
"phoneNumberId",
],
},
toNumber: {
type: "string",
label: "To Number",
description: "The recipient phone number",
},
},
async run({ $ }) {
const response = await this.elevenlabs.makeOutboundCall({
$,
data: {
agent_id: this.agentId,
agent_phone_number: this.agentPhoneNumberId,
to_number: this.toNumber,
},
});
if (response?.success) {
$.export("$summary", `Successfully made outbound call to ${this.toNumber}`);
}
return response;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import elevenlabs from "../../elevenlabs.app.mjs";
export default {
key: "elevenlabs-text-to-speech",
name: "Text To Speech",
version: "0.0.2",
version: "0.0.3",
description: "Retrieve an audio file. [See the documentation](https://docs.elevenlabs.io/api-reference/text-to-speech)",
type: "action",
props: {
Expand Down
73 changes: 70 additions & 3 deletions components/elevenlabs/elevenlabs.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
propDefinitions: {
historyItemId: {
type: "string",
label: "History Item Id",
label: "History Item ID",
description: "History item ID to be used.",
async options({ prevContext }) {
const {
Expand Down Expand Up @@ -34,7 +34,7 @@ export default {
},
voiceId: {
type: "string",
label: "Voice Id",
label: "Voice ID",
description: "Identifier of the voice that will be used.",
async options() {
const { voices } = await this.listVoices();
Expand All @@ -49,7 +49,7 @@ export default {
},
modelId: {
type: "string",
label: "Model Id",
label: "Model ID",
description: "Identifier of the model that will be used. Default: `eleven_monolingual_v1`",
async options() {
const models = await this.listModels();
Expand All @@ -62,6 +62,47 @@ export default {
}));
},
},
phoneNumberId: {
type: "string",
label: "Phone Number ID",
description: "Identifier of a phone number to use for the agent",
async options() {
const phoneNumbers = await this.listPhoneNumbers();
return phoneNumbers?.map(({
phone_number_id: value, phone_number: label,
}) => ({
label,
value,
})) || [];
},
},
agentId: {
type: "string",
label: "Agent ID",
description: "Identifier of an agent to use for the outbound call",
async options({ prevContext }) {
const {
agents, next_cursor: cursor,
} = await this.listAgents({
params: {
cursor: prevContext?.cursor,
page_size: 30,
},
});
const options = agents?.map(({
agent_id: value, name: label,
}) => ({
label,
value,
})) || [];
return {
options,
context: {
cursor,
},
};
},
},
},
methods: {
_apiUrl() {
Expand Down Expand Up @@ -139,6 +180,32 @@ export default {
...args,
});
},
listPhoneNumbers(args = {}) {
return this._makeRequest({
path: "convai/phone-numbers/",
...args,
});
},
listAgents(args = {}) {
return this._makeRequest({
path: "convai/agents",
...args,
});
},
createAgent(args = {}) {
return this._makeRequest({
method: "POST",
path: "convai/agents/create",
...args,
});
},
makeOutboundCall(args = {}) {
return this._makeRequest({
method: "POST",
path: "convai/twilio/outbound_call",
...args,
});
},
async *paginate({
fn, params = {}, maxResults = null,
}) {
Expand Down
4 changes: 2 additions & 2 deletions components/elevenlabs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/elevenlabs",
"version": "0.2.0",
"version": "0.3.0",
"description": "Pipedream ElevenLabs Components",
"main": "elevenlabs.app.mjs",
"keywords": [
Expand All @@ -13,7 +13,7 @@
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^1.6.0",
"@pipedream/platform": "^3.0.3",
"form-data": "^4.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import elevenlabs from "../../elevenlabs.app.mjs";
export default {
key: "elevenlabs-new-history-item",
name: "New History Item Created",
version: "0.0.2",
version: "0.0.3",
description: "Emit new event when a new history item is created.",
type: "source",
dedupe: "unique",
Expand Down
Loading
Loading