Skip to content

Commit 3a469b8

Browse files
committed
Merge remote-tracking branch 'origin/master' into hubspot-updates
2 parents 7f80305 + 1fd91e7 commit 3a469b8

File tree

81 files changed

+2185
-539
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+2185
-539
lines changed

components/_21risk/_21risk.app.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default {
2+
type: "app",
3+
app: "_21risk",
4+
propDefinitions: {},
5+
methods: {
6+
// this.$auth contains connected account data
7+
authKeys() {
8+
console.log(Object.keys(this.$auth));
9+
},
10+
},
11+
};

components/_21risk/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/_21risk",
3+
"version": "0.0.1",
4+
"description": "Pipedream 21RISK Components",
5+
"main": "_21risk.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"_21risk"
9+
],
10+
"homepage": "https://pipedream.com/apps/_21risk",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}

components/_2chat/_2chat.app.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default {
2+
type: "app",
3+
app: "_2chat",
4+
propDefinitions: {},
5+
methods: {
6+
// this.$auth contains connected account data
7+
authKeys() {
8+
console.log(Object.keys(this.$auth));
9+
},
10+
},
11+
};

components/_2chat/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/_2chat",
3+
"version": "0.0.1",
4+
"description": "Pipedream 2Chat Components",
5+
"main": "_2chat.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"_2chat"
9+
],
10+
"homepage": "https://pipedream.com/apps/_2chat",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}

components/adobe_photoshop/adobe_photoshop.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/airship/airship.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/ayrshare/ayrshare.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
import app from "../../cohere_platform.app.mjs";
2+
import { clearObj } from "../../common/utils.mjs";
3+
4+
export default {
5+
key: "cohere_platform-chat",
6+
name: "Chat",
7+
version: "0.0.1",
8+
description: "Generates a text response to a user message. [See the documentation](https://docs.cohere.com/reference/chat)",
9+
type: "action",
10+
props: {
11+
app,
12+
message: {
13+
propDefinition: [
14+
app,
15+
"message",
16+
],
17+
},
18+
model: {
19+
propDefinition: [
20+
app,
21+
"model",
22+
],
23+
},
24+
temperature: {
25+
propDefinition: [
26+
app,
27+
"temperature",
28+
],
29+
},
30+
maxTokens: {
31+
propDefinition: [
32+
app,
33+
"maxTokens",
34+
],
35+
},
36+
k: {
37+
propDefinition: [
38+
app,
39+
"k",
40+
],
41+
},
42+
p: {
43+
propDefinition: [
44+
app,
45+
"p",
46+
],
47+
},
48+
stopSequences: {
49+
propDefinition: [
50+
app,
51+
"stopSequences",
52+
],
53+
},
54+
frequencyPenalty: {
55+
propDefinition: [
56+
app,
57+
"frequencyPenalty",
58+
],
59+
},
60+
},
61+
methods: {
62+
chat(data) {
63+
return this.app.client().chat(data);
64+
},
65+
},
66+
async run({ $ }) {
67+
const {
68+
chat,
69+
message,
70+
model,
71+
temperature,
72+
maxTokens,
73+
k,
74+
p,
75+
stopSequences,
76+
frequencyPenalty,
77+
78+
} = this;
79+
const response = await chat(clearObj({
80+
message,
81+
model,
82+
...(temperature && {
83+
temperature: parseFloat(temperature),
84+
}),
85+
maxTokens,
86+
k,
87+
...(p && {
88+
p: parseFloat(p),
89+
}),
90+
stopSequences,
91+
...(frequencyPenalty && {
92+
frequencyPenalty: parseFloat(frequencyPenalty),
93+
}),
94+
}));
95+
96+
$.export("$summary", `The message was successfully responded with ID \`${response.response_id}\``);
97+
return response;
98+
},
99+
};

components/cohere_platform/actions/choose-best-completion/choose-best-completion.mjs

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,46 @@
1-
import coherePlatform from "../../cohere_platform.app.mjs";
1+
import app from "../../cohere_platform.app.mjs";
2+
import { clearObj } from "../../common/utils.mjs";
23

34
export default {
45
key: "cohere_platform-classify-text",
56
name: "Classify Text",
6-
version: "0.0.1",
7-
description: "This action makes a prediction about which label fits the specified text inputs best. [See the docs here](https://docs.cohere.com/reference/classify)",
7+
version: "0.1.0",
8+
description: "This action makes a prediction about which label fits the specified text inputs best. [See the documentation](https://docs.cohere.com/reference/classify-1)",
89
type: "action",
910
props: {
10-
coherePlatform,
11+
app,
1112
inputs: {
1213
type: "string[]",
1314
label: "Inputs",
1415
description: "Represents a list of queries to be classified, each entry must not be empty. The maximum is 96 inputs.",
1516
},
16-
classifyModel: {
17+
model: {
1718
propDefinition: [
18-
coherePlatform,
19+
app,
1920
"classifyModel",
2021
],
2122
},
2223
preset: {
2324
propDefinition: [
24-
coherePlatform,
25+
app,
2526
"preset",
2627
],
2728
},
2829
truncate: {
2930
propDefinition: [
30-
coherePlatform,
31+
app,
3132
"truncate",
3233
],
3334
},
3435
numExamples: {
3536
type: "integer",
3637
label: "Number of Examples",
37-
description: "To make a prediction, Classify uses provided examples of text + label pairs. Specify the number of examples to provide. Each example is a text string and its associated label/class. At least 2 labels must be provided.",
38+
description: "To make a prediction, Classify uses provided examples of text + label pairs. Specify the number of examples to provide. Each example is a text string and its associated label/class. At least 2 unique labels must be provided and each label should have at least 2 different examples.",
39+
default: 4,
3840
reloadProps: true,
3941
},
4042
},
41-
async additionalProps() {
43+
additionalProps() {
4244
const props = {};
4345

4446
for (let i = 0; i < this.numExamples; i++) {
@@ -56,28 +58,40 @@ export default {
5658

5759
return props;
5860
},
61+
methods: {
62+
getExamples() {
63+
const examples = [];
64+
for (let i = 0; i < this.numExamples; i++) {
65+
examples.push({
66+
text: this[`text_${i}`],
67+
label: this[`label_${i}`],
68+
});
69+
}
70+
return examples;
71+
},
72+
classifyText(data) {
73+
return this.app.client().classify(data);
74+
},
75+
},
5976
async run({ $ }) {
60-
const examples = [];
61-
for (let i = 0; i < this.numExamples; i++) {
62-
examples.push({
63-
text: this[`text_${i}`],
64-
label: this[`label_${i}`],
65-
});
66-
}
67-
68-
const response = await this.coherePlatform.classifyText({
69-
inputs: this.inputs,
70-
model: this.model,
71-
preset: this.preset,
72-
truncate: this.truncate,
73-
examples,
74-
});
77+
const {
78+
classifyText,
79+
inputs,
80+
model,
81+
preset,
82+
truncate,
83+
getExamples,
84+
} = this;
7585

76-
if (response.statusCode != "200") {
77-
throw new Error(response.body.message);
78-
}
86+
const response = await classifyText(clearObj({
87+
inputs,
88+
model,
89+
preset,
90+
truncate,
91+
examples: getExamples(),
92+
}));
7993

80-
$.export("$summary", "The text was successfully classified.");
94+
$.export("$summary", `The text was successfully classified with ID \`${response.id}\``);
8195
return response;
8296
},
8397
};

0 commit comments

Comments
 (0)