epist 0.1.1 → 1.2.1
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/README.md +4 -0
- package/dist/cjs/index.d.ts +9 -0
- package/dist/cjs/index.js +21 -0
- package/dist/esm/index.js +21 -0
- package/package.json +1 -1
- package/src/index.ts +33 -0
package/README.md
CHANGED
|
@@ -23,6 +23,10 @@ const client = new Epist({
|
|
|
23
23
|
const audio = await client.uploadFile(file);
|
|
24
24
|
console.log(`Processing: ${audio.id}`);
|
|
25
25
|
|
|
26
|
+
// 2. Ingest entire RSS Feed (Beta)
|
|
27
|
+
const feed = await client.ingestRss("https://podcast.rss/feed.xml");
|
|
28
|
+
console.log(`Feed synced: ${feed.name}`);
|
|
29
|
+
|
|
26
30
|
// 2. Semantic Search
|
|
27
31
|
const results = await client.search('What were the key takeaways?');
|
|
28
32
|
results.forEach(res => {
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -59,4 +59,13 @@ export declare class Epist {
|
|
|
59
59
|
* Search the knowledge base
|
|
60
60
|
*/
|
|
61
61
|
search(query: string, limit?: number, options?: Record<string, any>): Promise<SearchResult[]>;
|
|
62
|
+
/**
|
|
63
|
+
* Ingest a podcast RSS feed
|
|
64
|
+
*/
|
|
65
|
+
ingestRss(url: string, name?: string, refreshIntervalMinutes?: number, options?: {
|
|
66
|
+
max_episodes?: number;
|
|
67
|
+
start_date?: string;
|
|
68
|
+
include_keywords?: string;
|
|
69
|
+
exclude_keywords?: string;
|
|
70
|
+
}): Promise<any>;
|
|
62
71
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -121,5 +121,26 @@ class Epist {
|
|
|
121
121
|
throw error;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Ingest a podcast RSS feed
|
|
126
|
+
*/
|
|
127
|
+
async ingestRss(url, name, refreshIntervalMinutes, options) {
|
|
128
|
+
try {
|
|
129
|
+
const payload = {
|
|
130
|
+
url,
|
|
131
|
+
name,
|
|
132
|
+
refresh_interval_minutes: refreshIntervalMinutes,
|
|
133
|
+
...options
|
|
134
|
+
};
|
|
135
|
+
// Filter undefined values
|
|
136
|
+
Object.keys(payload).forEach(key => payload[key] === undefined && delete payload[key]);
|
|
137
|
+
const response = await this.client.post('/ingest/rss', payload);
|
|
138
|
+
return response.data;
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
this.handleError(error);
|
|
142
|
+
throw error;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
124
145
|
}
|
|
125
146
|
exports.Epist = Epist;
|
package/dist/esm/index.js
CHANGED
|
@@ -114,4 +114,25 @@ export class Epist {
|
|
|
114
114
|
throw error;
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Ingest a podcast RSS feed
|
|
119
|
+
*/
|
|
120
|
+
async ingestRss(url, name, refreshIntervalMinutes, options) {
|
|
121
|
+
try {
|
|
122
|
+
const payload = {
|
|
123
|
+
url,
|
|
124
|
+
name,
|
|
125
|
+
refresh_interval_minutes: refreshIntervalMinutes,
|
|
126
|
+
...options
|
|
127
|
+
};
|
|
128
|
+
// Filter undefined values
|
|
129
|
+
Object.keys(payload).forEach(key => payload[key] === undefined && delete payload[key]);
|
|
130
|
+
const response = await this.client.post('/ingest/rss', payload);
|
|
131
|
+
return response.data;
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
this.handleError(error);
|
|
135
|
+
throw error;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
117
138
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -160,5 +160,38 @@ export class Epist {
|
|
|
160
160
|
throw error;
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Ingest a podcast RSS feed
|
|
166
|
+
*/
|
|
167
|
+
async ingestRss(
|
|
168
|
+
url: string,
|
|
169
|
+
name?: string,
|
|
170
|
+
refreshIntervalMinutes?: number,
|
|
171
|
+
options?: {
|
|
172
|
+
max_episodes?: number;
|
|
173
|
+
start_date?: string;
|
|
174
|
+
include_keywords?: string;
|
|
175
|
+
exclude_keywords?: string;
|
|
176
|
+
}
|
|
177
|
+
): Promise<any> {
|
|
178
|
+
try {
|
|
179
|
+
const payload: any = {
|
|
180
|
+
url,
|
|
181
|
+
name,
|
|
182
|
+
refresh_interval_minutes: refreshIntervalMinutes,
|
|
183
|
+
...options
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
// Filter undefined values
|
|
187
|
+
Object.keys(payload).forEach(key => payload[key] === undefined && delete payload[key]);
|
|
188
|
+
|
|
189
|
+
const response = await this.client.post('/ingest/rss', payload);
|
|
190
|
+
return response.data;
|
|
191
|
+
} catch (error) {
|
|
192
|
+
this.handleError(error);
|
|
193
|
+
throw error;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
163
196
|
}
|
|
164
197
|
|