First commit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
class ChatResponse {
|
||||
final String finalAnswer;
|
||||
final Map<String, String> rawResponses;
|
||||
|
||||
ChatResponse({required this.finalAnswer, required this.rawResponses});
|
||||
|
||||
factory ChatResponse.fromJson(Map<String, dynamic> json) {
|
||||
return ChatResponse(
|
||||
finalAnswer: json['final_answer'],
|
||||
rawResponses: Map<String, String>.from(json['raw_responses']),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
class Device {
|
||||
final String ip;
|
||||
final int port;
|
||||
|
||||
Device({required this.ip, required this.port});
|
||||
|
||||
factory Device.fromJson(Map<String, dynamic> json) {
|
||||
return Device(
|
||||
ip: json['ip'],
|
||||
port: json['port'],
|
||||
);
|
||||
}
|
||||
|
||||
String get address => '$ip:$port';
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class DocumentInfo {
|
||||
final String docId;
|
||||
final int chunks;
|
||||
|
||||
DocumentInfo({required this.docId, required this.chunks});
|
||||
|
||||
factory DocumentInfo.fromJson(Map<String, dynamic> json) {
|
||||
return DocumentInfo(
|
||||
docId: json['doc_id'],
|
||||
chunks: json['chunks'],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
class UploadResponse {
|
||||
final String message;
|
||||
final String docId;
|
||||
final int chunksIndexed;
|
||||
|
||||
UploadResponse({required this.message, required this.docId, required this.chunksIndexed});
|
||||
|
||||
factory UploadResponse.fromJson(Map<String, dynamic> json) {
|
||||
return UploadResponse(
|
||||
message: json['message'],
|
||||
docId: json['doc_id'],
|
||||
chunksIndexed: json['chunks_indexed'],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user