Files
LocalAGI/webui/react-ui/src/utils/config.js
Richard Palethorpe f6b6d5246c feat(ui): Action playground config and parameter forms
Signed-off-by: Richard Palethorpe <io@richiejp.com>
2025-04-25 16:36:19 +01:00

53 lines
1.5 KiB
JavaScript

/**
* Application configuration
*/
// Get the base URL from Vite's environment variables or default to '/app/'
export const BASE_URL = import.meta.env.BASE_URL || '/app/';
// API endpoints configuration
export const API_CONFIG = {
// Base URL for API requests
baseUrl: '/', // API endpoints are at the root, not under /app/
// Default headers for API requests
headers: {
'Content-Type': 'application/json',
},
// Endpoints
endpoints: {
// Agent endpoints
agents: '/api/agents',
agentConfig: (name) => `/api/agent/${name}/config`,
agentConfigMetadata: '/api/meta/agent/config',
createAgent: '/api/agent/create',
deleteAgent: (name) => `/api/agent/${name}`,
pauseAgent: (name) => `/api/agent/${name}/pause`,
startAgent: (name) => `/api/agent/${name}/start`,
exportAgent: (name) => `/settings/export/${name}`,
importAgent: '/settings/import',
// Group endpoints
generateGroupProfiles: '/api/agent/group/generateProfiles',
createGroup: '/api/agent/group/create',
// Chat endpoints
chat: (name) => `/api/chat/${name}`,
notify: (name) => `/notify/${name}`,
responses: '/v1/responses',
// SSE endpoint
sse: (name) => `/sse/${name}`,
// Action endpoints
listActions: '/api/actions',
actionDefinition: (name) => `/api/action/${name}/definition`,
executeAction: (name) => `/api/action/${name}/run`,
// Status endpoint
status: (name) => `/status/${name}`,
}
};