tekimax-ts 0.1.6 → 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/README.md +36 -103
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,23 +1,12 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<img src="./public/logos/tekimax-logo-ScreenRGB-2.png" alt="Tekimax SDK Logo" width="200" />
|
|
3
|
-
<h1>
|
|
3
|
+
<h1>TEKIMAX SDK Typescript</h1>
|
|
4
4
|
<p><strong>Type-safe Tekimax Client for Node.js, Browser, and Edge.</strong></p>
|
|
5
5
|
|
|
6
6
|
[](https://www.npmjs.com/package/tekimax-ts)
|
|
7
7
|
[](https://opensource.org/licenses/MIT)
|
|
8
8
|
</div>
|
|
9
9
|
|
|
10
|
-
## 📖 Overview
|
|
11
|
-
|
|
12
|
-
The **Tekimax TypeScript SDK** provides fully typed interfaces for the Tekimax API. Generated via [Kubb](https://kubb.dev/), it ensures your application stays in sync with the latest API definitions.
|
|
13
|
-
|
|
14
|
-
## ✨ Features
|
|
15
|
-
|
|
16
|
-
- **Full TypeScript Support**: strict typing for all API request/response bodies.
|
|
17
|
-
- **Runtime Validation**: Optional Zod schemas for validating data at runtime.
|
|
18
|
-
- **Universal**: Works in Node.js, React/Vite/Next.js, and Cloudflare Workers.
|
|
19
|
-
- **Tree-Shakeable**: Import only what you need.
|
|
20
|
-
|
|
21
10
|
## 📦 Installation
|
|
22
11
|
|
|
23
12
|
```bash
|
|
@@ -26,117 +15,61 @@ npm install tekimax-ts
|
|
|
26
15
|
|
|
27
16
|
## 💻 Usage
|
|
28
17
|
|
|
29
|
-
|
|
18
|
+
The SDK provides a `TekimaxClient` that manages authentication, session state, and response parsing.
|
|
30
19
|
|
|
31
20
|
```typescript
|
|
32
|
-
import {
|
|
33
|
-
UserMessageItemParam,
|
|
34
|
-
CreateResponseBody
|
|
35
|
-
} from 'tekimax-ts';
|
|
36
|
-
|
|
37
|
-
// Strongly typed message object
|
|
38
|
-
const userMessage: UserMessageItemParam = {
|
|
39
|
-
type: 'message',
|
|
40
|
-
role: 'user',
|
|
41
|
-
content: [
|
|
42
|
-
{
|
|
43
|
-
type: 'input_text',
|
|
44
|
-
text: 'Explain quantum computing'
|
|
45
|
-
}
|
|
46
|
-
]
|
|
47
|
-
};
|
|
48
|
-
```
|
|
21
|
+
import { TekimaxClient } from 'tekimax-ts';
|
|
49
22
|
|
|
50
|
-
|
|
23
|
+
const client = new TekimaxClient({
|
|
24
|
+
apiKey: process.env.TEKIMAX_API_KEY
|
|
25
|
+
});
|
|
51
26
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const requestPayload: CreateResponseBody = {
|
|
56
|
-
model: 'tekimax-1.0',
|
|
57
|
-
items: [userMessage],
|
|
58
|
-
stream: true
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
// Send to API with Authentication and Error Handling
|
|
62
|
-
try {
|
|
63
|
-
const response = await fetch('https://api.tekimax.com/v1/generate', {
|
|
64
|
-
method: 'POST',
|
|
65
|
-
headers: {
|
|
66
|
-
'Content-Type': 'application/json',
|
|
67
|
-
'Authorization': 'Bearer YOUR_API_KEY'
|
|
68
|
-
},
|
|
69
|
-
body: JSON.stringify(requestPayload)
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
if (!response.ok) {
|
|
73
|
-
throw new Error(`API Error: ${response.status} ${response.statusText}`);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const data = await response.json();
|
|
77
|
-
console.log('Response:', data);
|
|
78
|
-
|
|
79
|
-
} catch (error) {
|
|
80
|
-
console.error('Failed to generate response:', error);
|
|
81
|
-
}
|
|
82
|
-
```
|
|
27
|
+
// Simple message
|
|
28
|
+
const response = await client.sendMessage("Explain quantum computing");
|
|
29
|
+
console.log(response.text);
|
|
83
30
|
|
|
84
|
-
|
|
31
|
+
// Continuing a session (preserves context)
|
|
32
|
+
const followUp = await client.sendMessage("How does it relate to encryption?", {
|
|
33
|
+
previous_response_id: response.id
|
|
34
|
+
});
|
|
35
|
+
console.log(followUp.text);
|
|
36
|
+
```
|
|
85
37
|
|
|
86
|
-
|
|
38
|
+
## 🧠 Motivation and Overview
|
|
87
39
|
|
|
88
|
-
|
|
89
|
-
import { CreateResponseBody, RequiredItemParam } from 'tekimax-ts';
|
|
40
|
+
Modern LLM systems have converged on similar primitives—messages, function calls, tool usage, and multimodal inputs—but each provider encodes them differently. **Tekimax** standardizes these concepts, enabling:
|
|
90
41
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
42
|
+
* **One spec, many providers**: Describe inputs/outputs once; run on OpenAI, Anthropic, Gemini, or local models.
|
|
43
|
+
* **Composable agentic loops**: Unified streaming, tool invocation, and message orchestration.
|
|
44
|
+
* **Easier evaluation and routing**: Compare providers, route requests, and log results through a shared schema.
|
|
45
|
+
* **Blueprints for provider APIs**: Labs and model providers wanting to expose their APIs in a common format can easily do so.
|
|
95
46
|
|
|
96
|
-
|
|
97
|
-
constructor(private config: TekimaxConfig) {}
|
|
47
|
+
## 🔑 Key Principles
|
|
98
48
|
|
|
99
|
-
|
|
100
|
-
// Implementation...
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
```
|
|
49
|
+
### Agentic Loop
|
|
104
50
|
|
|
105
|
-
|
|
51
|
+
All models, to some extent, exhibit agency — the ability to perceive input, reason, act through tools, and reflect on outcomes.
|
|
106
52
|
|
|
107
|
-
|
|
53
|
+
The **Tekimax Standard** at its core is designed to expose the power of this agentic loop to developers, making requests that allow the model to do multiple things and yield back a result, whether this is developer-hosted tool calls where control is yielded back to the user, or provider-hosted tools where control is held by the model provider until the model signals an exit criteria.
|
|
108
54
|
|
|
109
|
-
|
|
55
|
+
Tekimax defines a common pattern for defining control flow in the agent loop, a set of item definitions for developer-controlled tools, and pattern for defining provider and router-hosted tools.
|
|
110
56
|
|
|
111
|
-
|
|
57
|
+
### Items → Items
|
|
112
58
|
|
|
113
|
-
|
|
114
|
-
npm run generate
|
|
115
|
-
```
|
|
59
|
+
Items are the fundamental unit of context in Tekimax: they represent an atomic unit of model output, tool invocation, or reasoning state. Items are bidirectional, they can be provided as inputs to the model, or as outputs from the model.
|
|
116
60
|
|
|
117
|
-
|
|
61
|
+
Each item type has a defined schema that binds it and contains properties specific to its unique purpose.
|
|
118
62
|
|
|
119
|
-
|
|
120
|
-
npm run build
|
|
121
|
-
```
|
|
63
|
+
Tekimax defines a common set of items supported by a quorum of model providers, and defines how provider-specific item types can be defined.
|
|
122
64
|
|
|
123
|
-
###
|
|
65
|
+
### Semantic Events
|
|
124
66
|
|
|
125
|
-
|
|
67
|
+
Streaming is modeled as a series of semantic events, not raw text or object deltas.
|
|
126
68
|
|
|
127
|
-
|
|
128
|
-
# Build using the hardened Chainguard Node.js image
|
|
129
|
-
docker build -f Dockerfile -t tekimax-ts .
|
|
130
|
-
```
|
|
69
|
+
Events describe meaningful transitions. They are either state transitions–`response.in_progress`, `response.completed`–or they can represent a delta from a previous state–`response.output_item.added`, `response.output_text.delta`.
|
|
131
70
|
|
|
132
|
-
|
|
71
|
+
Tekimax defines a common set of streaming events supported by a quorum of model providers, and defines how provider-specific streaming events can be defined.
|
|
133
72
|
|
|
134
|
-
|
|
135
|
-
* **Date**: 2026-01-31
|
|
136
|
-
* **Result**: ✅ **0 Vulnerabilities** (Clean)
|
|
137
|
-
* **Base Image**: `cgr.dev/chainguard/node:latest-dev`
|
|
73
|
+
### State Machines
|
|
138
74
|
|
|
139
|
-
|
|
140
|
-
<div align="center">
|
|
141
|
-
<sub>Built with ❤️ by the Tekimax Team</sub>
|
|
142
|
-
</div>
|
|
75
|
+
Objects in Tekimax are state machines, that is, they can live in one of a finite number of states, such as `in_progress`, `completed`, or `failed`. The spec defines the set of valid states for each state machine in the API.
|