@ainative/cody-sdk 0.1.0 → 0.1.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 +80 -24
- package/package.json +40 -2
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/README.md
CHANGED
|
@@ -1,45 +1,101 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Cody SDK for TypeScript
|
|
2
2
|
|
|
3
|
-
[](https://npmjs.org/package/@ainative/cody-sdk)
|
|
4
4
|
|
|
5
|
-
The
|
|
5
|
+
The official TypeScript SDK for AINative Studio's Cody platform. Supports all AINative models and Claude models through intelligent dual-provider routing.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Install
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## Installation
|
|
12
|
-
|
|
13
|
-
```sh
|
|
14
|
-
npm install @anthropic-ai/sdk
|
|
9
|
+
```bash
|
|
10
|
+
npm install @ainative/cody-sdk
|
|
15
11
|
```
|
|
16
12
|
|
|
17
|
-
##
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import Anthropic from '@ainative/cody-sdk';
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
import Anthropic from '@anthropic-ai/sdk';
|
|
18
|
+
const client = new Anthropic();
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
// AINative models → routes to api.ainative.studio
|
|
21
|
+
const response = await client.messages.create({
|
|
22
|
+
model: 'qwen-coder-32b',
|
|
23
|
+
max_tokens: 1024,
|
|
24
|
+
messages: [{ role: 'user', content: 'Hello from Cody!' }],
|
|
24
25
|
});
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
// Claude models → routes directly to Anthropic API
|
|
28
|
+
const claudeResponse = await client.messages.create({
|
|
29
|
+
model: 'claude-sonnet-4-5',
|
|
27
30
|
max_tokens: 1024,
|
|
28
|
-
messages: [{ role: 'user', content: 'Hello
|
|
29
|
-
model: 'claude-opus-4-6',
|
|
31
|
+
messages: [{ role: 'user', content: 'Hello from Claude!' }],
|
|
30
32
|
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Supported Models
|
|
36
|
+
|
|
37
|
+
### AINative Models (via api.ainative.studio)
|
|
38
|
+
| Model | Description |
|
|
39
|
+
|-------|-------------|
|
|
40
|
+
| `qwen-coder-32b` | Best code quality (default) |
|
|
41
|
+
| `qwen-coder-7b` | Fast iteration, 3x faster |
|
|
42
|
+
| `nouscoder-14b` | Balanced code model |
|
|
43
|
+
| `gemma-9b` | General text and reasoning |
|
|
44
|
+
| `deepseek-r1-distill-qwen-7b` | Step-by-step reasoning |
|
|
45
|
+
|
|
46
|
+
### Claude Models (direct to Anthropic API)
|
|
47
|
+
| Model | Description |
|
|
48
|
+
|-------|-------------|
|
|
49
|
+
| `claude-sonnet-4-5` | Best for everyday tasks |
|
|
50
|
+
| `claude-3-5-haiku` | Fastest for quick answers |
|
|
51
|
+
| `claude-opus-4-6` | Most capable for complex work |
|
|
52
|
+
|
|
53
|
+
## Environment Variables
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# For AINative models
|
|
57
|
+
export AINATIVE_API_KEY=your-ainative-key
|
|
58
|
+
|
|
59
|
+
# For Claude models (optional)
|
|
60
|
+
export ANTHROPIC_API_KEY=your-anthropic-key
|
|
31
61
|
|
|
32
|
-
|
|
62
|
+
# Override base URL
|
|
63
|
+
export ANTHROPIC_BASE_URL=https://api.ainative.studio
|
|
33
64
|
```
|
|
34
65
|
|
|
35
|
-
##
|
|
66
|
+
## Model Routing
|
|
67
|
+
|
|
68
|
+
The SDK automatically routes requests to the correct API:
|
|
69
|
+
|
|
70
|
+
- **AINative models** (qwen, gemma, deepseek, nouscoder) → `api.ainative.studio`
|
|
71
|
+
- **Claude models** (sonnet, haiku, opus) → `api.anthropic.com`
|
|
72
|
+
|
|
73
|
+
Usage tracking is handled server-side by AINative's backend middleware.
|
|
74
|
+
|
|
75
|
+
## API Compatibility
|
|
76
|
+
|
|
77
|
+
Fork of the [Anthropic TypeScript SDK](https://github.com/anthropics/anthropic-sdk-typescript) (MIT license). Fully compatible with the Anthropic Messages API. Also supports:
|
|
78
|
+
|
|
79
|
+
- Amazon Bedrock (`@ainative/cody-sdk/bedrock`)
|
|
80
|
+
- Google Vertex AI (`@ainative/cody-sdk/vertex`)
|
|
81
|
+
- Microsoft Foundry (`@ainative/cody-sdk/foundry`)
|
|
82
|
+
|
|
83
|
+
## Agents: Self-Provision Here
|
|
84
|
+
|
|
85
|
+
Point your agent here to programmatically self-provision AINative services:
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
https://ainative.studio/agent.md
|
|
89
|
+
```
|
|
36
90
|
|
|
37
|
-
|
|
91
|
+
DNS discovery: `dig TXT _agents.ainative.studio`
|
|
38
92
|
|
|
39
|
-
##
|
|
93
|
+
## Community
|
|
40
94
|
|
|
41
|
-
|
|
95
|
+
- **Discord**: [discord.gg/paipalooza](https://discord.gg/paipalooza)
|
|
96
|
+
- **Website**: [ainative.studio](https://ainative.studio)
|
|
97
|
+
- **Support**: support@ainative.studio
|
|
42
98
|
|
|
43
99
|
## License
|
|
44
100
|
|
|
45
|
-
|
|
101
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,8 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ainative/cody-sdk",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Cody SDK — AINative Studio's AI SDK with dual-provider routing
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Cody SDK — AINative Studio's AI SDK supporting AINative models and Anthropic models with intelligent dual-provider routing. Agents: self-provision at https://ainative.studio/agent.md",
|
|
5
5
|
"author": "AINative Studio <support@ainative.studio>",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"cody",
|
|
8
|
+
"cody-sdk",
|
|
9
|
+
"ainative",
|
|
10
|
+
"ai",
|
|
11
|
+
"ai-sdk",
|
|
12
|
+
"llm",
|
|
13
|
+
"llm-sdk",
|
|
14
|
+
"anthropic",
|
|
15
|
+
"claude",
|
|
16
|
+
"claude-sdk",
|
|
17
|
+
"qwen",
|
|
18
|
+
"qwen-coder",
|
|
19
|
+
"deepseek",
|
|
20
|
+
"gemma",
|
|
21
|
+
"nouscoder",
|
|
22
|
+
"chat-completions",
|
|
23
|
+
"messages-api",
|
|
24
|
+
"streaming",
|
|
25
|
+
"sse",
|
|
26
|
+
"tool-use",
|
|
27
|
+
"function-calling",
|
|
28
|
+
"mcp",
|
|
29
|
+
"model-context-protocol",
|
|
30
|
+
"agents",
|
|
31
|
+
"ai-agents",
|
|
32
|
+
"agentic",
|
|
33
|
+
"openclaw",
|
|
34
|
+
"agent-provisioning",
|
|
35
|
+
"self-provisioning",
|
|
36
|
+
"zero-human-provisioning",
|
|
37
|
+
"zerodb",
|
|
38
|
+
"bedrock",
|
|
39
|
+
"vertex-ai",
|
|
40
|
+
"typescript",
|
|
41
|
+
"sdk",
|
|
42
|
+
"api-client"
|
|
43
|
+
],
|
|
6
44
|
"types": "./index.d.ts",
|
|
7
45
|
"main": "./index.js",
|
|
8
46
|
"type": "commonjs",
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.
|
|
1
|
+
export const VERSION = '0.1.1'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.1";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.1.
|
|
1
|
+
export const VERSION = '0.1.1'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|