@pipedream/openai 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/actions/chat/chat.mjs
CHANGED
|
@@ -4,9 +4,9 @@ import common from "../common/common.mjs";
|
|
|
4
4
|
export default {
|
|
5
5
|
...common,
|
|
6
6
|
name: "Chat",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.1",
|
|
8
8
|
key: "openai-chat",
|
|
9
|
-
description: "The Chat API, using the `gpt-3.5-turbo` model. [See docs here](https://platform.openai.com/docs/api-reference/chat)",
|
|
9
|
+
description: "The Chat API, using the `gpt-3.5-turbo` or `gpt-4` model. [See docs here](https://platform.openai.com/docs/api-reference/chat)",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
openai,
|
|
@@ -3,11 +3,12 @@ import common from "../common/common-helper.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
...common,
|
|
5
5
|
name: "Classify Items into Categories",
|
|
6
|
-
version: "0.0.
|
|
6
|
+
version: "0.0.3",
|
|
7
7
|
key: "openai-classify-items-into-categories",
|
|
8
8
|
description: "Classify items into specific categories using the Chat API",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
|
+
...common.props,
|
|
11
12
|
items: {
|
|
12
13
|
label: "Items",
|
|
13
14
|
description: "Items to categorize",
|
|
@@ -18,7 +19,6 @@ export default {
|
|
|
18
19
|
description: "Categories to classify items into",
|
|
19
20
|
type: "string[]",
|
|
20
21
|
},
|
|
21
|
-
...common.props,
|
|
22
22
|
},
|
|
23
23
|
methods: {
|
|
24
24
|
...common.methods,
|
|
@@ -31,7 +31,7 @@ export default {
|
|
|
31
31
|
userMessage() {
|
|
32
32
|
return `Categorize each of the following items:\n\n${this.items.join("\n")}\n\ninto one of the following categories:\n\n${this.categories.join("\n")}\n\n${this.outputFormat()}}`;
|
|
33
33
|
},
|
|
34
|
-
|
|
34
|
+
summary() {
|
|
35
35
|
return `Categorized ${this.items.length} items into ${this.categories.length} categories`;
|
|
36
36
|
},
|
|
37
37
|
formatOutput({
|
|
@@ -3,11 +3,12 @@ import common from "../common/common-helper.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
...common,
|
|
5
5
|
name: "Summarize Text",
|
|
6
|
-
version: "0.0.
|
|
6
|
+
version: "0.0.3",
|
|
7
7
|
key: "openai-summarize",
|
|
8
8
|
description: "Summarizes text using the Chat API",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
|
+
...common.props,
|
|
11
12
|
text: {
|
|
12
13
|
label: "Text",
|
|
13
14
|
description: "The text to summarize",
|
|
@@ -25,7 +26,6 @@ export default {
|
|
|
25
26
|
"page",
|
|
26
27
|
],
|
|
27
28
|
},
|
|
28
|
-
...common.props,
|
|
29
29
|
},
|
|
30
30
|
methods: {
|
|
31
31
|
...common.methods,
|
|
@@ -9,7 +9,7 @@ const langOptions = lang.LANGUAGES.map((l) => ({
|
|
|
9
9
|
export default {
|
|
10
10
|
...common,
|
|
11
11
|
name: "Translate Text",
|
|
12
|
-
version: "0.0.
|
|
12
|
+
version: "0.0.3",
|
|
13
13
|
key: "openai-translate-text",
|
|
14
14
|
description: "Translate text from one language to another using the Chat API",
|
|
15
15
|
type: "action",
|
|
@@ -41,7 +41,7 @@ export default {
|
|
|
41
41
|
userMessage() {
|
|
42
42
|
return `Translate the following text from ISO 639-1 ${this.sourceLang} to ISO 639-1 ${this.targetLang}:\n\n${this.text}`;
|
|
43
43
|
},
|
|
44
|
-
|
|
44
|
+
summary() {
|
|
45
45
|
return `Translated text from ${this.sourceLang} to ${this.targetLang}`;
|
|
46
46
|
},
|
|
47
47
|
formatOutput({
|
package/app/openai.app.mjs
CHANGED
|
@@ -70,7 +70,7 @@ export default {
|
|
|
70
70
|
const models = await this.models({
|
|
71
71
|
$,
|
|
72
72
|
});
|
|
73
|
-
return models.filter((model) => model.id.match(/turbo/gi));
|
|
73
|
+
return models.filter((model) => model.id.match(/turbo|gpt/gi));
|
|
74
74
|
},
|
|
75
75
|
async getCompletionModels({ $ }) {
|
|
76
76
|
const models = await this.models({
|