@gpt-core/client 0.8.11 → 0.8.20
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 +41 -17
- package/dist/index.d.mts +19780 -5148
- package/dist/index.d.ts +19780 -5148
- package/dist/index.js +708 -593
- package/dist/index.mjs +635 -589
- package/llms.txt +547 -0
- package/package.json +12 -3
package/README.md
CHANGED
|
@@ -6,6 +6,47 @@ The official TypeScript SDK for the GPT Core Platform - document extraction, AI
|
|
|
6
6
|
[](https://www.typescriptlang.org/)
|
|
7
7
|
[](https://opensource.org/licenses/MIT)
|
|
8
8
|
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<!-- AI_CONTEXT_START
|
|
12
|
+
This SDK provides TypeScript bindings for the GPT Core API.
|
|
13
|
+
Use this for: document extraction, AI agents, workspace management, user authentication.
|
|
14
|
+
NOT for: admin operations (use @gpt-core/admin instead).
|
|
15
|
+
|
|
16
|
+
Quick patterns:
|
|
17
|
+
- Initialize: new GptClient({ baseUrl, apiKey?, token? })
|
|
18
|
+
- Auth: client.identity.login(email, password) -> { user, token }
|
|
19
|
+
- Documents: client.extraction.documents.uploadBase64(filename, base64)
|
|
20
|
+
- AI Search: client.ai.search(query, limit?)
|
|
21
|
+
- Agents: client.ai.agents.list() / .create(name, systemPrompt)
|
|
22
|
+
- Workspaces: client.platform.workspaces.mine()
|
|
23
|
+
|
|
24
|
+
All methods return typed responses. Errors throw typed exceptions (AuthenticationError, ValidationError, etc).
|
|
25
|
+
AI_CONTEXT_END -->
|
|
26
|
+
|
|
27
|
+
## For AI Coding Assistants
|
|
28
|
+
|
|
29
|
+
> **TL;DR for Claude, Cursor, Copilot, and other AI assistants:**
|
|
30
|
+
>
|
|
31
|
+
> ```typescript
|
|
32
|
+
> import { GptClient } from '@gpt-core/client';
|
|
33
|
+
> const client = new GptClient({ baseUrl: 'https://api.example.com', token: 'jwt' });
|
|
34
|
+
> ```
|
|
35
|
+
>
|
|
36
|
+
> **Common operations:**
|
|
37
|
+
> | Task | Code |
|
|
38
|
+
> |------|------|
|
|
39
|
+
> | Login | `await client.identity.login(email, password)` |
|
|
40
|
+
> | List workspaces | `await client.platform.workspaces.mine()` |
|
|
41
|
+
> | Upload document | `await client.extraction.documents.uploadBase64(name, b64)` |
|
|
42
|
+
> | AI search | `await client.ai.search(query)` |
|
|
43
|
+
> | Create agent | `await client.ai.agents.create(name, systemPrompt)` |
|
|
44
|
+
> | Send message | `await client.ai.threads.sendMessage(threadId, content)` |
|
|
45
|
+
>
|
|
46
|
+
> **See [llms.txt](llms.txt) for complete AI-readable SDK reference.**
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
9
50
|
## Features
|
|
10
51
|
|
|
11
52
|
✅ **Fully Typed** - Complete TypeScript support with auto-generated types from OpenAPI specs
|
|
@@ -242,8 +283,6 @@ try {
|
|
|
242
283
|
}
|
|
243
284
|
```
|
|
244
285
|
|
|
245
|
-
[Read more about error handling](docs/ERROR_HANDLING.md)
|
|
246
|
-
|
|
247
286
|
### Pagination
|
|
248
287
|
|
|
249
288
|
Easily iterate over large datasets:
|
|
@@ -262,8 +301,6 @@ for await (const doc of client.extraction.documents.listAll({ limit: 100 })) {
|
|
|
262
301
|
}
|
|
263
302
|
```
|
|
264
303
|
|
|
265
|
-
[Read more about pagination](docs/PAGINATION.md)
|
|
266
|
-
|
|
267
304
|
### Streaming
|
|
268
305
|
|
|
269
306
|
Stream AI responses in real-time:
|
|
@@ -286,8 +323,6 @@ for await (const chunk of streamMessage(response)) {
|
|
|
286
323
|
}
|
|
287
324
|
```
|
|
288
325
|
|
|
289
|
-
[Read more about streaming](docs/STREAMING.md)
|
|
290
|
-
|
|
291
326
|
### Retry Logic
|
|
292
327
|
|
|
293
328
|
Automatic retries with exponential backoff:
|
|
@@ -311,13 +346,6 @@ const noRetryClient = new GptClient({
|
|
|
311
346
|
});
|
|
312
347
|
```
|
|
313
348
|
|
|
314
|
-
## Guides
|
|
315
|
-
|
|
316
|
-
- [Authentication Guide](docs/AUTHENTICATION.md)
|
|
317
|
-
- [Error Handling Guide](docs/ERROR_HANDLING.md)
|
|
318
|
-
- [Pagination Guide](docs/PAGINATION.md)
|
|
319
|
-
- [Streaming Guide](docs/STREAMING.md)
|
|
320
|
-
|
|
321
349
|
## TypeScript Support
|
|
322
350
|
|
|
323
351
|
The SDK is written in TypeScript and provides full type safety:
|
|
@@ -332,10 +360,6 @@ const workspace: workspace = await client.platform.workspaces.create('Test');
|
|
|
332
360
|
// TypeScript enforces correct parameters
|
|
333
361
|
```
|
|
334
362
|
|
|
335
|
-
## Contributing
|
|
336
|
-
|
|
337
|
-
Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md).
|
|
338
|
-
|
|
339
363
|
## License
|
|
340
364
|
|
|
341
365
|
MIT © GPT Integrators
|