@axiom-lattice/gateway 2.1.32 → 2.1.34
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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +15 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +19 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/controllers/run.ts +3 -0
- package/src/services/agent_service.ts +12 -4
- package/src/services/agent_task_consumer.ts +3 -0
- package/src/types/index.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axiom-lattice/gateway",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.34",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"pino-roll": "^3.1.0",
|
|
37
37
|
"redis": "^5.0.1",
|
|
38
38
|
"uuid": "^9.0.1",
|
|
39
|
-
"@axiom-lattice/core": "2.1.
|
|
39
|
+
"@axiom-lattice/core": "2.1.29",
|
|
40
40
|
"@axiom-lattice/protocols": "2.1.16",
|
|
41
41
|
"@axiom-lattice/queue-redis": "1.0.15"
|
|
42
42
|
},
|
package/src/controllers/run.ts
CHANGED
|
@@ -22,6 +22,7 @@ export const createRun = async (
|
|
|
22
22
|
command,
|
|
23
23
|
streaming,
|
|
24
24
|
background,
|
|
25
|
+
custom_run_config,
|
|
25
26
|
...input
|
|
26
27
|
} = request.body as CreateRunRequest;
|
|
27
28
|
|
|
@@ -51,6 +52,7 @@ export const createRun = async (
|
|
|
51
52
|
workspace_id: workspace_id,
|
|
52
53
|
project_id: project_id,
|
|
53
54
|
run_id: x_request_id,
|
|
55
|
+
custom_run_config,
|
|
54
56
|
});
|
|
55
57
|
|
|
56
58
|
// 通知 Fastify 我们将手动处理响应
|
|
@@ -84,6 +86,7 @@ export const createRun = async (
|
|
|
84
86
|
workspace_id: workspace_id,
|
|
85
87
|
project_id: project_id,
|
|
86
88
|
run_id: x_request_id,
|
|
89
|
+
custom_run_config,
|
|
87
90
|
});
|
|
88
91
|
reply.status(200).send(result);
|
|
89
92
|
}
|
|
@@ -74,6 +74,7 @@ export async function agent_invoke({
|
|
|
74
74
|
project_id,
|
|
75
75
|
command,
|
|
76
76
|
run_id,
|
|
77
|
+
custom_run_config,
|
|
77
78
|
}: {
|
|
78
79
|
assistant_id: string;
|
|
79
80
|
input: any;
|
|
@@ -83,6 +84,7 @@ export async function agent_invoke({
|
|
|
83
84
|
project_id?: string;
|
|
84
85
|
run_id?: string;
|
|
85
86
|
command?: CommandParams<any>;
|
|
87
|
+
custom_run_config?: Record<string, any>;
|
|
86
88
|
}) {
|
|
87
89
|
const agentLattice = getAgentLattice(assistant_id);
|
|
88
90
|
const runnable_agent = agentLattice?.client;
|
|
@@ -104,12 +106,14 @@ export async function agent_invoke({
|
|
|
104
106
|
);
|
|
105
107
|
(global as any).__DATABASE_CONFIGS__ = databaseConfigs;
|
|
106
108
|
|
|
107
|
-
// Get runConfig from agent config and merge
|
|
109
|
+
// Get runConfig from agent config and merge with custom_run_config
|
|
108
110
|
const runConfig = {
|
|
109
111
|
...agentLattice?.config?.runConfig || {},
|
|
110
|
-
assistant_id,
|
|
111
112
|
workspaceId: workspace_id,
|
|
112
113
|
projectId: project_id,
|
|
114
|
+
...custom_run_config || {},
|
|
115
|
+
assistant_id,
|
|
116
|
+
|
|
113
117
|
}
|
|
114
118
|
|
|
115
119
|
const result = await runnable_agent.invoke(
|
|
@@ -151,6 +155,7 @@ export async function agent_stream({
|
|
|
151
155
|
project_id,
|
|
152
156
|
assistant_id,
|
|
153
157
|
run_id,
|
|
158
|
+
custom_run_config,
|
|
154
159
|
}: {
|
|
155
160
|
assistant_id: string;
|
|
156
161
|
input: any;
|
|
@@ -160,6 +165,7 @@ export async function agent_stream({
|
|
|
160
165
|
workspace_id?: string;
|
|
161
166
|
project_id?: string;
|
|
162
167
|
run_id?: string;
|
|
168
|
+
custom_run_config?: Record<string, any>;
|
|
163
169
|
}) {
|
|
164
170
|
const runnable_agent = getAgentClient(assistant_id) as any;
|
|
165
171
|
const agentLattice = getAgentLattice(assistant_id);
|
|
@@ -183,12 +189,14 @@ export async function agent_stream({
|
|
|
183
189
|
);
|
|
184
190
|
(global as any).__DATABASE_CONFIGS__ = databaseConfigs;
|
|
185
191
|
|
|
186
|
-
// Get runConfig from agent config and merge
|
|
192
|
+
// Get runConfig from agent config and merge with custom_run_config
|
|
187
193
|
const runConfig = {
|
|
188
194
|
...agentLattice?.config?.runConfig || {},
|
|
189
|
-
assistant_id,
|
|
190
195
|
workspaceId: workspace_id,
|
|
191
196
|
projectId: project_id,
|
|
197
|
+
...custom_run_config || {},
|
|
198
|
+
assistant_id,
|
|
199
|
+
|
|
192
200
|
}
|
|
193
201
|
|
|
194
202
|
try {
|
|
@@ -10,6 +10,7 @@ export interface AgentTaskRequest {
|
|
|
10
10
|
"x-tenant-id": string;
|
|
11
11
|
command?: any;
|
|
12
12
|
callback_event?: string; // 可选的回调事件名称
|
|
13
|
+
runConfig?: Record<string, unknown>; // RunConfig for subagent execution
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -28,6 +29,7 @@ const handleAgentTask = async (
|
|
|
28
29
|
"x-tenant-id": tenant_id,
|
|
29
30
|
command,
|
|
30
31
|
callback_event,
|
|
32
|
+
runConfig,
|
|
31
33
|
} = taskRequest;
|
|
32
34
|
|
|
33
35
|
try {
|
|
@@ -48,6 +50,7 @@ const handleAgentTask = async (
|
|
|
48
50
|
...input,
|
|
49
51
|
thread_id,
|
|
50
52
|
command,
|
|
53
|
+
custom_run_config: runConfig,
|
|
51
54
|
}),
|
|
52
55
|
headers: {
|
|
53
56
|
"Content-Type": "application/json",
|