@sybil-studio-devs/sdk 0.1.0
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 +244 -0
- package/dist/index.d.mts +396 -0
- package/dist/index.d.ts +396 -0
- package/dist/index.js +287 -0
- package/dist/index.mjs +259 -0
- package/package.json +58 -0
package/README.md
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# @sybil-studio/sdk
|
|
2
|
+
|
|
3
|
+
Official TypeScript/JavaScript SDK for Sybil AI - Document processing, YouTube analysis, and AI-powered knowledge management.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# npm
|
|
9
|
+
npm install @sybil-studio/sdk
|
|
10
|
+
|
|
11
|
+
# pnpm
|
|
12
|
+
pnpm add @sybil-studio/sdk
|
|
13
|
+
|
|
14
|
+
# yarn
|
|
15
|
+
yarn add @sybil-studio/sdk
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import { SybilSDK } from '@sybil-studio/sdk';
|
|
22
|
+
|
|
23
|
+
const sybil = new SybilSDK('sk_live_YOUR_API_KEY');
|
|
24
|
+
|
|
25
|
+
// Process a YouTube video
|
|
26
|
+
const video = await sybil.youtube.process('https://youtube.com/watch?v=...');
|
|
27
|
+
|
|
28
|
+
// Chat with a document
|
|
29
|
+
const response = await sybil.chat.send(video.document.id, 'Summarize the main points');
|
|
30
|
+
|
|
31
|
+
// Create a page
|
|
32
|
+
const page = await sybil.pages.create({
|
|
33
|
+
title: 'My Notes',
|
|
34
|
+
blocks: [
|
|
35
|
+
{ type: 'paragraph', content: [{ type: 'text', text: 'Hello world' }] }
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Configuration
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
// Simple - just API key (uses default base URL)
|
|
44
|
+
const sybil = new SybilSDK('sk_live_YOUR_API_KEY');
|
|
45
|
+
|
|
46
|
+
// Full configuration
|
|
47
|
+
const sybil = new SybilSDK({
|
|
48
|
+
apiKey: 'sk_live_YOUR_API_KEY',
|
|
49
|
+
baseUrl: 'https://your-domain.com/api/sdk/v1', // Optional
|
|
50
|
+
timeout: 30000, // Optional, in milliseconds
|
|
51
|
+
});
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## API Reference
|
|
55
|
+
|
|
56
|
+
### Pages
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
// List pages
|
|
60
|
+
const { pages, pagination } = await sybil.pages.list({
|
|
61
|
+
limit: 20,
|
|
62
|
+
offset: 0,
|
|
63
|
+
parent_id: 'root', // or specific page ID
|
|
64
|
+
is_published: true
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// Create page
|
|
68
|
+
const { page } = await sybil.pages.create({
|
|
69
|
+
title: 'New Page',
|
|
70
|
+
description: 'Optional description',
|
|
71
|
+
blocks: [
|
|
72
|
+
{ type: 'heading', attrs: { level: 1 }, content: [{ type: 'text', text: 'Title' }] },
|
|
73
|
+
{ type: 'paragraph', content: [{ type: 'text', text: 'Content here' }] },
|
|
74
|
+
{ type: 'image', attrs: { src: 'https://...' } }
|
|
75
|
+
],
|
|
76
|
+
parent_id: 'optional-parent-uuid'
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// Get page
|
|
80
|
+
const { page } = await sybil.pages.get('page-id');
|
|
81
|
+
|
|
82
|
+
// Update page
|
|
83
|
+
const { page } = await sybil.pages.update('page-id', {
|
|
84
|
+
title: 'Updated Title',
|
|
85
|
+
blocks: [...],
|
|
86
|
+
is_published: true
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// Delete page
|
|
90
|
+
await sybil.pages.delete('page-id');
|
|
91
|
+
|
|
92
|
+
// Upload file (for use in pages)
|
|
93
|
+
const upload = await sybil.pages.upload(file);
|
|
94
|
+
console.log(upload.url); // Use this URL in image blocks
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Documents
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
// Process a document
|
|
101
|
+
const result = await sybil.documents.process(file, {
|
|
102
|
+
fileName: 'document.pdf',
|
|
103
|
+
metadata: { category: 'reports' }
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
// Check processing status
|
|
107
|
+
const status = await sybil.documents.status(result.documentId);
|
|
108
|
+
|
|
109
|
+
// Wait for processing to complete (polling)
|
|
110
|
+
const document = await sybil.documents.waitForProcessing(result.documentId, {
|
|
111
|
+
maxAttempts: 60,
|
|
112
|
+
interval: 3000
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// List documents
|
|
116
|
+
const { documents, pagination } = await sybil.documents.list({
|
|
117
|
+
status: 'processed',
|
|
118
|
+
fileType: 'application/pdf',
|
|
119
|
+
search: 'quarterly report'
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
// Get document with content
|
|
123
|
+
const { document } = await sybil.documents.get('doc-id', {
|
|
124
|
+
includeContent: true,
|
|
125
|
+
includeInsights: true
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
// Get document insights
|
|
129
|
+
const { insights, semanticAnalysis } = await sybil.documents.insights('doc-id');
|
|
130
|
+
|
|
131
|
+
// Delete document
|
|
132
|
+
await sybil.documents.delete('doc-id');
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### YouTube
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
// Process YouTube video
|
|
139
|
+
const result = await sybil.youtube.process('https://youtube.com/watch?v=...');
|
|
140
|
+
|
|
141
|
+
// List processed videos
|
|
142
|
+
const { videos } = await sybil.youtube.list({ limit: 20 });
|
|
143
|
+
|
|
144
|
+
// Get video details with transcript
|
|
145
|
+
const { video } = await sybil.youtube.get('VIDEO_ID', {
|
|
146
|
+
includeTranscript: true,
|
|
147
|
+
includeChunks: true
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
// Delete video
|
|
151
|
+
await sybil.youtube.delete('VIDEO_ID');
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Chat (RAG)
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
// Simple chat
|
|
158
|
+
const result = await sybil.chat.send('document-id', 'What are the key findings?');
|
|
159
|
+
|
|
160
|
+
// Chat with options
|
|
161
|
+
const result = await sybil.chat.send({
|
|
162
|
+
documentId: 'document-id',
|
|
163
|
+
query: 'Explain the methodology',
|
|
164
|
+
conversationHistory: [
|
|
165
|
+
{ role: 'user', content: 'Previous question' },
|
|
166
|
+
{ role: 'assistant', content: 'Previous answer' }
|
|
167
|
+
],
|
|
168
|
+
searchConfig: {
|
|
169
|
+
semanticWeight: 0.4,
|
|
170
|
+
maxResults: 15
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
console.log(result.response);
|
|
175
|
+
console.log(result.sources); // Relevant passages
|
|
176
|
+
console.log(result.metadata.confidence);
|
|
177
|
+
|
|
178
|
+
// Get chat history
|
|
179
|
+
const { history } = await sybil.chat.history('document-id', 50);
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Analysis
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
// Run RAG analysis
|
|
186
|
+
const result = await sybil.analyze.run('document-id');
|
|
187
|
+
|
|
188
|
+
// Force refresh
|
|
189
|
+
const result = await sybil.analyze.run('document-id', true);
|
|
190
|
+
|
|
191
|
+
// Get existing analysis (no regeneration)
|
|
192
|
+
const result = await sybil.analyze.get('document-id');
|
|
193
|
+
|
|
194
|
+
console.log(result.analysis);
|
|
195
|
+
console.log(result.cached); // true if from cache
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Error Handling
|
|
199
|
+
|
|
200
|
+
```typescript
|
|
201
|
+
import { SybilSDK, SybilError } from '@sybil-studio/sdk';
|
|
202
|
+
|
|
203
|
+
try {
|
|
204
|
+
const result = await sybil.youtube.process('invalid-url');
|
|
205
|
+
} catch (error) {
|
|
206
|
+
if (error instanceof SybilError) {
|
|
207
|
+
console.error(`Error ${error.status}: ${error.message}`);
|
|
208
|
+
console.error(`Code: ${error.code}`);
|
|
209
|
+
|
|
210
|
+
if (error.status === 429) {
|
|
211
|
+
// Rate limited - wait and retry
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## TypeScript Types
|
|
218
|
+
|
|
219
|
+
All types are exported for use in your application:
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
import type {
|
|
223
|
+
Page,
|
|
224
|
+
Document,
|
|
225
|
+
YouTubeVideo,
|
|
226
|
+
ChatResult,
|
|
227
|
+
Insight,
|
|
228
|
+
Block,
|
|
229
|
+
DocumentStatus,
|
|
230
|
+
// ... and more
|
|
231
|
+
} from '@sybil-studio/sdk';
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Browser & Node.js Support
|
|
235
|
+
|
|
236
|
+
This SDK works in both browser and Node.js environments. It uses the native `fetch` API, which is available in:
|
|
237
|
+
- Modern browsers
|
|
238
|
+
- Node.js 18+
|
|
239
|
+
|
|
240
|
+
For older Node.js versions, you may need a `fetch` polyfill.
|
|
241
|
+
|
|
242
|
+
## License
|
|
243
|
+
|
|
244
|
+
MIT
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
interface SybilConfig {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
baseUrl?: string;
|
|
4
|
+
timeout?: number;
|
|
5
|
+
}
|
|
6
|
+
interface RateLimitInfo {
|
|
7
|
+
limit: number;
|
|
8
|
+
remaining: number;
|
|
9
|
+
resetAt: string;
|
|
10
|
+
}
|
|
11
|
+
interface ApiResponse<T> {
|
|
12
|
+
data: T;
|
|
13
|
+
meta?: {
|
|
14
|
+
rateLimit?: RateLimitInfo;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
interface ApiError {
|
|
18
|
+
error: {
|
|
19
|
+
message: string;
|
|
20
|
+
code?: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
interface PaginationParams {
|
|
24
|
+
limit?: number;
|
|
25
|
+
offset?: number;
|
|
26
|
+
}
|
|
27
|
+
interface Pagination {
|
|
28
|
+
total: number;
|
|
29
|
+
limit: number;
|
|
30
|
+
offset: number;
|
|
31
|
+
hasMore: boolean;
|
|
32
|
+
}
|
|
33
|
+
interface Block {
|
|
34
|
+
type: string;
|
|
35
|
+
content?: Array<{
|
|
36
|
+
type: string;
|
|
37
|
+
text?: string;
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
}>;
|
|
40
|
+
attrs?: Record<string, any>;
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
}
|
|
43
|
+
interface Page {
|
|
44
|
+
id: string;
|
|
45
|
+
title: string;
|
|
46
|
+
slug: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
blocks: Block[];
|
|
49
|
+
artifact_map?: Record<string, any>;
|
|
50
|
+
parent_id?: string | null;
|
|
51
|
+
is_published: boolean;
|
|
52
|
+
is_template: boolean;
|
|
53
|
+
version: number;
|
|
54
|
+
created_at: string;
|
|
55
|
+
updated_at: string;
|
|
56
|
+
metadata?: Record<string, any>;
|
|
57
|
+
}
|
|
58
|
+
interface CreatePageParams {
|
|
59
|
+
title?: string;
|
|
60
|
+
slug?: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
blocks?: Block[];
|
|
63
|
+
parent_id?: string;
|
|
64
|
+
}
|
|
65
|
+
interface UpdatePageParams {
|
|
66
|
+
title?: string;
|
|
67
|
+
slug?: string;
|
|
68
|
+
description?: string | null;
|
|
69
|
+
blocks?: Block[];
|
|
70
|
+
is_published?: boolean;
|
|
71
|
+
parent_id?: string | null;
|
|
72
|
+
}
|
|
73
|
+
interface ListPagesParams extends PaginationParams {
|
|
74
|
+
parent_id?: string | 'root';
|
|
75
|
+
is_published?: boolean;
|
|
76
|
+
}
|
|
77
|
+
interface UploadResult {
|
|
78
|
+
url: string;
|
|
79
|
+
fileName: string;
|
|
80
|
+
fileSize: number;
|
|
81
|
+
mimeType: string;
|
|
82
|
+
path: string;
|
|
83
|
+
}
|
|
84
|
+
interface Document {
|
|
85
|
+
id: string;
|
|
86
|
+
title: string;
|
|
87
|
+
fileName: string;
|
|
88
|
+
fileType: string;
|
|
89
|
+
mimeType?: string;
|
|
90
|
+
fileSize: number;
|
|
91
|
+
status: DocumentStatus;
|
|
92
|
+
sourceUrl?: string;
|
|
93
|
+
sourceType?: string;
|
|
94
|
+
content?: string;
|
|
95
|
+
contentPreview?: string;
|
|
96
|
+
insights?: Insight[];
|
|
97
|
+
metadata?: DocumentMetadata;
|
|
98
|
+
createdAt: string;
|
|
99
|
+
updatedAt: string;
|
|
100
|
+
processedAt?: string;
|
|
101
|
+
}
|
|
102
|
+
type DocumentStatus = 'pending' | 'uploading' | 'processing' | 'extracting' | 'indexing' | 'processed' | 'completed' | 'failed';
|
|
103
|
+
interface DocumentMetadata {
|
|
104
|
+
title?: string;
|
|
105
|
+
fileName?: string;
|
|
106
|
+
fileType?: string;
|
|
107
|
+
fileSize?: number;
|
|
108
|
+
documentType?: string;
|
|
109
|
+
category?: string;
|
|
110
|
+
keywords?: string[];
|
|
111
|
+
language?: string;
|
|
112
|
+
pageCount?: number;
|
|
113
|
+
wordCount?: number;
|
|
114
|
+
hasTranscript?: boolean;
|
|
115
|
+
semanticAnalysis?: SemanticAnalysis;
|
|
116
|
+
}
|
|
117
|
+
interface SemanticAnalysis {
|
|
118
|
+
topics?: string[];
|
|
119
|
+
entities?: Record<string, any[]>;
|
|
120
|
+
keyphrases?: string[];
|
|
121
|
+
domainTerms?: string[];
|
|
122
|
+
}
|
|
123
|
+
interface Insight {
|
|
124
|
+
id: string;
|
|
125
|
+
type: string;
|
|
126
|
+
title?: string;
|
|
127
|
+
content: string;
|
|
128
|
+
confidence?: number;
|
|
129
|
+
data?: any;
|
|
130
|
+
created_at?: string;
|
|
131
|
+
}
|
|
132
|
+
interface ProcessDocumentResult {
|
|
133
|
+
success: boolean;
|
|
134
|
+
documentId: string;
|
|
135
|
+
status: DocumentStatus;
|
|
136
|
+
message: string;
|
|
137
|
+
metadata: DocumentMetadata;
|
|
138
|
+
contentPreview?: string;
|
|
139
|
+
insights: Insight[];
|
|
140
|
+
processingTime: number;
|
|
141
|
+
}
|
|
142
|
+
interface DocumentStatusResult {
|
|
143
|
+
documentId: string;
|
|
144
|
+
status: DocumentStatus;
|
|
145
|
+
progress: number;
|
|
146
|
+
message: string;
|
|
147
|
+
startedAt?: string;
|
|
148
|
+
completedAt?: string;
|
|
149
|
+
error?: any;
|
|
150
|
+
hasInsights: boolean;
|
|
151
|
+
insightsCount: number;
|
|
152
|
+
}
|
|
153
|
+
interface ListDocumentsParams extends PaginationParams {
|
|
154
|
+
status?: DocumentStatus;
|
|
155
|
+
fileType?: string;
|
|
156
|
+
search?: string;
|
|
157
|
+
}
|
|
158
|
+
interface GetDocumentParams {
|
|
159
|
+
includeContent?: boolean;
|
|
160
|
+
includeInsights?: boolean;
|
|
161
|
+
includeMetadata?: boolean;
|
|
162
|
+
}
|
|
163
|
+
interface YouTubeVideo {
|
|
164
|
+
id: string;
|
|
165
|
+
videoId: string;
|
|
166
|
+
documentId: string;
|
|
167
|
+
title: string;
|
|
168
|
+
description?: string;
|
|
169
|
+
channelTitle: string;
|
|
170
|
+
channelId: string;
|
|
171
|
+
tags?: string[];
|
|
172
|
+
publishedAt: string;
|
|
173
|
+
duration: string;
|
|
174
|
+
viewCount: number;
|
|
175
|
+
likeCount: number;
|
|
176
|
+
commentCount: number;
|
|
177
|
+
thumbnailUrl: string;
|
|
178
|
+
transcriptAvailable: boolean;
|
|
179
|
+
transcriptLanguage?: string;
|
|
180
|
+
wordCount: number;
|
|
181
|
+
readingTime: number;
|
|
182
|
+
createdAt: string;
|
|
183
|
+
updatedAt: string;
|
|
184
|
+
}
|
|
185
|
+
interface ProcessYouTubeResult {
|
|
186
|
+
status: 'success' | 'exists';
|
|
187
|
+
document: {
|
|
188
|
+
id: string;
|
|
189
|
+
title: string;
|
|
190
|
+
workspace_id: string;
|
|
191
|
+
source_url: string;
|
|
192
|
+
created_at: string;
|
|
193
|
+
};
|
|
194
|
+
video: {
|
|
195
|
+
videoId: string;
|
|
196
|
+
title: string;
|
|
197
|
+
channelTitle: string;
|
|
198
|
+
duration: string;
|
|
199
|
+
viewCount: number;
|
|
200
|
+
hasTranscript: boolean;
|
|
201
|
+
};
|
|
202
|
+
transcript: {
|
|
203
|
+
available: boolean;
|
|
204
|
+
wordCount: number;
|
|
205
|
+
chunkCount: number;
|
|
206
|
+
};
|
|
207
|
+
insights: {
|
|
208
|
+
count: number;
|
|
209
|
+
types: string[];
|
|
210
|
+
};
|
|
211
|
+
message: string;
|
|
212
|
+
}
|
|
213
|
+
interface GetYouTubeVideoParams {
|
|
214
|
+
includeTranscript?: boolean;
|
|
215
|
+
includeChunks?: boolean;
|
|
216
|
+
includeInsights?: boolean;
|
|
217
|
+
}
|
|
218
|
+
interface TranscriptChunk {
|
|
219
|
+
index: number;
|
|
220
|
+
startTime: number;
|
|
221
|
+
endTime: number;
|
|
222
|
+
content: string;
|
|
223
|
+
metadata?: Record<string, any>;
|
|
224
|
+
}
|
|
225
|
+
interface YouTubeVideoDetail extends YouTubeVideo {
|
|
226
|
+
transcript?: string;
|
|
227
|
+
chunks?: TranscriptChunk[];
|
|
228
|
+
insights?: Insight[];
|
|
229
|
+
semanticAnalysis?: SemanticAnalysis;
|
|
230
|
+
}
|
|
231
|
+
interface ChatMessage {
|
|
232
|
+
role: 'user' | 'assistant';
|
|
233
|
+
content: string;
|
|
234
|
+
}
|
|
235
|
+
interface ChatParams {
|
|
236
|
+
query: string;
|
|
237
|
+
documentId: string;
|
|
238
|
+
conversationHistory?: ChatMessage[];
|
|
239
|
+
searchConfig?: {
|
|
240
|
+
semanticWeight?: number;
|
|
241
|
+
keywordWeight?: number;
|
|
242
|
+
maxResults?: number;
|
|
243
|
+
confidenceThreshold?: number;
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
interface ChatSource {
|
|
247
|
+
content: string;
|
|
248
|
+
similarity: number;
|
|
249
|
+
metadata?: Record<string, any>;
|
|
250
|
+
}
|
|
251
|
+
interface ChatResult {
|
|
252
|
+
response: string;
|
|
253
|
+
sources: ChatSource[];
|
|
254
|
+
metadata: {
|
|
255
|
+
documentId: string;
|
|
256
|
+
documentTitle: string;
|
|
257
|
+
sourcesCount: number;
|
|
258
|
+
confidence: number;
|
|
259
|
+
requestId: string;
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
interface ChatHistoryItem {
|
|
263
|
+
id: string;
|
|
264
|
+
query: string;
|
|
265
|
+
response: string;
|
|
266
|
+
type: string;
|
|
267
|
+
createdAt: string;
|
|
268
|
+
metadata?: Record<string, any>;
|
|
269
|
+
}
|
|
270
|
+
interface AnalyzeParams {
|
|
271
|
+
documentId: string;
|
|
272
|
+
forceRefresh?: boolean;
|
|
273
|
+
}
|
|
274
|
+
interface AnalysisResult {
|
|
275
|
+
analysis: any;
|
|
276
|
+
cached: boolean;
|
|
277
|
+
generatedAt: string;
|
|
278
|
+
document: {
|
|
279
|
+
id: string;
|
|
280
|
+
title: string;
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
declare class SybilSDK {
|
|
285
|
+
private apiKey;
|
|
286
|
+
private baseUrl;
|
|
287
|
+
private timeout;
|
|
288
|
+
pages: PagesAPI;
|
|
289
|
+
documents: DocumentsAPI;
|
|
290
|
+
youtube: YouTubeAPI;
|
|
291
|
+
chat: ChatAPI;
|
|
292
|
+
analyze: AnalyzeAPI;
|
|
293
|
+
constructor(config: string | SybilConfig);
|
|
294
|
+
request<T>(endpoint: string, options?: RequestInit): Promise<T>;
|
|
295
|
+
}
|
|
296
|
+
declare class SybilError extends Error {
|
|
297
|
+
status: number;
|
|
298
|
+
code?: string;
|
|
299
|
+
constructor(message: string, status: number, code?: string);
|
|
300
|
+
}
|
|
301
|
+
declare class PagesAPI {
|
|
302
|
+
private client;
|
|
303
|
+
constructor(client: SybilSDK);
|
|
304
|
+
list(params?: ListPagesParams): Promise<{
|
|
305
|
+
pages: Page[];
|
|
306
|
+
pagination: Pagination;
|
|
307
|
+
}>;
|
|
308
|
+
get(pageId: string): Promise<{
|
|
309
|
+
page: Page;
|
|
310
|
+
}>;
|
|
311
|
+
create(params?: CreatePageParams): Promise<{
|
|
312
|
+
page: Page;
|
|
313
|
+
}>;
|
|
314
|
+
update(pageId: string, params: UpdatePageParams): Promise<{
|
|
315
|
+
page: Page;
|
|
316
|
+
}>;
|
|
317
|
+
delete(pageId: string): Promise<{
|
|
318
|
+
success: boolean;
|
|
319
|
+
message: string;
|
|
320
|
+
}>;
|
|
321
|
+
upload(file: File | Blob, fileName?: string): Promise<UploadResult>;
|
|
322
|
+
deleteFile(filePath: string): Promise<{
|
|
323
|
+
success: boolean;
|
|
324
|
+
message: string;
|
|
325
|
+
}>;
|
|
326
|
+
}
|
|
327
|
+
declare class DocumentsAPI {
|
|
328
|
+
private client;
|
|
329
|
+
constructor(client: SybilSDK);
|
|
330
|
+
list(params?: ListDocumentsParams): Promise<{
|
|
331
|
+
documents: Document[];
|
|
332
|
+
pagination: Pagination;
|
|
333
|
+
}>;
|
|
334
|
+
get(documentId: string, params?: GetDocumentParams): Promise<{
|
|
335
|
+
document: Document;
|
|
336
|
+
}>;
|
|
337
|
+
process(file: File | Blob, options?: {
|
|
338
|
+
fileName?: string;
|
|
339
|
+
metadata?: Record<string, any>;
|
|
340
|
+
collectionId?: string;
|
|
341
|
+
}): Promise<ProcessDocumentResult>;
|
|
342
|
+
status(documentId: string): Promise<DocumentStatusResult>;
|
|
343
|
+
insights(documentId: string, type?: string): Promise<{
|
|
344
|
+
documentId: string;
|
|
345
|
+
insights: Insight[];
|
|
346
|
+
semanticAnalysis?: any;
|
|
347
|
+
}>;
|
|
348
|
+
delete(documentId: string): Promise<{
|
|
349
|
+
success: boolean;
|
|
350
|
+
message: string;
|
|
351
|
+
documentId: string;
|
|
352
|
+
}>;
|
|
353
|
+
waitForProcessing(documentId: string, options?: {
|
|
354
|
+
maxAttempts?: number;
|
|
355
|
+
interval?: number;
|
|
356
|
+
}): Promise<Document>;
|
|
357
|
+
}
|
|
358
|
+
declare class YouTubeAPI {
|
|
359
|
+
private client;
|
|
360
|
+
constructor(client: SybilSDK);
|
|
361
|
+
list(params?: {
|
|
362
|
+
limit?: number;
|
|
363
|
+
offset?: number;
|
|
364
|
+
}): Promise<{
|
|
365
|
+
videos: YouTubeVideo[];
|
|
366
|
+
pagination: Pagination;
|
|
367
|
+
}>;
|
|
368
|
+
process(url: string, collectionId?: string): Promise<ProcessYouTubeResult>;
|
|
369
|
+
get(videoId: string, params?: GetYouTubeVideoParams): Promise<{
|
|
370
|
+
video: YouTubeVideoDetail;
|
|
371
|
+
}>;
|
|
372
|
+
delete(videoId: string): Promise<{
|
|
373
|
+
success: boolean;
|
|
374
|
+
message: string;
|
|
375
|
+
videoId: string;
|
|
376
|
+
}>;
|
|
377
|
+
}
|
|
378
|
+
declare class ChatAPI {
|
|
379
|
+
private client;
|
|
380
|
+
constructor(client: SybilSDK);
|
|
381
|
+
send(params: ChatParams): Promise<ChatResult>;
|
|
382
|
+
send(documentId: string, query: string): Promise<ChatResult>;
|
|
383
|
+
history(documentId: string, limit?: number): Promise<{
|
|
384
|
+
history: ChatHistoryItem[];
|
|
385
|
+
total: number;
|
|
386
|
+
}>;
|
|
387
|
+
}
|
|
388
|
+
declare class AnalyzeAPI {
|
|
389
|
+
private client;
|
|
390
|
+
constructor(client: SybilSDK);
|
|
391
|
+
run(params: AnalyzeParams): Promise<AnalysisResult>;
|
|
392
|
+
run(documentId: string, forceRefresh?: boolean): Promise<AnalysisResult>;
|
|
393
|
+
get(documentId: string): Promise<AnalysisResult>;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export { type AnalysisResult, type AnalyzeParams, type ApiError, type ApiResponse, type Block, type ChatHistoryItem, type ChatMessage, type ChatParams, type ChatResult, type ChatSource, type CreatePageParams, type Document, type DocumentMetadata, type DocumentStatus, type DocumentStatusResult, type GetDocumentParams, type GetYouTubeVideoParams, type Insight, type ListDocumentsParams, type ListPagesParams, type Page, type Pagination, type PaginationParams, type ProcessDocumentResult, type ProcessYouTubeResult, type RateLimitInfo, type SemanticAnalysis, type SybilConfig, SybilError, SybilSDK, type TranscriptChunk, type UpdatePageParams, type UploadResult, type YouTubeVideo, type YouTubeVideoDetail, SybilSDK as default };
|