Skip to content

Commit 7b4ac41

Browse files
committed
chore: update dev demo
1 parent a40edeb commit 7b4ac41

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

dev-demo/resources/carsResourseTemplate.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import importExport from '../../plugins/adminforth-import-export/index.js';
1010
import InlineCreatePlugin from '../../plugins/adminforth-inline-create/index.js';
1111
import ListInPlaceEditPlugin from "../../plugins/adminforth-list-in-place-edit/index.js";
1212
import BulkAiFlowPlugin from '../../plugins/adminforth-bulk-ai-flow/index.js';
13+
import ForeignInlineShowPlugin from '../../plugins/adminforth-foreign-inline-show/index.js';
1314

1415

1516
import CompletionAdapterOpenAIChatGPT from '../../adapters/adminforth-completion-adapter-open-ai-chat-gpt/index.js';
@@ -18,7 +19,7 @@ import ImageGenerationAdapterOpenAI from '../../adapters/adminforth-image-genera
1819
import AdminForthStorageAdapterLocalFilesystem from "../../adapters/adminforth-storage-adapter-local/index.js";
1920
import AdminForthAdapterS3Storage from '../../adapters/adminforth-storage-adapter-amazon-s3/index.js';
2021
import AdminForthImageVisionAdapterOpenAi from '../../adapters/adminforth-image-vision-adapter-openai/index.js';
21-
import { logger } from 'adminforth'
22+
import { logger } from '../../adminforth/modules/logger.js';
2223
import { afLogger } from '../../adminforth/modules/logger.js';
2324

2425
export default function carsResourseTemplate(resourceId: string, dataSource: string, pkFileldName: string) {
@@ -224,7 +225,9 @@ export default function carsResourseTemplate(resourceId: string, dataSource: str
224225
new ListInPlaceEditPlugin({
225226
columns: ["model", "engine_type", "price"],
226227
}),
227-
228+
new ForeignInlineShowPlugin({
229+
foreignResourceId: 'adminuser',
230+
}),
228231
/*********************************************************************************
229232
230233
AI Plugins
@@ -271,16 +274,17 @@ export default function carsResourseTemplate(resourceId: string, dataSource: str
271274
new BulkAiFlowPlugin({
272275
actionName: 'Generate description and Price',
273276
askConfirmationBeforeGenerating: true,
274-
textCompleteAdapter: new CompletionAdapterGoogleGemini({
275-
geminiApiKey: process.env.GEMINI_API_KEY as string,
276-
expert: {
277-
temperature: 0.7
278-
}
279-
}),
280-
fillPlainFields: {
281-
description: "Create a desription for the car with name {{model}} and engine type {{engine_type}}. Desription should be HTML formatted.",
282-
price: "Based on the car model {{model}} and engine type {{engine_type}}, suggest a competitive market price in USD. Return only the numeric value.",
283-
}
277+
textCompleteAdapter: new CompletionAdapterOpenAIChatGPT({
278+
openAiApiKey: process.env.OPENAI_API_KEY as string,
279+
model: "gpt-5.2",
280+
expert: {
281+
temperature: 0.7,
282+
},
283+
}),
284+
fillPlainFields: {
285+
description: "Create a desription for the car with name {{model}} and engine type {{engine_type}}. Desription should be HTML formatted.",
286+
price: "Based on the car model {{model}} and engine type {{engine_type}}, suggest a competitive market price in USD. Return only the numeric value.",
287+
}
284288
}),
285289
new BulkAiFlowPlugin({
286290
actionName: 'Analyze image',

0 commit comments

Comments
 (0)