@@ -8,33 +8,8 @@ import AdminForthStorageAdapterLocalFilesystem from "../../adapters/adminforth-s
88import OpenSignupPlugin from '../../plugins/adminforth-open-signup/index.js' ;
99import DashboardPlugin from '../../plugins/adminforth-dashboard/index.js' ;
1010import KeyValueAdapterRam from '../../adapters/adminforth-key-value-adapter-ram/index.js' ;
11- import AdminForthAgent from '../../plugins/adminforth-agent/index.js' ;
12- import CompletionAdapterOpenAIResponses from '../../adapters/adminforth-completion-adapter-openai-responses/index.js' ;
13- import OpenAIAudioAdapter from '../../adapters/adminforth-audio-adapter-openai/index.js' ;
1411import OAuthPlugin from './configs/oauthPluginConfig.js' ;
1512
16- const OVH_AI_ENDPOINTS_BASE_URL = 'https://oai.endpoints.kepler.ai.cloud.ovh.net/v1' ;
17- const ovhAiEndpointsAccessToken = process . env . OVH_AI_ENDPOINTS_ACCESS_TOKEN ;
18- const openAiResponsesApiKey = ovhAiEndpointsAccessToken || process . env . OPENAI_API_KEY ;
19- const usesOvhAiEndpoints = Boolean ( ovhAiEndpointsAccessToken ) ;
20-
21- function createAgentCompletionAdapter (
22- model : string ,
23- effort : 'low' | 'medium' | 'xhigh' ,
24- ) {
25- return new CompletionAdapterOpenAIResponses ( {
26- openAiApiKey : openAiResponsesApiKey as string ,
27- baseUrl : usesOvhAiEndpoints ? OVH_AI_ENDPOINTS_BASE_URL : undefined ,
28- model : usesOvhAiEndpoints ? 'gpt-oss-120b' : model ,
29- extraRequestBodyParameters : {
30- ...( usesOvhAiEndpoints ? { store : false } : { } ) ,
31- reasoning : {
32- effort,
33- } ,
34- } ,
35- } ) ;
36- }
37-
3813async function allowedForSuperAdmin ( { adminUser } : { adminUser : AdminUser } ) : Promise < boolean > {
3914 return adminUser . dbUser . role === 'superadmin' ;
4015}
@@ -198,53 +173,6 @@ export default {
198173 } ,
199174 } ) ,
200175 OAuthPlugin ,
201- ...( process . env . OPENAI_API_KEY ?
202- [
203- new AdminForthAgent ( {
204- audioAdapter : new OpenAIAudioAdapter ( {
205- apiKey : process . env . OPENAI_API_KEY ,
206- } ) ,
207- placeholderMessages : async ( { adminUser, httpExtra } ) => {
208- return [
209- "What is a cars count in SQLite" ,
210- "Build average car price by days chart in SQLite" ,
211- ]
212- } ,
213- modes : [
214- {
215- name : 'Balanced' ,
216- completionAdapter : createAgentCompletionAdapter ( 'gpt-5.4-mini' , 'medium' ) ,
217- } ,
218- {
219- name : 'Fast' ,
220- completionAdapter : createAgentCompletionAdapter ( 'gpt-5.4-mini' , 'low' ) ,
221- } ,
222- {
223- name : 'Smart Thinking' ,
224- completionAdapter : createAgentCompletionAdapter ( 'gpt-5.4' , 'xhigh' ) ,
225- } ,
226- ] ,
227- maxTokens : 10000 ,
228- reasoning : 'none' ,
229- sessionResource : {
230- resourceId : 'sessions' ,
231- idField : 'id' ,
232- titleField : 'title' ,
233- turnsField : 'turns' ,
234- askerIdField : 'asker_id' ,
235- createdAtField : 'created_at' ,
236- } ,
237- turnResource : {
238- resourceId : 'turns' ,
239- idField : 'id' ,
240- sessionIdField : 'session_id' ,
241- createdAtField : 'created_at' ,
242- promptField : 'prompt' ,
243- responseField : 'response' ,
244- debugField : 'dubbug' ,
245- } ,
246- } ) ,
247- ] : [ ] ) ,
248176 new DashboardPlugin ( {
249177 dashboardConfigsResourceId : 'dashboard_configs' ,
250178 } ) ,
0 commit comments