@iqai/adk 0.3.5 → 0.3.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/CHANGELOG.md +12 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +16 -3
- package/dist/index.mjs +16 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -4038,6 +4038,7 @@ interface EnhancedRunner<T = string, M extends boolean = false> {
|
|
|
4038
4038
|
userId: string;
|
|
4039
4039
|
sessionId: string;
|
|
4040
4040
|
newMessage: FullMessage;
|
|
4041
|
+
runConfig?: RunConfig;
|
|
4041
4042
|
}): AsyncIterable<Event>;
|
|
4042
4043
|
__outputSchema?: ZodSchema;
|
|
4043
4044
|
}
|
|
@@ -4117,6 +4118,7 @@ declare class AgentBuilder<TOut = string, TMulti extends boolean = false> {
|
|
|
4117
4118
|
private existingAgent?;
|
|
4118
4119
|
private definitionLocked;
|
|
4119
4120
|
private logger;
|
|
4121
|
+
private runConfig?;
|
|
4120
4122
|
/**
|
|
4121
4123
|
* Warn (once per method) if the definition has been locked by withAgent().
|
|
4122
4124
|
*/
|
|
@@ -4256,6 +4258,10 @@ declare class AgentBuilder<TOut = string, TMulti extends boolean = false> {
|
|
|
4256
4258
|
* @returns This builder instance for chaining
|
|
4257
4259
|
*/
|
|
4258
4260
|
withArtifactService(artifactService: BaseArtifactService): this;
|
|
4261
|
+
/**
|
|
4262
|
+
* Configure runtime behavior for runs
|
|
4263
|
+
*/
|
|
4264
|
+
withRunConfig(config: RunConfig | Partial<RunConfig>): this;
|
|
4259
4265
|
/**
|
|
4260
4266
|
* Configure with an in-memory session with custom IDs
|
|
4261
4267
|
* Note: In-memory sessions are created automatically by default, use this only if you need custom appName/userId
|
package/dist/index.d.ts
CHANGED
|
@@ -4038,6 +4038,7 @@ interface EnhancedRunner<T = string, M extends boolean = false> {
|
|
|
4038
4038
|
userId: string;
|
|
4039
4039
|
sessionId: string;
|
|
4040
4040
|
newMessage: FullMessage;
|
|
4041
|
+
runConfig?: RunConfig;
|
|
4041
4042
|
}): AsyncIterable<Event>;
|
|
4042
4043
|
__outputSchema?: ZodSchema;
|
|
4043
4044
|
}
|
|
@@ -4117,6 +4118,7 @@ declare class AgentBuilder<TOut = string, TMulti extends boolean = false> {
|
|
|
4117
4118
|
private existingAgent?;
|
|
4118
4119
|
private definitionLocked;
|
|
4119
4120
|
private logger;
|
|
4121
|
+
private runConfig?;
|
|
4120
4122
|
/**
|
|
4121
4123
|
* Warn (once per method) if the definition has been locked by withAgent().
|
|
4122
4124
|
*/
|
|
@@ -4256,6 +4258,10 @@ declare class AgentBuilder<TOut = string, TMulti extends boolean = false> {
|
|
|
4256
4258
|
* @returns This builder instance for chaining
|
|
4257
4259
|
*/
|
|
4258
4260
|
withArtifactService(artifactService: BaseArtifactService): this;
|
|
4261
|
+
/**
|
|
4262
|
+
* Configure runtime behavior for runs
|
|
4263
|
+
*/
|
|
4264
|
+
withRunConfig(config: RunConfig | Partial<RunConfig>): this;
|
|
4259
4265
|
/**
|
|
4260
4266
|
* Configure with an in-memory session with custom IDs
|
|
4261
4267
|
* Note: In-memory sessions are created automatically by default, use this only if you need custom appName/userId
|
package/dist/index.js
CHANGED
|
@@ -2343,7 +2343,7 @@ var OpenAiLlm = class extends BaseLlm {
|
|
|
2343
2343
|
* Provides the list of supported models
|
|
2344
2344
|
*/
|
|
2345
2345
|
static supportedModels() {
|
|
2346
|
-
return ["gpt-3.5-.*", "gpt-4.*", "gpt-4o.*", "o1-.*", "o3-.*"];
|
|
2346
|
+
return ["gpt-3.5-.*", "gpt-4.*", "gpt-4o.*", "gpt-5.*", "o1-.*", "o3-.*"];
|
|
2347
2347
|
}
|
|
2348
2348
|
/**
|
|
2349
2349
|
* Main content generation method - handles both streaming and non-streaming
|
|
@@ -10665,6 +10665,7 @@ var AgentBuilder = (_class33 = class _AgentBuilder {
|
|
|
10665
10665
|
__init57() {this.definitionLocked = false}
|
|
10666
10666
|
// Lock further definition mutation after withAgent
|
|
10667
10667
|
__init58() {this.logger = new Logger({ name: "AgentBuilder" })}
|
|
10668
|
+
|
|
10668
10669
|
/**
|
|
10669
10670
|
* Warn (once per method) if the definition has been locked by withAgent().
|
|
10670
10671
|
*/
|
|
@@ -11004,6 +11005,13 @@ var AgentBuilder = (_class33 = class _AgentBuilder {
|
|
|
11004
11005
|
this.artifactService = artifactService;
|
|
11005
11006
|
return this;
|
|
11006
11007
|
}
|
|
11008
|
+
/**
|
|
11009
|
+
* Configure runtime behavior for runs
|
|
11010
|
+
*/
|
|
11011
|
+
withRunConfig(config) {
|
|
11012
|
+
this.runConfig = config instanceof RunConfig ? config : new RunConfig({ ...this.runConfig || {}, ...config });
|
|
11013
|
+
return this;
|
|
11014
|
+
}
|
|
11007
11015
|
/**
|
|
11008
11016
|
* Configure with an in-memory session with custom IDs
|
|
11009
11017
|
* Note: In-memory sessions are created automatically by default, use this only if you need custom appName/userId
|
|
@@ -11187,6 +11195,7 @@ var AgentBuilder = (_class33 = class _AgentBuilder {
|
|
|
11187
11195
|
const agentType = this.agentType;
|
|
11188
11196
|
const isMulti = agentType === "parallel" || agentType === "sequential";
|
|
11189
11197
|
const subAgentNames = _optionalChain([this, 'access', _285 => _285.config, 'access', _286 => _286.subAgents, 'optionalAccess', _287 => _287.map, 'call', _288 => _288((a) => a.name)]) || [];
|
|
11198
|
+
const runConfig = this.runConfig;
|
|
11190
11199
|
return {
|
|
11191
11200
|
__outputSchema: outputSchema,
|
|
11192
11201
|
async ask(message) {
|
|
@@ -11200,7 +11209,8 @@ var AgentBuilder = (_class33 = class _AgentBuilder {
|
|
|
11200
11209
|
for await (const event of baseRunner.runAsync({
|
|
11201
11210
|
userId: sessionOptions.userId,
|
|
11202
11211
|
sessionId: session.id,
|
|
11203
|
-
newMessage
|
|
11212
|
+
newMessage,
|
|
11213
|
+
runConfig
|
|
11204
11214
|
})) {
|
|
11205
11215
|
if (_optionalChain([event, 'access', _290 => _290.content, 'optionalAccess', _291 => _291.parts]) && Array.isArray(event.content.parts)) {
|
|
11206
11216
|
const content = event.content.parts.map(
|
|
@@ -11244,7 +11254,10 @@ var AgentBuilder = (_class33 = class _AgentBuilder {
|
|
|
11244
11254
|
return combinedResponse.trim();
|
|
11245
11255
|
},
|
|
11246
11256
|
runAsync(params) {
|
|
11247
|
-
return baseRunner.runAsync(
|
|
11257
|
+
return baseRunner.runAsync({
|
|
11258
|
+
...params,
|
|
11259
|
+
runConfig: _nullishCoalesce(params.runConfig, () => ( runConfig))
|
|
11260
|
+
});
|
|
11248
11261
|
}
|
|
11249
11262
|
};
|
|
11250
11263
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -2343,7 +2343,7 @@ var OpenAiLlm = class extends BaseLlm {
|
|
|
2343
2343
|
* Provides the list of supported models
|
|
2344
2344
|
*/
|
|
2345
2345
|
static supportedModels() {
|
|
2346
|
-
return ["gpt-3.5-.*", "gpt-4.*", "gpt-4o.*", "o1-.*", "o3-.*"];
|
|
2346
|
+
return ["gpt-3.5-.*", "gpt-4.*", "gpt-4o.*", "gpt-5.*", "o1-.*", "o3-.*"];
|
|
2347
2347
|
}
|
|
2348
2348
|
/**
|
|
2349
2349
|
* Main content generation method - handles both streaming and non-streaming
|
|
@@ -10665,6 +10665,7 @@ var AgentBuilder = class _AgentBuilder {
|
|
|
10665
10665
|
definitionLocked = false;
|
|
10666
10666
|
// Lock further definition mutation after withAgent
|
|
10667
10667
|
logger = new Logger({ name: "AgentBuilder" });
|
|
10668
|
+
runConfig;
|
|
10668
10669
|
/**
|
|
10669
10670
|
* Warn (once per method) if the definition has been locked by withAgent().
|
|
10670
10671
|
*/
|
|
@@ -11004,6 +11005,13 @@ var AgentBuilder = class _AgentBuilder {
|
|
|
11004
11005
|
this.artifactService = artifactService;
|
|
11005
11006
|
return this;
|
|
11006
11007
|
}
|
|
11008
|
+
/**
|
|
11009
|
+
* Configure runtime behavior for runs
|
|
11010
|
+
*/
|
|
11011
|
+
withRunConfig(config) {
|
|
11012
|
+
this.runConfig = config instanceof RunConfig ? config : new RunConfig({ ...this.runConfig || {}, ...config });
|
|
11013
|
+
return this;
|
|
11014
|
+
}
|
|
11007
11015
|
/**
|
|
11008
11016
|
* Configure with an in-memory session with custom IDs
|
|
11009
11017
|
* Note: In-memory sessions are created automatically by default, use this only if you need custom appName/userId
|
|
@@ -11187,6 +11195,7 @@ var AgentBuilder = class _AgentBuilder {
|
|
|
11187
11195
|
const agentType = this.agentType;
|
|
11188
11196
|
const isMulti = agentType === "parallel" || agentType === "sequential";
|
|
11189
11197
|
const subAgentNames = this.config.subAgents?.map((a) => a.name) || [];
|
|
11198
|
+
const runConfig = this.runConfig;
|
|
11190
11199
|
return {
|
|
11191
11200
|
__outputSchema: outputSchema,
|
|
11192
11201
|
async ask(message) {
|
|
@@ -11200,7 +11209,8 @@ var AgentBuilder = class _AgentBuilder {
|
|
|
11200
11209
|
for await (const event of baseRunner.runAsync({
|
|
11201
11210
|
userId: sessionOptions.userId,
|
|
11202
11211
|
sessionId: session.id,
|
|
11203
|
-
newMessage
|
|
11212
|
+
newMessage,
|
|
11213
|
+
runConfig
|
|
11204
11214
|
})) {
|
|
11205
11215
|
if (event.content?.parts && Array.isArray(event.content.parts)) {
|
|
11206
11216
|
const content = event.content.parts.map(
|
|
@@ -11244,7 +11254,10 @@ var AgentBuilder = class _AgentBuilder {
|
|
|
11244
11254
|
return combinedResponse.trim();
|
|
11245
11255
|
},
|
|
11246
11256
|
runAsync(params) {
|
|
11247
|
-
return baseRunner.runAsync(
|
|
11257
|
+
return baseRunner.runAsync({
|
|
11258
|
+
...params,
|
|
11259
|
+
runConfig: params.runConfig ?? runConfig
|
|
11260
|
+
});
|
|
11248
11261
|
}
|
|
11249
11262
|
};
|
|
11250
11263
|
}
|