@@ -140,57 +140,60 @@ async function getFeatureFrontendFiles(featureId: string) {
140
140
}
141
141
142
142
const integrationsFolderPath = '../../../integrations'
143
- const agentFilesMapper : Record < string , ( agentKeys : string [ ] ) => Record < string , string > > = {
143
+ const agentFilesMapper : Record < string , ( agentKeys : string [ ] ) => Record < string , string [ ] > > = {
144
144
'middleware-starter' : ( ) => ( {
145
- agentic_chat : path . join ( __dirname , integrationsFolderPath , `/middleware-starter/src/index.ts` )
145
+ agentic_chat : [ path . join ( __dirname , integrationsFolderPath , `/middleware-starter/src/index.ts` ) ]
146
146
} ) ,
147
147
'pydantic-ai' : ( agentKeys : string [ ] ) => {
148
148
return agentKeys . reduce ( ( acc , agentId ) => ( {
149
149
...acc ,
150
- [ agentId ] : `https://github.com/pydantic/pydantic-ai/blob/main/examples/pydantic_ai_examples/ag_ui/api/${ agentId } .py`
150
+ [ agentId ] : [ `https://github.com/pydantic/pydantic-ai/blob/main/examples/pydantic_ai_examples/ag_ui/api/${ agentId } .py` ]
151
151
} ) , { } )
152
152
} ,
153
153
'server-starter' : ( ) => ( {
154
- agentic_chat : path . join ( __dirname , integrationsFolderPath , `/server-starter/server/python/example_server/__init__.py` )
154
+ agentic_chat : [ path . join ( __dirname , integrationsFolderPath , `/server-starter/server/python/example_server/__init__.py` ) ]
155
155
} ) ,
156
156
'server-starter-all-features' : ( agentKeys : string [ ] ) => {
157
157
return agentKeys . reduce ( ( acc , agentId ) => ( {
158
158
...acc ,
159
- [ agentId ] : path . join ( __dirname , integrationsFolderPath , `/server-starter/server/python/example_server/${ agentId } .py` )
159
+ [ agentId ] : [ path . join ( __dirname , integrationsFolderPath , `/server-starter-all-features /server/python/example_server/${ agentId } .py` ) ]
160
160
} ) , { } )
161
161
} ,
162
162
'mastra' : ( ) => ( {
163
- agentic_chat : path . join ( __dirname , integrationsFolderPath , `/mastra/example/src/mastra/agents/weather-agent.ts` )
163
+ agentic_chat : [ path . join ( __dirname , integrationsFolderPath , `/mastra/example/src/mastra/agents/weather-agent.ts` ) ]
164
164
} ) ,
165
165
'mastra-agent-lock' : ( ) => ( {
166
- agentic_chat : path . join ( __dirname , integrationsFolderPath , `/mastra/example/src/mastra/agents/weather-agent.ts` )
166
+ agentic_chat : [ path . join ( __dirname , integrationsFolderPath , `/mastra/example/src/mastra/agents/weather-agent.ts` ) ]
167
167
} ) ,
168
168
'vercel-ai-sdk' : ( ) => ( {
169
- agentic_chat : path . join ( __dirname , integrationsFolderPath , `/vercel-ai-sdk/src/index.ts` )
169
+ agentic_chat : [ path . join ( __dirname , integrationsFolderPath , `/vercel-ai-sdk/src/index.ts` ) ]
170
170
} ) ,
171
171
'langgraph' : ( agentKeys : string [ ] ) => {
172
172
return agentKeys . reduce ( ( acc , agentId ) => ( {
173
173
...acc ,
174
- [ agentId ] : path . join ( __dirname , integrationsFolderPath , `/langgraph/examples/agents/${ agentId } /agent.py` )
174
+ [ agentId ] : [
175
+ path . join ( __dirname , integrationsFolderPath , `/langgraph/examples/python/agents/${ agentId } /agent.py` ) ,
176
+ path . join ( __dirname , integrationsFolderPath , `/langgraph/examples/typescript/src/agents/${ agentId } /agent.ts` )
177
+ ]
175
178
} ) , { } )
176
179
} ,
177
180
'langgraph-fastapi' : ( agentKeys : string [ ] ) => {
178
181
return agentKeys . reduce ( ( acc , agentId ) => ( {
179
182
...acc ,
180
- [ agentId ] : path . join ( __dirname , integrationsFolderPath , `/langgraph/python/ag_ui_langgraph/ examples/agents/${ agentId } .py` )
183
+ [ agentId ] : [ path . join ( __dirname , integrationsFolderPath , `/langgraph/examples/python/ agents/${ agentId } /agent .py` ) ]
181
184
} ) , { } )
182
185
} ,
183
186
'agno' : ( ) => ( { } ) ,
184
187
'llama-index' : ( agentKeys : string [ ] ) => {
185
188
return agentKeys . reduce ( ( acc , agentId ) => ( {
186
189
...acc ,
187
- [ agentId ] : path . join ( __dirname , integrationsFolderPath , `/llamaindex/server-py/server/routers/${ agentId } .py` )
190
+ [ agentId ] : [ path . join ( __dirname , integrationsFolderPath , `/llamaindex/server-py/server/routers/${ agentId } .py` ) ]
188
191
} ) , { } )
189
192
} ,
190
193
'crewai' : ( agentKeys : string [ ] ) => {
191
194
return agentKeys . reduce ( ( acc , agentId ) => ( {
192
195
...acc ,
193
- [ agentId ] : path . join ( __dirname , integrationsFolderPath , `/crewai/python/ag_ui_crewai/examples/${ agentId } .py` )
196
+ [ agentId ] : [ path . join ( __dirname , integrationsFolderPath , `/crewai/python/ag_ui_crewai/examples/${ agentId } .py` ) ]
194
197
} ) , { } )
195
198
}
196
199
}
@@ -202,14 +205,16 @@ async function runGenerateContent() {
202
205
const agentsPerFeatures = agentConfig . agentKeys
203
206
204
207
const agentFilePaths = agentFilesMapper [ agentConfig . id ] ( agentConfig . agentKeys )
208
+
205
209
// Per feature, assign all the frontend files like page.tsx as well as all agent files
206
210
for ( const featureId of agentsPerFeatures ) {
211
+ const agentFilePathsForFeature = agentFilePaths [ featureId ] ?? [ ]
207
212
// @ts -expect-error -- redundant error about indexing of a new object.
208
213
result [ `${ agentConfig . id } ::${ featureId } ` ] = [
209
214
// Get all frontend files for the feature
210
215
...( await getFeatureFrontendFiles ( featureId ) ) ,
211
216
// Get the agent (python/TS) file
212
- await getFile ( agentFilePaths [ featureId ] )
217
+ ... ( await Promise . all ( agentFilePathsForFeature . map ( async f => await getFile ( f ) ) ) )
213
218
]
214
219
}
215
220
}
0 commit comments