@agnocon/piece-bumpups 0.1.7
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/LICENSE.MIT-AP +24 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/actions/generate-creator-description.d.ts +6 -0
- package/dist/lib/actions/generate-creator-description.d.ts.map +1 -0
- package/dist/lib/actions/generate-creator-description.js +68 -0
- package/dist/lib/actions/generate-creator-description.js.map +1 -0
- package/dist/lib/actions/generate-creator-hashtags.d.ts +7 -0
- package/dist/lib/actions/generate-creator-hashtags.d.ts.map +1 -0
- package/dist/lib/actions/generate-creator-hashtags.js +79 -0
- package/dist/lib/actions/generate-creator-hashtags.js.map +1 -0
- package/dist/lib/actions/generate-creator-takeaways.d.ts +7 -0
- package/dist/lib/actions/generate-creator-takeaways.d.ts.map +1 -0
- package/dist/lib/actions/generate-creator-takeaways.js +73 -0
- package/dist/lib/actions/generate-creator-takeaways.js.map +1 -0
- package/dist/lib/actions/generate-creator-titles.d.ts +6 -0
- package/dist/lib/actions/generate-creator-titles.d.ts.map +1 -0
- package/dist/lib/actions/generate-creator-titles.js +68 -0
- package/dist/lib/actions/generate-creator-titles.js.map +1 -0
- package/dist/lib/actions/generate-timestamps.d.ts +7 -0
- package/dist/lib/actions/generate-timestamps.d.ts.map +1 -0
- package/dist/lib/actions/generate-timestamps.js +82 -0
- package/dist/lib/actions/generate-timestamps.js.map +1 -0
- package/dist/lib/actions/send-chat.d.ts +8 -0
- package/dist/lib/actions/send-chat.d.ts.map +1 -0
- package/dist/lib/actions/send-chat.js +87 -0
- package/dist/lib/actions/send-chat.js.map +1 -0
- package/dist/lib/common/auth.d.ts +2 -0
- package/dist/lib/common/auth.d.ts.map +1 -0
- package/dist/lib/common/auth.js +19 -0
- package/dist/lib/common/auth.js.map +1 -0
- package/dist/lib/common/client.d.ts +4 -0
- package/dist/lib/common/client.d.ts.map +1 -0
- package/dist/lib/common/client.js +29 -0
- package/dist/lib/common/client.js.map +1 -0
- package/package.json +46 -0
- package/src/index.ts +35 -0
- package/src/lib/actions/generate-creator-description.ts +65 -0
- package/src/lib/actions/generate-creator-hashtags.ts +79 -0
- package/src/lib/actions/generate-creator-takeaways.ts +72 -0
- package/src/lib/actions/generate-creator-titles.ts +67 -0
- package/src/lib/actions/generate-timestamps.ts +81 -0
- package/src/lib/actions/send-chat.ts +88 -0
- package/src/lib/common/auth.ts +17 -0
- package/src/lib/common/client.ts +25 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { createAction, Property } from "@agnocon/pieces-framework";
|
|
2
|
+
import { BumpupsAuth } from "../common/auth";
|
|
3
|
+
import { makeRequest } from "../common/client";
|
|
4
|
+
import { HttpMethod } from "@agnocon/pieces-common";
|
|
5
|
+
|
|
6
|
+
export const sendChat = createAction({
|
|
7
|
+
name: 'send_chat',
|
|
8
|
+
displayName: 'Send Chat',
|
|
9
|
+
description:
|
|
10
|
+
'Creates an interactive chat response for a given YouTube video using the bump-1.0 model. Provide the video URL and an optional prompt.',
|
|
11
|
+
audience: 'both',
|
|
12
|
+
aiMetadata: { description: 'Sends a question or instruction about a public YouTube video to the Bumpups chat model and returns its answer grounded in the video content, with an output-format option for plain text or markdown. Use for free-form queries about a specific video (the general-purpose option versus the fixed description/hashtags/takeaways/titles/timestamps actions); the video URL is required, while the prompt is optional and defaults to a summary if omitted (max 500 chars). Not idempotent — each call invokes the model and may produce different responses.', idempotent: false },
|
|
13
|
+
auth: BumpupsAuth,
|
|
14
|
+
props: {
|
|
15
|
+
videoUrl: Property.ShortText({
|
|
16
|
+
displayName: 'Video URL',
|
|
17
|
+
description: 'The YouTube video URL.',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
model: Property.StaticDropdown({
|
|
21
|
+
displayName: 'Model',
|
|
22
|
+
required: true,
|
|
23
|
+
defaultValue: 'bump-1.0',
|
|
24
|
+
options: {
|
|
25
|
+
disabled: false,
|
|
26
|
+
options: [
|
|
27
|
+
{ label: 'bump-1.0', value: 'bump-1.0' },
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
}),
|
|
31
|
+
prompt: Property.LongText({
|
|
32
|
+
displayName: 'Prompt',
|
|
33
|
+
description:
|
|
34
|
+
'Message or query about the video (max 500 chars). If empty, defaults to "summary".',
|
|
35
|
+
required: false,
|
|
36
|
+
}),
|
|
37
|
+
language: Property.StaticDropdown({
|
|
38
|
+
displayName: 'Language',
|
|
39
|
+
required: false,
|
|
40
|
+
defaultValue: 'en',
|
|
41
|
+
options: {
|
|
42
|
+
disabled: false,
|
|
43
|
+
options: [
|
|
44
|
+
{ label: 'English (en)', value: 'en' },
|
|
45
|
+
{ label: 'Hindi (hi)', value: 'hi' },
|
|
46
|
+
{ label: 'Spanish (es)', value: 'es' },
|
|
47
|
+
{ label: 'Portuguese (pt)', value: 'pt' },
|
|
48
|
+
{ label: 'Russian (ru)', value: 'ru' },
|
|
49
|
+
{ label: 'German (de)', value: 'de' },
|
|
50
|
+
{ label: 'French (fr)', value: 'fr' },
|
|
51
|
+
{ label: 'Japanese (ja)', value: 'ja' },
|
|
52
|
+
{ label: 'Korean (ko)', value: 'ko' },
|
|
53
|
+
{ label: 'Arabic (ar)', value: 'ar' },
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
}),
|
|
57
|
+
output_format: Property.StaticDropdown({
|
|
58
|
+
displayName: 'Output Format',
|
|
59
|
+
required: false,
|
|
60
|
+
defaultValue: 'text',
|
|
61
|
+
options: {
|
|
62
|
+
disabled: false,
|
|
63
|
+
options: [
|
|
64
|
+
{ label: 'Text', value: 'text' },
|
|
65
|
+
{ label: 'Markdown', value: 'markdown' },
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
}),
|
|
69
|
+
},
|
|
70
|
+
async run({ auth, propsValue }) {
|
|
71
|
+
const body = {
|
|
72
|
+
url: propsValue.videoUrl,
|
|
73
|
+
model: propsValue.model,
|
|
74
|
+
prompt: propsValue.prompt || 'summary',
|
|
75
|
+
language: propsValue.language || 'en',
|
|
76
|
+
output_format: propsValue.output_format || 'text',
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const response = await makeRequest(
|
|
80
|
+
auth.secret_text,
|
|
81
|
+
HttpMethod.POST,
|
|
82
|
+
'/chat',
|
|
83
|
+
body
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
return response;
|
|
87
|
+
},
|
|
88
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PieceAuth } from "@agnocon/pieces-framework";
|
|
2
|
+
import { makeRequest } from "./client";
|
|
3
|
+
import { HttpMethod } from "@agnocon/pieces-common";
|
|
4
|
+
|
|
5
|
+
export const BumpupsAuth = PieceAuth.SecretText({
|
|
6
|
+
displayName: 'Bumpups API Key',
|
|
7
|
+
description: `**Enter your Bumpups API Key.**
|
|
8
|
+
---
|
|
9
|
+
### How to obtain your API key
|
|
10
|
+
1. Sign up or log in at [bumpups.com](https://bumpups.com).
|
|
11
|
+
2. Go to **Settings** → **API**.
|
|
12
|
+
3. Enable API access and generate a key.
|
|
13
|
+
4. Copy and paste it here.
|
|
14
|
+
`,
|
|
15
|
+
required: true,
|
|
16
|
+
|
|
17
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { HttpMethod, httpClient } from '@agnocon/pieces-common';
|
|
2
|
+
|
|
3
|
+
export const BASE_URL = `https://api.bumpups.com`;
|
|
4
|
+
|
|
5
|
+
export async function makeRequest(
|
|
6
|
+
apiKey: string,
|
|
7
|
+
method: HttpMethod,
|
|
8
|
+
path: string,
|
|
9
|
+
body?: unknown
|
|
10
|
+
) {
|
|
11
|
+
try {
|
|
12
|
+
const response = await httpClient.sendRequest({
|
|
13
|
+
method,
|
|
14
|
+
url: `${BASE_URL}${path}`,
|
|
15
|
+
headers: {
|
|
16
|
+
'X-Api-Key': apiKey,
|
|
17
|
+
'Content-Type': 'application/json',
|
|
18
|
+
},
|
|
19
|
+
body,
|
|
20
|
+
});
|
|
21
|
+
return response.body;
|
|
22
|
+
} catch (error: any) {
|
|
23
|
+
throw new Error(`Unexpected error: ${error.message || String(error)}`);
|
|
24
|
+
}
|
|
25
|
+
}
|