| // GENERATED CODE - DO NOT MODIFY BY HAND |
| // This code was generated by ObjectBox. To update it run the generator again |
| // with `dart run build_runner build`. |
| // See also https://docs.objectbox.io/getting-started#generate-objectbox-code |
| |
| // ignore_for_file: camel_case_types, depend_on_referenced_packages |
| // coverage:ignore-file |
| |
| import 'dart:typed_data'; |
| |
| import 'package:flat_buffers/flat_buffers.dart' as fb; |
| import 'package:objectbox/internal.dart' |
| as obx_int; // generated code can access "internal" functionality |
| import 'package:objectbox/objectbox.dart' as obx; |
| |
| import 'src/rag_models.dart'; |
| |
| export 'package:objectbox/objectbox.dart'; // so that callers only have to import this file |
| |
| final _entities = <obx_int.ModelEntity>[ |
| obx_int.ModelEntity( |
| id: const obx_int.IdUid(1, 7960413809486009791), |
| name: 'ClassSummaryRAGModel', |
| lastPropertyId: const obx_int.IdUid(3, 8923258437156876593), |
| flags: 0, |
| properties: <obx_int.ModelProperty>[ |
| obx_int.ModelProperty( |
| id: const obx_int.IdUid(1, 8829639415366563528), |
| name: 'id', |
| type: 6, |
| flags: 1, |
| ), |
| obx_int.ModelProperty( |
| id: const obx_int.IdUid(2, 3000549143352790148), |
| name: 'summary', |
| type: 9, |
| flags: 0, |
| ), |
| obx_int.ModelProperty( |
| id: const obx_int.IdUid(3, 8923258437156876593), |
| name: 'embeddings', |
| type: 28, |
| flags: 8, |
| indexId: const obx_int.IdUid(1, 6912840214801688687), |
| hnswParams: obx_int.ModelHnswParams(dimensions: 3072, distanceType: 2), |
| ), |
| ], |
| relations: <obx_int.ModelRelation>[], |
| backlinks: <obx_int.ModelBacklink>[], |
| ), |
| ]; |
| |
| /// Shortcut for [obx.Store.new] that passes [getObjectBoxModel] and for Flutter |
| /// apps by default a [directory] using `defaultStoreDirectory()` from the |
| /// ObjectBox Flutter library. |
| /// |
| /// Note: for desktop apps it is recommended to specify a unique [directory]. |
| /// |
| /// See [obx.Store.new] for an explanation of all parameters. |
| /// |
| /// For Flutter apps, also calls `loadObjectBoxLibraryAndroidCompat()` from |
| /// the ObjectBox Flutter library to fix loading the native ObjectBox library |
| /// on Android 6 and older. |
| obx.Store openStore({ |
| String? directory, |
| int? maxDBSizeInKB, |
| int? maxDataSizeInKB, |
| int? fileMode, |
| int? maxReaders, |
| bool queriesCaseSensitiveDefault = true, |
| String? macosApplicationGroup, |
| }) => obx.Store( |
| getObjectBoxModel(), |
| directory: directory, |
| maxDBSizeInKB: maxDBSizeInKB, |
| maxDataSizeInKB: maxDataSizeInKB, |
| fileMode: fileMode, |
| maxReaders: maxReaders, |
| queriesCaseSensitiveDefault: queriesCaseSensitiveDefault, |
| macosApplicationGroup: macosApplicationGroup, |
| ); |
| |
| /// Returns the ObjectBox model definition for this project for use with |
| /// [obx.Store.new]. |
| obx_int.ModelDefinition getObjectBoxModel() { |
| final model = obx_int.ModelInfo( |
| entities: _entities, |
| lastEntityId: const obx_int.IdUid(1, 7960413809486009791), |
| lastIndexId: const obx_int.IdUid(1, 6912840214801688687), |
| lastRelationId: const obx_int.IdUid(0, 0), |
| lastSequenceId: const obx_int.IdUid(0, 0), |
| retiredEntityUids: const [], |
| retiredIndexUids: const [], |
| retiredPropertyUids: const [], |
| retiredRelationUids: const [], |
| modelVersion: 5, |
| modelVersionParserMinimum: 5, |
| version: 1, |
| ); |
| |
| final bindings = <Type, obx_int.EntityDefinition<ClassSummaryRAGModel>>{ |
| ClassSummaryRAGModel: obx_int.EntityDefinition<ClassSummaryRAGModel>( |
| model: _entities[0], |
| toOneRelations: (ClassSummaryRAGModel object) => [], |
| toManyRelations: (ClassSummaryRAGModel object) => {}, |
| getId: (ClassSummaryRAGModel object) => object.id, |
| setId: (ClassSummaryRAGModel object, int id) { |
| object.id = id; |
| }, |
| objectToFB: (ClassSummaryRAGModel object, fb.Builder fbb) { |
| final summaryOffset = fbb.writeString(object.summary); |
| final embeddingsOffset = fbb.writeListFloat32(object.embeddings); |
| fbb.startTable(4); |
| fbb.addInt64(0, object.id); |
| fbb.addOffset(1, summaryOffset); |
| fbb.addOffset(2, embeddingsOffset); |
| fbb.finish(fbb.endTable()); |
| return object.id; |
| }, |
| objectFromFB: (obx.Store store, ByteData fbData) { |
| final buffer = fb.BufferContext(fbData); |
| final rootOffset = buffer.derefObject(0); |
| final summaryParam = const fb.StringReader( |
| asciiOptimization: true, |
| ).vTableGet(buffer, rootOffset, 6, ''); |
| final embeddingsParam = const fb.ListReader<double>( |
| fb.Float32Reader(), |
| lazy: false, |
| ).vTableGet(buffer, rootOffset, 8, []); |
| final object = ClassSummaryRAGModel(summaryParam, embeddingsParam) |
| ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0); |
| |
| return object; |
| }, |
| ), |
| }; |
| |
| return obx_int.ModelDefinition(model, bindings); |
| } |
| |
| /// [ClassSummaryRAGModel] entity fields to define ObjectBox queries. |
| class ClassSummaryRAGModel_ { |
| /// See [ClassSummaryRAGModel.id]. |
| static final id = obx.QueryIntegerProperty<ClassSummaryRAGModel>( |
| _entities[0].properties[0], |
| ); |
| |
| /// See [ClassSummaryRAGModel.summary]. |
| static final summary = obx.QueryStringProperty<ClassSummaryRAGModel>( |
| _entities[0].properties[1], |
| ); |
| |
| /// See [ClassSummaryRAGModel.embeddings]. |
| static final embeddings = obx.QueryHnswProperty<ClassSummaryRAGModel>( |
| _entities[0].properties[2], |
| ); |
| } |