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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
key: "openai-analyze-image-content",
name: "Analyze Image Content",
description: "Send a message or question about an image and receive a response. [See the documentation](https://platform.openai.com/docs/api-reference/runs/createThreadAndRun)",
version: "0.1.0",
version: "0.1.1",
type: "action",
props: {
openai,
Expand Down
2 changes: 1 addition & 1 deletion components/openai/actions/cancel-run/cancel-run.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "openai-cancel-run",
name: "Cancel Run (Assistants)",
description: "Cancels a run that is in progress. [See the documentation](https://platform.openai.com/docs/api-reference/runs/cancelRun)",
version: "0.0.10",
version: "0.0.11",
type: "action",
props: {
openai,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "openai-chat-with-assistant",
name: "Chat with Assistant",
description: "Sends a message and generates a response, storing the message history for a continuous conversation. [See the documentation](https://platform.openai.com/docs/api-reference/runs/createThreadAndRun)",
version: "0.0.5",
version: "0.0.6",
type: "action",
props: {
openai,
Expand Down
2 changes: 1 addition & 1 deletion components/openai/actions/chat/chat.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ConfigurationError } from "@pipedream/platform";
export default {
...common,
name: "Chat",
version: "0.2.1",
version: "0.2.2",
key: "openai-chat",
description: "The Chat API, using the `gpt-3.5-turbo` or `gpt-4` model. [See the documentation](https://platform.openai.com/docs/api-reference/chat)",
type: "action",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import common from "../common/common-helper.mjs";
export default {
...common,
name: "Classify Items into Categories",
version: "0.1.1",
version: "0.1.2",
key: "openai-classify-items-into-categories",
description: "Classify items into specific categories using the Chat API. [See the documentation](https://platform.openai.com/docs/api-reference/chat)",
type: "action",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "openai-convert-text-to-speech",
name: "Convert Text to Speech (TTS)",
description: "Generates audio from the input text. [See the documentation](https://platform.openai.com/docs/api-reference/audio/createSpeech)",
version: "0.0.9",
version: "0.0.10",
type: "action",
props: {
openai,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "openai-create-assistant",
name: "Create Assistant",
description: "Creates an assistant with a model and instructions. [See the documentation](https://platform.openai.com/docs/api-reference/assistants/createAssistant)",
version: "0.1.7",
version: "0.1.8",
type: "action",
props: {
openai,
Expand Down
2 changes: 1 addition & 1 deletion components/openai/actions/create-batch/create-batch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
key: "openai-create-batch",
name: "Create Batch",
description: "Creates and executes a batch from an uploaded file of requests. [See the documentation](https://platform.openai.com/docs/api-reference/batch/create)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
openai,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import common from "../common/common.mjs";

export default {
name: "Create Embeddings",
version: "0.0.13",
version: "0.0.14",
key: "openai-create-embeddings",
description: "Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms. [See the documentation](https://platform.openai.com/docs/api-reference/embeddings)",
type: "action",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "openai-create-fine-tuning-job",
name: "Create Fine Tuning Job",
description: "Creates a job that fine-tunes a specified model from a given dataset. [See the documentation](https://platform.openai.com/docs/api-reference/fine-tuning/create)",
version: "0.0.9",
version: "0.0.10",
type: "action",
props: {
openai,
Expand Down
2 changes: 1 addition & 1 deletion components/openai/actions/create-image/create-image.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import fs from "fs";

export default {
name: "Create Image (Dall-E)",
version: "0.1.17",
version: "0.1.18",
key: "openai-create-image",
description: "Creates an image given a prompt returning a URL to the image. [See the documentation](https://platform.openai.com/docs/api-reference/images)",
type: "action",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "openai-create-moderation",
name: "Create Moderation",
description: "Classifies if text is potentially harmful. [See the documentation](https://platform.openai.com/docs/api-reference/moderations/create)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
openai,
Expand Down
2 changes: 1 addition & 1 deletion components/openai/actions/create-thread/create-thread.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "openai-create-thread",
name: "Create Thread (Assistants)",
description: "Creates a thread with optional messages and metadata, and optionally runs the thread using the specified assistant. [See the documentation](https://platform.openai.com/docs/api-reference/threads/createThread)",
version: "0.0.9",
version: "0.0.10",
type: "action",
props: {
openai,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const pipelineAsync = promisify(stream.pipeline);

export default {
name: "Create Transcription (Whisper)",
version: "0.1.13",
version: "0.1.14",
key: "openai-create-transcription",
description: "Transcribes audio into the input language. [See the documentation](https://platform.openai.com/docs/api-reference/audio/create).",
type: "action",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import openai from "../../openai.app.mjs";

export default {
key: "openai-create-vector-store-file",
name: "Create Vector Store File",
description: "Create a vector store file. [See the documentation](https://platform.openai.com/docs/api-reference/vector-stores-files/createFile)",
version: "0.0.1",
type: "action",
props: {
openai,
vectorStoreId: {
propDefinition: [
openai,
"vectorStoreId",
],
},
fileId: {
propDefinition: [
openai,
"fileId",
],
},
chunkingStrategy: {
type: "string",
label: "Chunking Strategy",
description: "The chunking strategy used to chunk the file",
options: [
"auto",
"static",
],
optional: true,
reloadProps: true,
},
},
additionalProps() {
const props = {};

if (this?.chunkingStrategy === "static") {
props.maxChunkSizeTokens = {
type: "integer",
label: "Max Chunk Size Tokens",
description: "The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`.",
default: 800,
optional: true,
};
props.chunkOverlapTokens = {
type: "integer",
label: "Chunk Overlap Tokens",
description: "The number of tokens that overlap between chunks. The default value is `400`. Note that the overlap must not exceed half of max_chunk_size_tokens.",
default: 400,
optional: true,
};
}

return props;
},
async run({ $ }) {
const response = await this.openai.createVectorStoreFile({
$,
vectorStoreId: this.vectorStoreId,
data: {
file_id: this.fileId,
chunking_strategy: this.chunkingStrategy && {
type: this.chunkingStrategy,
static: this.chunkingStrategy === "static"
? {
max_chunk_size_tokens: this.maxChunkSizeTokens,
chunk_overlap_tokens: this.chunkOverlapTokens,
}
: undefined,
},
},
});
$.export("$summary", `Successfully created vector store file with ID: ${response.id}`);
return response;
},
};
103 changes: 103 additions & 0 deletions components/openai/actions/create-vector-store/create-vector-store.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import openai from "../../openai.app.mjs";

export default {
key: "openai-create-vector-store",
name: "Create Vector Store",
description: "Create a vector store. [See the documentation](https://platform.openai.com/docs/api-reference/vector-stores/create)",
version: "0.0.1",
type: "action",
props: {
openai,
fileIds: {
propDefinition: [
openai,
"fileId",
],
type: "string[]",
label: "File IDs",
description: "An array of File IDs that the vector store should use",
optional: true,
reloadProps: true,
},
name: {
type: "string",
label: "Name",
description: "Name of the vector store",
optional: true,
},
expiryDays: {
type: "integer",
label: "Expiration Days",
description: "The number of days after the `last_active_at` time that the vector store will expire",
optional: true,
},
metadata: {
type: "object",
label: "Metadata",
description: "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format",
optional: true,
},
},
additionalProps() {
const props = {};
if (!this.fileIds?.length) {
return props;
}

props.chunkingStrategy = {
type: "string",
label: "Chunking Strategy",
description: "The chunking strategy used to chunk the file(s)",
options: [
"auto",
"static",
],
optional: true,
reloadProps: true,
};

if (this?.chunkingStrategy === "static") {
props.maxChunkSizeTokens = {
type: "integer",
label: "Max Chunk Size Tokens",
description: "The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`.",
default: 800,
optional: true,
};
props.chunkOverlapTokens = {
type: "integer",
label: "Chunk Overlap Tokens",
description: "The number of tokens that overlap between chunks. The default value is `400`. Note that the overlap must not exceed half of max_chunk_size_tokens.",
default: 400,
optional: true,
};
}

return props;
},
async run({ $ }) {
const response = await this.openai.createVectorStore({
$,
data: {
file_ids: this.fileIds,
name: this.name,
expires_after: this.expiryDays && {
anchor: "last_active_at",
days: this.expiryDays,
},
chunking_strategy: this.chunkingStrategy && {
type: this.chunkingStrategy,
static: this.chunkingStrategy === "static"
? {
max_chunk_size_tokens: this.maxChunkSizeTokens,
chunk_overlap_tokens: this.chunkOverlapTokens,
}
: undefined,
},
metadata: this.metadata,
},
});
$.export("$summary", `Successfully created vector store with ID: ${response.id}`);
return response;
},
};
2 changes: 1 addition & 1 deletion components/openai/actions/delete-file/delete-file.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "openai-delete-file",
name: "Delete File",
description: "Deletes a specified file from OpenAI. [See the documentation](https://platform.openai.com/docs/api-reference/files/delete)",
version: "0.0.10",
version: "0.0.11",
type: "action",
props: {
openai,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import openai from "../../openai.app.mjs";

export default {
key: "openai-delete-vector-store-file",
name: "Delete Vector Store File",
description: "Deletes a vector store file. [See the documentation](https://platform.openai.com/docs/api-reference/vector-stores-files/deleteFile)",
version: "0.0.1",
type: "action",
props: {
openai,
vectorStoreId: {
propDefinition: [
openai,
"vectorStoreId",
],
},
vectorStoreFileId: {
propDefinition: [
openai,
"vectorStoreFileId",
(c) => ({
vectorStoreId: c.vectorStoreId,
}),
],
},
},
async run({ $ }) {
const response = await this.openai.deleteVectorStoreFile({
$,
vectorStoreId: this.vectorStoreId,
vectorStoreFileId: this.vectorStoreFileId,
});
$.export("$summary", `Successfully deleted vector store file with ID: ${this.vectorStoreFileId}`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import openai from "../../openai.app.mjs";

export default {
key: "openai-delete-vector-store",
name: "Delete Vector Store",
description: "Delete a vector store. [See the documentation](https://platform.openai.com/docs/api-reference/vector-stores/delete)",
version: "0.0.1",
type: "action",
props: {
openai,
vectorStoreId: {
propDefinition: [
openai,
"vectorStoreId",
],
},
},
async run({ $ }) {
const response = await this.openai.deleteVectorStore({
$,
vectorStoreId: this.vectorStoreId,
});
$.export("$summary", `Successfully deleted vector store with ID: ${this.vectorStoreId}`);
return response;
},
};
2 changes: 1 addition & 1 deletion components/openai/actions/list-files/list-files.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "openai-list-files",
name: "List Files",
description: "Returns a list of files that belong to the user's organization. [See the documentation](https://platform.openai.com/docs/api-reference/files/list)",
version: "0.0.10",
version: "0.0.11",
type: "action",
props: {
openai,
Expand Down
2 changes: 1 addition & 1 deletion components/openai/actions/list-messages/list-messages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "openai-list-messages",
name: "List Messages (Assistants)",
description: "Lists the messages for a given thread. [See the documentation](https://platform.openai.com/docs/api-reference/messages/listMessages)",
version: "0.0.11",
version: "0.0.12",
type: "action",
props: {
openai,
Expand Down
Loading
Loading