@mindmakr/gs-websdk
Version:
Web SDK for Guru SaaS System - Complete JavaScript/TypeScript SDK for building applications with dynamic schema management
118 lines • 4.33 kB
JavaScript
;
/**
* AI Enhancement Service Module
* Provides AI-powered schema generation and field enhancement capabilities
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.AIService = void 0;
class AIService {
constructor(client) {
this.client = client;
}
// ============================================================================
// HEALTH STATUS (ACTUAL ENDPOINT)
// ============================================================================
/**
* Get AI service health status (ACTUAL ENDPOINT)
*/
async getHealthStatus(config) {
return this.client.get('/health', config);
}
// ============================================================================
// SCHEMA KNOWLEDGE (ACTUAL ENDPOINT)
// ============================================================================
/**
* Get schema knowledge for a business domain and category
*/
async getSchemaKnowledge(businessDomain, category, config) {
return this.client.get(`/api/v1/ai/schema-knowledge?businessDomain=${encodeURIComponent(businessDomain)}&category=${encodeURIComponent(category)}`, config);
}
// ============================================================================
// SCHEMA EDITING (ACTUAL ENDPOINT)
// ============================================================================
/**
* Edit schema with AI assistance
*/
async editSchema(request, config) {
return this.client.post('/api/v1/ai/edit-schema', request, config);
}
// ============================================================================
// CONVERSATION MANAGEMENT (ACTUAL ENDPOINTS)
// ============================================================================
/**
* Create a new conversation
*/
async createConversation(data, config) {
const response = await this.client.post('/api/v1/ai/conversations', data, config);
return response.data;
}
/**
* Get all conversations
*/
async getConversations(config) {
const response = await this.client.get('/api/v1/ai/conversations', config);
return response.data || [];
}
/**
* Get a specific conversation by ID
*/
async getConversation(conversationId, config) {
const response = await this.client.get(`/api/v1/ai/conversations/${conversationId}`, config);
return response.data;
}
/**
* Delete a conversation
*/
async deleteConversation(conversationId, config) {
await this.client.delete(`/api/v1/ai/conversations/${conversationId}`, config);
}
/**
* Process a conversation message
*/
async processConversation(data, config) {
const response = await this.client.post('/api/v1/ai/conversation', data, config);
return response.data;
}
/**
* Execute AI function
*/
async executeFunction(data, config) {
return this.client.post('/api/v1/ai/execute-function', data, config);
}
// ============================================================================
// CONTEXT ENHANCEMENT
// ============================================================================
/**
* Analyze context for AI suggestions
*/
async analyzeContext(data, config) {
return this.client.post('/api/v1/ai/analyze-context', data, config);
}
/**
* Suggest field name based on context
*/
async suggestFieldName(data, config) {
return this.client.post('/api/v1/ai/suggest-field-name', data, config);
}
/**
* Suggest validation rules for a field
*/
async suggestValidation(data, config) {
return this.client.post('/api/v1/ai/suggest-validation', data, config);
}
/**
* Suggest field type based on context
*/
async suggestFieldType(data, config) {
return this.client.post('/api/v1/ai/suggest-field-type', data, config);
}
/**
* Suggest field enhancements for schema
* Note: This endpoint may not be working according to api-status.md
*/
async suggestFields(data, config) {
return this.client.post('/api/v1/ai/suggest-fields', data, config);
}
}
exports.AIService = AIService;
//# sourceMappingURL=ai.js.map