Files
apidash/packages/genai/tool/json_to_dart.dart
Ankit Mahato 72fea1ba65 Refactor genai package to new modular interface
Reorganized the genai package by removing legacy LLM-related files and introducing a new modular interface under the 'interface' directory. Added provider-specific model classes, centralized constants, and updated the example to use the new API and data structures. Updated exports in genai.dart and improved dependency management.
2025-08-27 02:08:36 +05:30

18 lines
438 B
Dart

import 'dart:convert';
import 'dart:io';
void main() {
final inputFile = File('models.json');
final outputFile = File('lib/models/models_data.g.dart');
final jsonData = jsonDecode(inputFile.readAsStringSync());
final dartCode =
'''
// GENERATED CODE - DO NOT MODIFY BY HAND
const kModelsData = ${jsonEncode(jsonData)};
''';
outputFile.writeAsStringSync(dartCode);
print('✅ Generated data.g.dart from data.json');
}