@inkeep/ai-sdk-provider 0.0.0-chat-to-edit-20251124233210 → 0.0.0-dev-20251031215427
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 +11 -6
- package/dist/index.cjs +17 -14
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +17 -14
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ const inkeep = createInkeep({
|
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
const { text } = await generateText({
|
|
33
|
-
model: inkeep(),
|
|
33
|
+
model: inkeep('agent-123'),
|
|
34
34
|
prompt: 'What is the weather in NYC?',
|
|
35
35
|
});
|
|
36
36
|
|
|
@@ -45,14 +45,13 @@ import { createInkeep } from '@inkeep/ai-sdk-provider';
|
|
|
45
45
|
|
|
46
46
|
const inkeep = createInkeep({
|
|
47
47
|
baseURL: proccess.env.INKEEP_AGENTS_RUN_API_URL,
|
|
48
|
-
apiKey: <your-agent-api-key>,
|
|
49
48
|
headers: {
|
|
50
49
|
'x-emit-operations': 'true', // Enable tool event streaming
|
|
51
50
|
},
|
|
52
51
|
});
|
|
53
52
|
|
|
54
53
|
const result = await streamText({
|
|
55
|
-
model: inkeep(),
|
|
54
|
+
model: inkeep('agent-123'),
|
|
56
55
|
prompt: 'Plan an event in NYC',
|
|
57
56
|
});
|
|
58
57
|
|
|
@@ -69,7 +68,7 @@ createInkeep({
|
|
|
69
68
|
})
|
|
70
69
|
```
|
|
71
70
|
|
|
72
|
-
###
|
|
71
|
+
### Model Options
|
|
73
72
|
|
|
74
73
|
Pass options when creating a provider instance:
|
|
75
74
|
|
|
@@ -87,7 +86,7 @@ import { inkeep } from '@inkeep/ai-sdk-provider';
|
|
|
87
86
|
import { generateText } from 'ai';
|
|
88
87
|
|
|
89
88
|
const result = await generateText({
|
|
90
|
-
model: inkeep({
|
|
89
|
+
model: inkeep('agent-123', {
|
|
91
90
|
conversationId: 'conv-123',
|
|
92
91
|
headers: {
|
|
93
92
|
'user-id': 'user-456',
|
|
@@ -153,7 +152,7 @@ const inkeep = createInkeep({
|
|
|
153
152
|
});
|
|
154
153
|
|
|
155
154
|
const result = await streamText({
|
|
156
|
-
model: inkeep(),
|
|
155
|
+
model: inkeep('agent-123'),
|
|
157
156
|
prompt: 'Search for recent papers on AI',
|
|
158
157
|
});
|
|
159
158
|
|
|
@@ -199,3 +198,9 @@ The provider emits the following AI SDK v2 stream events:
|
|
|
199
198
|
**Control Events** (always emitted):
|
|
200
199
|
- `finish` - Stream completion with usage statistics
|
|
201
200
|
- `error` - Stream error occurred
|
|
201
|
+
|
|
202
|
+
## Model Identification
|
|
203
|
+
|
|
204
|
+
Models are identified by agent ID in the format:
|
|
205
|
+
- `agent-123` - Direct agent ID
|
|
206
|
+
- `inkeep/agent-123` - With provider prefix (when used with custom factories)
|
package/dist/index.cjs
CHANGED
|
@@ -4,10 +4,12 @@ var providerUtils = require('@ai-sdk/provider-utils');
|
|
|
4
4
|
var agentsCore = require('@inkeep/agents-core');
|
|
5
5
|
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
8
|
var __export = (target, all) => {
|
|
8
9
|
for (var name in all)
|
|
9
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
11
|
};
|
|
12
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
11
13
|
|
|
12
14
|
// ../../node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/external.js
|
|
13
15
|
var external_exports = {};
|
|
@@ -12743,25 +12745,26 @@ function convertDataOperationToToolEvent(opData) {
|
|
|
12743
12745
|
}
|
|
12744
12746
|
}
|
|
12745
12747
|
var InkeepChatLanguageModel = class {
|
|
12746
|
-
|
|
12747
|
-
|
|
12748
|
-
|
|
12749
|
-
|
|
12750
|
-
|
|
12751
|
-
|
|
12752
|
-
|
|
12753
|
-
|
|
12754
|
-
|
|
12755
|
-
}
|
|
12756
|
-
constructor(options, config2) {
|
|
12757
|
-
this.modelId = "inkeep-agent";
|
|
12748
|
+
constructor(modelId, options, config2) {
|
|
12749
|
+
__publicField(this, "specificationVersion", "v2");
|
|
12750
|
+
__publicField(this, "defaultObjectGenerationMode");
|
|
12751
|
+
__publicField(this, "supportsImageUrls", false);
|
|
12752
|
+
__publicField(this, "supportedUrls", {});
|
|
12753
|
+
__publicField(this, "modelId");
|
|
12754
|
+
__publicField(this, "options");
|
|
12755
|
+
__publicField(this, "config");
|
|
12756
|
+
this.modelId = modelId;
|
|
12758
12757
|
this.options = options;
|
|
12759
12758
|
this.config = config2;
|
|
12760
12759
|
}
|
|
12760
|
+
get provider() {
|
|
12761
|
+
return this.config.provider;
|
|
12762
|
+
}
|
|
12761
12763
|
getArgs(options) {
|
|
12762
12764
|
const warnings = [];
|
|
12763
12765
|
return {
|
|
12764
12766
|
args: {
|
|
12767
|
+
model: this.modelId,
|
|
12765
12768
|
messages: convertToInkeepChatMessages(options.prompt),
|
|
12766
12769
|
conversationId: this.options.conversationId,
|
|
12767
12770
|
headers: this.options.headers,
|
|
@@ -12963,13 +12966,13 @@ function createInkeep(options = {}) {
|
|
|
12963
12966
|
...options.headers
|
|
12964
12967
|
};
|
|
12965
12968
|
};
|
|
12966
|
-
const createChatModel = (chatOptions) => new InkeepChatLanguageModel(chatOptions ?? {}, {
|
|
12969
|
+
const createChatModel = (agentId, chatOptions) => new InkeepChatLanguageModel(agentId, chatOptions ?? {}, {
|
|
12967
12970
|
provider: "inkeep",
|
|
12968
12971
|
baseURL: getBaseURL(),
|
|
12969
12972
|
headers: getHeaders,
|
|
12970
12973
|
fetch: options.fetch
|
|
12971
12974
|
});
|
|
12972
|
-
const provider = (chatOptions) => createChatModel(chatOptions);
|
|
12975
|
+
const provider = (agentId, chatOptions) => createChatModel(agentId, chatOptions);
|
|
12973
12976
|
provider.languageModel = createChatModel;
|
|
12974
12977
|
return provider;
|
|
12975
12978
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -104,7 +104,7 @@ declare class InkeepChatLanguageModel implements LanguageModelV2 {
|
|
|
104
104
|
readonly options: InkeepChatOptions;
|
|
105
105
|
readonly config: InkeepChatConfig;
|
|
106
106
|
get provider(): string;
|
|
107
|
-
constructor(options: InkeepChatOptions, config: InkeepChatConfig);
|
|
107
|
+
constructor(modelId: string, options: InkeepChatOptions, config: InkeepChatConfig);
|
|
108
108
|
private getArgs;
|
|
109
109
|
doGenerate(options: LanguageModelV2CallOptions): Promise<{
|
|
110
110
|
content: LanguageModelV2Content[];
|
|
@@ -119,6 +119,7 @@ declare class InkeepChatLanguageModel implements LanguageModelV2 {
|
|
|
119
119
|
rawCall: {
|
|
120
120
|
rawPrompt: InkeepChatMessage[];
|
|
121
121
|
rawSettings: {
|
|
122
|
+
model: string;
|
|
122
123
|
messages: InkeepChatMessage[];
|
|
123
124
|
conversationId: string | undefined;
|
|
124
125
|
headers: Record<string, unknown> | undefined;
|
|
@@ -140,6 +141,7 @@ declare class InkeepChatLanguageModel implements LanguageModelV2 {
|
|
|
140
141
|
rawCall: {
|
|
141
142
|
rawPrompt: InkeepChatMessage[];
|
|
142
143
|
rawSettings: {
|
|
144
|
+
model: string;
|
|
143
145
|
messages: InkeepChatMessage[];
|
|
144
146
|
conversationId: string | undefined;
|
|
145
147
|
headers: Record<string, unknown> | undefined;
|
|
@@ -165,8 +167,8 @@ declare const inkeepErrorDataSchema: z.ZodObject<{
|
|
|
165
167
|
type InkeepErrorData = z.infer<typeof inkeepErrorDataSchema>;
|
|
166
168
|
|
|
167
169
|
interface InkeepProvider {
|
|
168
|
-
(options?: InkeepChatOptions): InkeepChatLanguageModel;
|
|
169
|
-
languageModel(options?: InkeepChatOptions): InkeepChatLanguageModel;
|
|
170
|
+
(agentId: string, options?: InkeepChatOptions): InkeepChatLanguageModel;
|
|
171
|
+
languageModel(agentId: string, options?: InkeepChatOptions): InkeepChatLanguageModel;
|
|
170
172
|
}
|
|
171
173
|
interface InkeepProviderSettings {
|
|
172
174
|
baseURL?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -104,7 +104,7 @@ declare class InkeepChatLanguageModel implements LanguageModelV2 {
|
|
|
104
104
|
readonly options: InkeepChatOptions;
|
|
105
105
|
readonly config: InkeepChatConfig;
|
|
106
106
|
get provider(): string;
|
|
107
|
-
constructor(options: InkeepChatOptions, config: InkeepChatConfig);
|
|
107
|
+
constructor(modelId: string, options: InkeepChatOptions, config: InkeepChatConfig);
|
|
108
108
|
private getArgs;
|
|
109
109
|
doGenerate(options: LanguageModelV2CallOptions): Promise<{
|
|
110
110
|
content: LanguageModelV2Content[];
|
|
@@ -119,6 +119,7 @@ declare class InkeepChatLanguageModel implements LanguageModelV2 {
|
|
|
119
119
|
rawCall: {
|
|
120
120
|
rawPrompt: InkeepChatMessage[];
|
|
121
121
|
rawSettings: {
|
|
122
|
+
model: string;
|
|
122
123
|
messages: InkeepChatMessage[];
|
|
123
124
|
conversationId: string | undefined;
|
|
124
125
|
headers: Record<string, unknown> | undefined;
|
|
@@ -140,6 +141,7 @@ declare class InkeepChatLanguageModel implements LanguageModelV2 {
|
|
|
140
141
|
rawCall: {
|
|
141
142
|
rawPrompt: InkeepChatMessage[];
|
|
142
143
|
rawSettings: {
|
|
144
|
+
model: string;
|
|
143
145
|
messages: InkeepChatMessage[];
|
|
144
146
|
conversationId: string | undefined;
|
|
145
147
|
headers: Record<string, unknown> | undefined;
|
|
@@ -165,8 +167,8 @@ declare const inkeepErrorDataSchema: z.ZodObject<{
|
|
|
165
167
|
type InkeepErrorData = z.infer<typeof inkeepErrorDataSchema>;
|
|
166
168
|
|
|
167
169
|
interface InkeepProvider {
|
|
168
|
-
(options?: InkeepChatOptions): InkeepChatLanguageModel;
|
|
169
|
-
languageModel(options?: InkeepChatOptions): InkeepChatLanguageModel;
|
|
170
|
+
(agentId: string, options?: InkeepChatOptions): InkeepChatLanguageModel;
|
|
171
|
+
languageModel(agentId: string, options?: InkeepChatOptions): InkeepChatLanguageModel;
|
|
170
172
|
}
|
|
171
173
|
interface InkeepProviderSettings {
|
|
172
174
|
baseURL?: string;
|
package/dist/index.js
CHANGED
|
@@ -2,10 +2,12 @@ import { createJsonErrorResponseHandler, postJsonToApi, createJsonResponseHandle
|
|
|
2
2
|
import { StreamEventSchema } from '@inkeep/agents-core';
|
|
3
3
|
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5
6
|
var __export = (target, all) => {
|
|
6
7
|
for (var name in all)
|
|
7
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
9
|
};
|
|
10
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
9
11
|
|
|
10
12
|
// ../../node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/external.js
|
|
11
13
|
var external_exports = {};
|
|
@@ -12741,25 +12743,26 @@ function convertDataOperationToToolEvent(opData) {
|
|
|
12741
12743
|
}
|
|
12742
12744
|
}
|
|
12743
12745
|
var InkeepChatLanguageModel = class {
|
|
12744
|
-
|
|
12745
|
-
|
|
12746
|
-
|
|
12747
|
-
|
|
12748
|
-
|
|
12749
|
-
|
|
12750
|
-
|
|
12751
|
-
|
|
12752
|
-
|
|
12753
|
-
}
|
|
12754
|
-
constructor(options, config2) {
|
|
12755
|
-
this.modelId = "inkeep-agent";
|
|
12746
|
+
constructor(modelId, options, config2) {
|
|
12747
|
+
__publicField(this, "specificationVersion", "v2");
|
|
12748
|
+
__publicField(this, "defaultObjectGenerationMode");
|
|
12749
|
+
__publicField(this, "supportsImageUrls", false);
|
|
12750
|
+
__publicField(this, "supportedUrls", {});
|
|
12751
|
+
__publicField(this, "modelId");
|
|
12752
|
+
__publicField(this, "options");
|
|
12753
|
+
__publicField(this, "config");
|
|
12754
|
+
this.modelId = modelId;
|
|
12756
12755
|
this.options = options;
|
|
12757
12756
|
this.config = config2;
|
|
12758
12757
|
}
|
|
12758
|
+
get provider() {
|
|
12759
|
+
return this.config.provider;
|
|
12760
|
+
}
|
|
12759
12761
|
getArgs(options) {
|
|
12760
12762
|
const warnings = [];
|
|
12761
12763
|
return {
|
|
12762
12764
|
args: {
|
|
12765
|
+
model: this.modelId,
|
|
12763
12766
|
messages: convertToInkeepChatMessages(options.prompt),
|
|
12764
12767
|
conversationId: this.options.conversationId,
|
|
12765
12768
|
headers: this.options.headers,
|
|
@@ -12961,13 +12964,13 @@ function createInkeep(options = {}) {
|
|
|
12961
12964
|
...options.headers
|
|
12962
12965
|
};
|
|
12963
12966
|
};
|
|
12964
|
-
const createChatModel = (chatOptions) => new InkeepChatLanguageModel(chatOptions ?? {}, {
|
|
12967
|
+
const createChatModel = (agentId, chatOptions) => new InkeepChatLanguageModel(agentId, chatOptions ?? {}, {
|
|
12965
12968
|
provider: "inkeep",
|
|
12966
12969
|
baseURL: getBaseURL(),
|
|
12967
12970
|
headers: getHeaders,
|
|
12968
12971
|
fetch: options.fetch
|
|
12969
12972
|
});
|
|
12970
|
-
const provider = (chatOptions) => createChatModel(chatOptions);
|
|
12973
|
+
const provider = (agentId, chatOptions) => createChatModel(agentId, chatOptions);
|
|
12971
12974
|
provider.languageModel = createChatModel;
|
|
12972
12975
|
return provider;
|
|
12973
12976
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/ai-sdk-provider",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-dev-20251031215427",
|
|
4
4
|
"description": "AI SDK provider for Inkeep Agent Framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@ai-sdk/provider": "^2.0.0",
|
|
26
26
|
"@ai-sdk/provider-utils": "^3.0.12",
|
|
27
27
|
"ai": "5.0.11",
|
|
28
|
-
"@inkeep/agents-core": "0.0.0-
|
|
28
|
+
"@inkeep/agents-core": "0.0.0-dev-20251031215427"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^20.11.24",
|