@gpt-core/client 1.0.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 +64 -0
- package/dist/index.d.mts +13412 -0
- package/dist/index.d.ts +13412 -0
- package/dist/index.js +2064 -0
- package/dist/index.mjs +1986 -0
- package/package.json +43 -0
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# @gpt-core/client
|
|
2
|
+
|
|
3
|
+
The official TypeScript Client SDK for the GPT Core Platform.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @gpt-core/client
|
|
9
|
+
# or
|
|
10
|
+
yarn add @gpt-core/client
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { GptClient } from '@gpt-core/client';
|
|
17
|
+
|
|
18
|
+
const client = new GptClient({
|
|
19
|
+
baseUrl: 'https://api.gpt-core.com',
|
|
20
|
+
apiKey: 'your-public-key', // Optional for some endpoints
|
|
21
|
+
token: 'user-jwt-token', // Optional for authenticated endpoints
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// Authenticate
|
|
25
|
+
const { user, token } = await client.identity.login('user@example.com', 'password');
|
|
26
|
+
console.log(`Welcome, ${user.attributes.full_name}`);
|
|
27
|
+
|
|
28
|
+
// Search AI
|
|
29
|
+
const results = await client.ai.search('quarterly earnings');
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Features
|
|
33
|
+
|
|
34
|
+
- **Typed Inputs & Outputs**: Fully typed request/response bodies generated from OpenAPI specs.
|
|
35
|
+
- **Auto-Unwrapping**: Automatically handles JSON:API envelopes (`data: { type: ..., attributes: ... }`) so you get clean objects.
|
|
36
|
+
- **Modular**: Grouped by domain (`identity`, `platform`, `ai`, `extraction`, `billing`).
|
|
37
|
+
|
|
38
|
+
## Domains
|
|
39
|
+
|
|
40
|
+
### Identity
|
|
41
|
+
Manage users, profiles, and API keys.
|
|
42
|
+
```typescript
|
|
43
|
+
await client.identity.me();
|
|
44
|
+
await client.identity.apiKeys.create('My Key');
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Platform
|
|
48
|
+
Manage applications, workspaces, and tenants.
|
|
49
|
+
```typescript
|
|
50
|
+
await client.platform.applications.list();
|
|
51
|
+
await client.platform.workspaces.create('New Workspace');
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### AI
|
|
55
|
+
Interact with Agents, Threads, and semantic search.
|
|
56
|
+
```typescript
|
|
57
|
+
await client.ai.threads.sendMessage('thread-id', 'Hello AI');
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Extraction & Storage
|
|
61
|
+
Upload documents and manage files.
|
|
62
|
+
```typescript
|
|
63
|
+
await client.extraction.documents.uploadBase64('file.pdf', 'base64string...');
|
|
64
|
+
```
|