Files
zeekay f06a939f82 Regenerate: the AI surface says what it answers
288 of hanzoai/ai's 294 operations now declare a response, against 1 before.
GET /v1/models, POST /v1/chat/completions, /v1/embeddings, /v1/messages —
every address a client actually calls — used to reach this client untyped,
because cloud's relay carried an operation's sentence and dropped the shapes
it named. It carries both now.

Fleet-wide the document goes from 69% to 81% of operations declaring what
comes back, which is where the ~208 new models here come from.
2026-08-28 15:52:12 -07:00

849 lines
34 KiB
Dart

//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of hanzoai.cloud;
class Store {
/// Returns a new [Store] instance.
Store({
this.agentProvider,
this.avatar,
this.builtinTools = const [],
this.chatCount,
this.childModelProviders = const [],
this.childStores = const [],
this.createdTime,
this.disableFileUpload,
this.displayName,
this.embeddingProvider,
this.enableTtsStreaming,
this.exampleQuestions = const [],
this.faviconUrl,
this.fileTree,
this.footerHtml,
this.forbiddenWords = const [],
this.frequency,
this.hideThinking,
this.htmlTitle,
this.imageProvider,
this.isDefault,
this.knowledgeCount,
this.limitMinutes,
this.logoUrl,
this.memoryLimit,
this.messageCount,
this.modelProvider,
this.name,
this.navItems = const [],
this.owner,
this.prompt,
this.propertiesMap = const {},
this.searchProvider,
this.showAutoRead,
this.speechToTextProvider,
this.splitProvider,
this.state,
this.storageProvider,
this.storageSubpath,
this.suggestionCount,
this.textToSpeechProvider,
this.themeColor,
this.title,
this.vectorStoreId,
this.vectorStores = const [],
this.welcome,
this.welcomeText,
this.welcomeTitle,
});
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? agentProvider;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? avatar;
List<String> builtinTools;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
int? chatCount;
List<String> childModelProviders;
List<String> childStores;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? createdTime;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? disableFileUpload;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? displayName;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? embeddingProvider;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? enableTtsStreaming;
List<ExampleQuestion> exampleQuestions;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? faviconUrl;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
TreeFile? fileTree;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? footerHtml;
List<String> forbiddenWords;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
int? frequency;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? hideThinking;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? htmlTitle;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? imageProvider;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? isDefault;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
int? knowledgeCount;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
int? limitMinutes;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? logoUrl;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
int? memoryLimit;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
int? messageCount;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? modelProvider;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? name;
List<String> navItems;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? owner;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? prompt;
Map<String, Properties> propertiesMap;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? searchProvider;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? showAutoRead;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? speechToTextProvider;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? splitProvider;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? state;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? storageProvider;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? storageSubpath;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
int? suggestionCount;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? textToSpeechProvider;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? themeColor;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? title;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? vectorStoreId;
List<String> vectorStores;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? welcome;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? welcomeText;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? welcomeTitle;
@override
bool operator ==(Object other) => identical(this, other) || other is Store &&
other.agentProvider == agentProvider &&
other.avatar == avatar &&
_deepEquality.equals(other.builtinTools, builtinTools) &&
other.chatCount == chatCount &&
_deepEquality.equals(other.childModelProviders, childModelProviders) &&
_deepEquality.equals(other.childStores, childStores) &&
other.createdTime == createdTime &&
other.disableFileUpload == disableFileUpload &&
other.displayName == displayName &&
other.embeddingProvider == embeddingProvider &&
other.enableTtsStreaming == enableTtsStreaming &&
_deepEquality.equals(other.exampleQuestions, exampleQuestions) &&
other.faviconUrl == faviconUrl &&
other.fileTree == fileTree &&
other.footerHtml == footerHtml &&
_deepEquality.equals(other.forbiddenWords, forbiddenWords) &&
other.frequency == frequency &&
other.hideThinking == hideThinking &&
other.htmlTitle == htmlTitle &&
other.imageProvider == imageProvider &&
other.isDefault == isDefault &&
other.knowledgeCount == knowledgeCount &&
other.limitMinutes == limitMinutes &&
other.logoUrl == logoUrl &&
other.memoryLimit == memoryLimit &&
other.messageCount == messageCount &&
other.modelProvider == modelProvider &&
other.name == name &&
_deepEquality.equals(other.navItems, navItems) &&
other.owner == owner &&
other.prompt == prompt &&
_deepEquality.equals(other.propertiesMap, propertiesMap) &&
other.searchProvider == searchProvider &&
other.showAutoRead == showAutoRead &&
other.speechToTextProvider == speechToTextProvider &&
other.splitProvider == splitProvider &&
other.state == state &&
other.storageProvider == storageProvider &&
other.storageSubpath == storageSubpath &&
other.suggestionCount == suggestionCount &&
other.textToSpeechProvider == textToSpeechProvider &&
other.themeColor == themeColor &&
other.title == title &&
other.vectorStoreId == vectorStoreId &&
_deepEquality.equals(other.vectorStores, vectorStores) &&
other.welcome == welcome &&
other.welcomeText == welcomeText &&
other.welcomeTitle == welcomeTitle;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(agentProvider == null ? 0 : agentProvider!.hashCode) +
(avatar == null ? 0 : avatar!.hashCode) +
(builtinTools.hashCode) +
(chatCount == null ? 0 : chatCount!.hashCode) +
(childModelProviders.hashCode) +
(childStores.hashCode) +
(createdTime == null ? 0 : createdTime!.hashCode) +
(disableFileUpload == null ? 0 : disableFileUpload!.hashCode) +
(displayName == null ? 0 : displayName!.hashCode) +
(embeddingProvider == null ? 0 : embeddingProvider!.hashCode) +
(enableTtsStreaming == null ? 0 : enableTtsStreaming!.hashCode) +
(exampleQuestions.hashCode) +
(faviconUrl == null ? 0 : faviconUrl!.hashCode) +
(fileTree == null ? 0 : fileTree!.hashCode) +
(footerHtml == null ? 0 : footerHtml!.hashCode) +
(forbiddenWords.hashCode) +
(frequency == null ? 0 : frequency!.hashCode) +
(hideThinking == null ? 0 : hideThinking!.hashCode) +
(htmlTitle == null ? 0 : htmlTitle!.hashCode) +
(imageProvider == null ? 0 : imageProvider!.hashCode) +
(isDefault == null ? 0 : isDefault!.hashCode) +
(knowledgeCount == null ? 0 : knowledgeCount!.hashCode) +
(limitMinutes == null ? 0 : limitMinutes!.hashCode) +
(logoUrl == null ? 0 : logoUrl!.hashCode) +
(memoryLimit == null ? 0 : memoryLimit!.hashCode) +
(messageCount == null ? 0 : messageCount!.hashCode) +
(modelProvider == null ? 0 : modelProvider!.hashCode) +
(name == null ? 0 : name!.hashCode) +
(navItems.hashCode) +
(owner == null ? 0 : owner!.hashCode) +
(prompt == null ? 0 : prompt!.hashCode) +
(propertiesMap.hashCode) +
(searchProvider == null ? 0 : searchProvider!.hashCode) +
(showAutoRead == null ? 0 : showAutoRead!.hashCode) +
(speechToTextProvider == null ? 0 : speechToTextProvider!.hashCode) +
(splitProvider == null ? 0 : splitProvider!.hashCode) +
(state == null ? 0 : state!.hashCode) +
(storageProvider == null ? 0 : storageProvider!.hashCode) +
(storageSubpath == null ? 0 : storageSubpath!.hashCode) +
(suggestionCount == null ? 0 : suggestionCount!.hashCode) +
(textToSpeechProvider == null ? 0 : textToSpeechProvider!.hashCode) +
(themeColor == null ? 0 : themeColor!.hashCode) +
(title == null ? 0 : title!.hashCode) +
(vectorStoreId == null ? 0 : vectorStoreId!.hashCode) +
(vectorStores.hashCode) +
(welcome == null ? 0 : welcome!.hashCode) +
(welcomeText == null ? 0 : welcomeText!.hashCode) +
(welcomeTitle == null ? 0 : welcomeTitle!.hashCode);
@override
String toString() => 'Store[agentProvider=$agentProvider, avatar=$avatar, builtinTools=$builtinTools, chatCount=$chatCount, childModelProviders=$childModelProviders, childStores=$childStores, createdTime=$createdTime, disableFileUpload=$disableFileUpload, displayName=$displayName, embeddingProvider=$embeddingProvider, enableTtsStreaming=$enableTtsStreaming, exampleQuestions=$exampleQuestions, faviconUrl=$faviconUrl, fileTree=$fileTree, footerHtml=$footerHtml, forbiddenWords=$forbiddenWords, frequency=$frequency, hideThinking=$hideThinking, htmlTitle=$htmlTitle, imageProvider=$imageProvider, isDefault=$isDefault, knowledgeCount=$knowledgeCount, limitMinutes=$limitMinutes, logoUrl=$logoUrl, memoryLimit=$memoryLimit, messageCount=$messageCount, modelProvider=$modelProvider, name=$name, navItems=$navItems, owner=$owner, prompt=$prompt, propertiesMap=$propertiesMap, searchProvider=$searchProvider, showAutoRead=$showAutoRead, speechToTextProvider=$speechToTextProvider, splitProvider=$splitProvider, state=$state, storageProvider=$storageProvider, storageSubpath=$storageSubpath, suggestionCount=$suggestionCount, textToSpeechProvider=$textToSpeechProvider, themeColor=$themeColor, title=$title, vectorStoreId=$vectorStoreId, vectorStores=$vectorStores, welcome=$welcome, welcomeText=$welcomeText, welcomeTitle=$welcomeTitle]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.agentProvider != null) {
json[r'agentProvider'] = this.agentProvider;
} else {
json[r'agentProvider'] = null;
}
if (this.avatar != null) {
json[r'avatar'] = this.avatar;
} else {
json[r'avatar'] = null;
}
json[r'builtinTools'] = this.builtinTools;
if (this.chatCount != null) {
json[r'chatCount'] = this.chatCount;
} else {
json[r'chatCount'] = null;
}
json[r'childModelProviders'] = this.childModelProviders;
json[r'childStores'] = this.childStores;
if (this.createdTime != null) {
json[r'createdTime'] = this.createdTime;
} else {
json[r'createdTime'] = null;
}
if (this.disableFileUpload != null) {
json[r'disableFileUpload'] = this.disableFileUpload;
} else {
json[r'disableFileUpload'] = null;
}
if (this.displayName != null) {
json[r'displayName'] = this.displayName;
} else {
json[r'displayName'] = null;
}
if (this.embeddingProvider != null) {
json[r'embeddingProvider'] = this.embeddingProvider;
} else {
json[r'embeddingProvider'] = null;
}
if (this.enableTtsStreaming != null) {
json[r'enableTtsStreaming'] = this.enableTtsStreaming;
} else {
json[r'enableTtsStreaming'] = null;
}
json[r'exampleQuestions'] = this.exampleQuestions;
if (this.faviconUrl != null) {
json[r'faviconUrl'] = this.faviconUrl;
} else {
json[r'faviconUrl'] = null;
}
if (this.fileTree != null) {
json[r'fileTree'] = this.fileTree;
} else {
json[r'fileTree'] = null;
}
if (this.footerHtml != null) {
json[r'footerHtml'] = this.footerHtml;
} else {
json[r'footerHtml'] = null;
}
json[r'forbiddenWords'] = this.forbiddenWords;
if (this.frequency != null) {
json[r'frequency'] = this.frequency;
} else {
json[r'frequency'] = null;
}
if (this.hideThinking != null) {
json[r'hideThinking'] = this.hideThinking;
} else {
json[r'hideThinking'] = null;
}
if (this.htmlTitle != null) {
json[r'htmlTitle'] = this.htmlTitle;
} else {
json[r'htmlTitle'] = null;
}
if (this.imageProvider != null) {
json[r'imageProvider'] = this.imageProvider;
} else {
json[r'imageProvider'] = null;
}
if (this.isDefault != null) {
json[r'isDefault'] = this.isDefault;
} else {
json[r'isDefault'] = null;
}
if (this.knowledgeCount != null) {
json[r'knowledgeCount'] = this.knowledgeCount;
} else {
json[r'knowledgeCount'] = null;
}
if (this.limitMinutes != null) {
json[r'limitMinutes'] = this.limitMinutes;
} else {
json[r'limitMinutes'] = null;
}
if (this.logoUrl != null) {
json[r'logoUrl'] = this.logoUrl;
} else {
json[r'logoUrl'] = null;
}
if (this.memoryLimit != null) {
json[r'memoryLimit'] = this.memoryLimit;
} else {
json[r'memoryLimit'] = null;
}
if (this.messageCount != null) {
json[r'messageCount'] = this.messageCount;
} else {
json[r'messageCount'] = null;
}
if (this.modelProvider != null) {
json[r'modelProvider'] = this.modelProvider;
} else {
json[r'modelProvider'] = null;
}
if (this.name != null) {
json[r'name'] = this.name;
} else {
json[r'name'] = null;
}
json[r'navItems'] = this.navItems;
if (this.owner != null) {
json[r'owner'] = this.owner;
} else {
json[r'owner'] = null;
}
if (this.prompt != null) {
json[r'prompt'] = this.prompt;
} else {
json[r'prompt'] = null;
}
json[r'propertiesMap'] = this.propertiesMap;
if (this.searchProvider != null) {
json[r'searchProvider'] = this.searchProvider;
} else {
json[r'searchProvider'] = null;
}
if (this.showAutoRead != null) {
json[r'showAutoRead'] = this.showAutoRead;
} else {
json[r'showAutoRead'] = null;
}
if (this.speechToTextProvider != null) {
json[r'speechToTextProvider'] = this.speechToTextProvider;
} else {
json[r'speechToTextProvider'] = null;
}
if (this.splitProvider != null) {
json[r'splitProvider'] = this.splitProvider;
} else {
json[r'splitProvider'] = null;
}
if (this.state != null) {
json[r'state'] = this.state;
} else {
json[r'state'] = null;
}
if (this.storageProvider != null) {
json[r'storageProvider'] = this.storageProvider;
} else {
json[r'storageProvider'] = null;
}
if (this.storageSubpath != null) {
json[r'storageSubpath'] = this.storageSubpath;
} else {
json[r'storageSubpath'] = null;
}
if (this.suggestionCount != null) {
json[r'suggestionCount'] = this.suggestionCount;
} else {
json[r'suggestionCount'] = null;
}
if (this.textToSpeechProvider != null) {
json[r'textToSpeechProvider'] = this.textToSpeechProvider;
} else {
json[r'textToSpeechProvider'] = null;
}
if (this.themeColor != null) {
json[r'themeColor'] = this.themeColor;
} else {
json[r'themeColor'] = null;
}
if (this.title != null) {
json[r'title'] = this.title;
} else {
json[r'title'] = null;
}
if (this.vectorStoreId != null) {
json[r'vectorStoreId'] = this.vectorStoreId;
} else {
json[r'vectorStoreId'] = null;
}
json[r'vectorStores'] = this.vectorStores;
if (this.welcome != null) {
json[r'welcome'] = this.welcome;
} else {
json[r'welcome'] = null;
}
if (this.welcomeText != null) {
json[r'welcomeText'] = this.welcomeText;
} else {
json[r'welcomeText'] = null;
}
if (this.welcomeTitle != null) {
json[r'welcomeTitle'] = this.welcomeTitle;
} else {
json[r'welcomeTitle'] = null;
}
return json;
}
/// Returns a new [Store] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static Store? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "Store[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "Store[$key]" has a null value in JSON.');
});
return true;
}());
return Store(
agentProvider: mapValueOfType<String>(json, r'agentProvider'),
avatar: mapValueOfType<String>(json, r'avatar'),
builtinTools: json[r'builtinTools'] is Iterable
? (json[r'builtinTools'] as Iterable).cast<String>().toList(growable: false)
: const [],
chatCount: mapValueOfType<int>(json, r'chatCount'),
childModelProviders: json[r'childModelProviders'] is Iterable
? (json[r'childModelProviders'] as Iterable).cast<String>().toList(growable: false)
: const [],
childStores: json[r'childStores'] is Iterable
? (json[r'childStores'] as Iterable).cast<String>().toList(growable: false)
: const [],
createdTime: mapValueOfType<String>(json, r'createdTime'),
disableFileUpload: mapValueOfType<bool>(json, r'disableFileUpload'),
displayName: mapValueOfType<String>(json, r'displayName'),
embeddingProvider: mapValueOfType<String>(json, r'embeddingProvider'),
enableTtsStreaming: mapValueOfType<bool>(json, r'enableTtsStreaming'),
exampleQuestions: ExampleQuestion.listFromJson(json[r'exampleQuestions']),
faviconUrl: mapValueOfType<String>(json, r'faviconUrl'),
fileTree: TreeFile.fromJson(json[r'fileTree']),
footerHtml: mapValueOfType<String>(json, r'footerHtml'),
forbiddenWords: json[r'forbiddenWords'] is Iterable
? (json[r'forbiddenWords'] as Iterable).cast<String>().toList(growable: false)
: const [],
frequency: mapValueOfType<int>(json, r'frequency'),
hideThinking: mapValueOfType<bool>(json, r'hideThinking'),
htmlTitle: mapValueOfType<String>(json, r'htmlTitle'),
imageProvider: mapValueOfType<String>(json, r'imageProvider'),
isDefault: mapValueOfType<bool>(json, r'isDefault'),
knowledgeCount: mapValueOfType<int>(json, r'knowledgeCount'),
limitMinutes: mapValueOfType<int>(json, r'limitMinutes'),
logoUrl: mapValueOfType<String>(json, r'logoUrl'),
memoryLimit: mapValueOfType<int>(json, r'memoryLimit'),
messageCount: mapValueOfType<int>(json, r'messageCount'),
modelProvider: mapValueOfType<String>(json, r'modelProvider'),
name: mapValueOfType<String>(json, r'name'),
navItems: json[r'navItems'] is Iterable
? (json[r'navItems'] as Iterable).cast<String>().toList(growable: false)
: const [],
owner: mapValueOfType<String>(json, r'owner'),
prompt: mapValueOfType<String>(json, r'prompt'),
propertiesMap: Properties.mapFromJson(json[r'propertiesMap']),
searchProvider: mapValueOfType<String>(json, r'searchProvider'),
showAutoRead: mapValueOfType<bool>(json, r'showAutoRead'),
speechToTextProvider: mapValueOfType<String>(json, r'speechToTextProvider'),
splitProvider: mapValueOfType<String>(json, r'splitProvider'),
state: mapValueOfType<String>(json, r'state'),
storageProvider: mapValueOfType<String>(json, r'storageProvider'),
storageSubpath: mapValueOfType<String>(json, r'storageSubpath'),
suggestionCount: mapValueOfType<int>(json, r'suggestionCount'),
textToSpeechProvider: mapValueOfType<String>(json, r'textToSpeechProvider'),
themeColor: mapValueOfType<String>(json, r'themeColor'),
title: mapValueOfType<String>(json, r'title'),
vectorStoreId: mapValueOfType<String>(json, r'vectorStoreId'),
vectorStores: json[r'vectorStores'] is Iterable
? (json[r'vectorStores'] as Iterable).cast<String>().toList(growable: false)
: const [],
welcome: mapValueOfType<String>(json, r'welcome'),
welcomeText: mapValueOfType<String>(json, r'welcomeText'),
welcomeTitle: mapValueOfType<String>(json, r'welcomeTitle'),
);
}
return null;
}
static List<Store> listFromJson(dynamic json, {bool growable = false,}) {
final result = <Store>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = Store.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, Store> mapFromJson(dynamic json) {
final map = <String, Store>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = Store.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of Store-objects as value to a dart map
static Map<String, List<Store>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<Store>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = Store.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}