Untitled
unknown
plain_text
a year ago
602 B
11
Indexable
@Service
public class QueryService {
@Autowired
private SimpleQueryExecutor queryExecutor;
public QueryResponse processNaturalLanguageQuery(String userQuery) {
// 1. Get SQL from LLM (from your previous implementation)
String generatedSQL = llmService.generateSQL(userQuery);
// 2. Validate SQL (important!)
validateSQL(generatedSQL);
// 3. Execute query
List<Map<String, Object>> results = queryExecutor.executeQuery(generatedSQL);
// 4. Format response
return formatResponse(results);
}
}Editor is loading...
Leave a Comment