Skip to content

Commit d3ddbd3

Browse files
authored
Merging pull request #17675
* new component * pnpm-lock.yaml * pnpm-lock.yaml * pnpm-lock.yaml
1 parent 2edcb55 commit d3ddbd3

File tree

4 files changed

+56
-12
lines changed

4 files changed

+56
-12
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import altTextGeneratorAi from "../../alt_text_generator_ai.app.mjs";
2+
3+
export default {
4+
key: "alt_text_generator_ai-generate-alt-text",
5+
name: "Generate Alt Text",
6+
description: "Generate alt text for an image. [See the documentation](https://alttextgeneratorai.com/api-docs)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
altTextGeneratorAi,
11+
image: {
12+
type: "string",
13+
label: "Image URL",
14+
description: "The URL of the image to generate alt text for",
15+
},
16+
},
17+
async run({ $ }) {
18+
const response = await this.altTextGeneratorAi.generateAltText({
19+
$,
20+
data: {
21+
image: this.image,
22+
},
23+
});
24+
$.export("$summary", `Successfully generated alt text for ${this.image}`);
25+
return response;
26+
},
27+
};
Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
1+
import { axios } from "@pipedream/platform";
2+
13
export default {
24
type: "app",
35
app: "alt_text_generator_ai",
46
propDefinitions: {},
57
methods: {
6-
// this.$auth contains connected account data
7-
authKeys() {
8-
console.log(Object.keys(this.$auth));
8+
generateAltText({
9+
$ = this, data, ...opts
10+
}) {
11+
return axios($, {
12+
url: "https://alttextgeneratorai.com/api/wp",
13+
method: "POST",
14+
data: {
15+
...data,
16+
wpkey: `${this.$auth.api_key}`,
17+
},
18+
...opts,
19+
});
920
},
1021
},
1122
};

components/alt_text_generator_ai/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/alt_text_generator_ai",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Pipedream Alt Text Generator AI Components",
55
"main": "alt_text_generator_ai.app.mjs",
66
"keywords": [
@@ -11,5 +11,8 @@
1111
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
1212
"publishConfig": {
1313
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "^3.1.0"
1417
}
15-
}
18+
}

pnpm-lock.yaml

Lines changed: 10 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)