mirror of
https://github.com/hanzo-dart/sdk.git
synced 2026-10-30 19:32:47 +00:00
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.
890 lines
34 KiB
Dart
890 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 Provider {
|
|
/// Returns a new [Provider] instance.
|
|
Provider({
|
|
this.apiVersion,
|
|
this.asset,
|
|
this.browserUrl,
|
|
this.category,
|
|
this.chain,
|
|
this.clientId,
|
|
this.clientSecret,
|
|
this.compatibleProvider,
|
|
this.configText,
|
|
this.contractMethod,
|
|
this.contractName,
|
|
this.createdTime,
|
|
this.currency,
|
|
this.displayName,
|
|
this.enableThinking,
|
|
this.errorText,
|
|
this.flavor,
|
|
this.frequencyPenalty,
|
|
this.inputPricePerThousandTokens,
|
|
this.isDefault,
|
|
this.isRemote,
|
|
this.mcpTools = const [],
|
|
this.name,
|
|
this.network,
|
|
this.outputPricePerThousandTokens,
|
|
this.owner,
|
|
this.presencePenalty,
|
|
this.providerKey,
|
|
this.providerUrl,
|
|
this.rawText,
|
|
this.region,
|
|
this.resultSummary,
|
|
this.runner,
|
|
this.signCert,
|
|
this.signKey,
|
|
this.state,
|
|
this.subType,
|
|
this.target,
|
|
this.targetMode,
|
|
this.temperature,
|
|
this.testContent,
|
|
this.text,
|
|
this.topK,
|
|
this.topP,
|
|
this.type,
|
|
this.userCert,
|
|
this.userKey,
|
|
});
|
|
///
|
|
/// 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? apiVersion;
|
|
|
|
///
|
|
/// 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? asset;
|
|
|
|
///
|
|
/// 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? browserUrl;
|
|
|
|
///
|
|
/// 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? category;
|
|
|
|
///
|
|
/// 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? chain;
|
|
|
|
///
|
|
/// 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? clientId;
|
|
|
|
///
|
|
/// 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? clientSecret;
|
|
|
|
///
|
|
/// 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? compatibleProvider;
|
|
|
|
///
|
|
/// 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? configText;
|
|
|
|
///
|
|
/// 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? contractMethod;
|
|
|
|
///
|
|
/// 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? contractName;
|
|
|
|
///
|
|
/// 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.
|
|
///
|
|
String? currency;
|
|
|
|
///
|
|
/// 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.
|
|
///
|
|
bool? enableThinking;
|
|
|
|
///
|
|
/// 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? errorText;
|
|
|
|
///
|
|
/// 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? flavor;
|
|
|
|
///
|
|
/// 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.
|
|
///
|
|
num? frequencyPenalty;
|
|
|
|
///
|
|
/// 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.
|
|
///
|
|
num? inputPricePerThousandTokens;
|
|
|
|
///
|
|
/// 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.
|
|
///
|
|
bool? isRemote;
|
|
|
|
List<AgentMcpTools> mcpTools;
|
|
|
|
///
|
|
/// 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;
|
|
|
|
///
|
|
/// 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? network;
|
|
|
|
///
|
|
/// 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.
|
|
///
|
|
num? outputPricePerThousandTokens;
|
|
|
|
///
|
|
/// 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.
|
|
///
|
|
num? presencePenalty;
|
|
|
|
///
|
|
/// 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? providerKey;
|
|
|
|
///
|
|
/// 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? providerUrl;
|
|
|
|
///
|
|
/// 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? rawText;
|
|
|
|
///
|
|
/// 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? region;
|
|
|
|
///
|
|
/// 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? resultSummary;
|
|
|
|
///
|
|
/// 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? runner;
|
|
|
|
///
|
|
/// 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? signCert;
|
|
|
|
///
|
|
/// 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? signKey;
|
|
|
|
///
|
|
/// 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? subType;
|
|
|
|
///
|
|
/// 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? target;
|
|
|
|
///
|
|
/// 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? targetMode;
|
|
|
|
///
|
|
/// 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.
|
|
///
|
|
num? temperature;
|
|
|
|
///
|
|
/// 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? testContent;
|
|
|
|
///
|
|
/// 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? text;
|
|
|
|
///
|
|
/// 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? topK;
|
|
|
|
///
|
|
/// 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.
|
|
///
|
|
num? topP;
|
|
|
|
///
|
|
/// 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? type;
|
|
|
|
///
|
|
/// 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? userCert;
|
|
|
|
///
|
|
/// 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? userKey;
|
|
|
|
@override
|
|
bool operator ==(Object other) => identical(this, other) || other is Provider &&
|
|
other.apiVersion == apiVersion &&
|
|
other.asset == asset &&
|
|
other.browserUrl == browserUrl &&
|
|
other.category == category &&
|
|
other.chain == chain &&
|
|
other.clientId == clientId &&
|
|
other.clientSecret == clientSecret &&
|
|
other.compatibleProvider == compatibleProvider &&
|
|
other.configText == configText &&
|
|
other.contractMethod == contractMethod &&
|
|
other.contractName == contractName &&
|
|
other.createdTime == createdTime &&
|
|
other.currency == currency &&
|
|
other.displayName == displayName &&
|
|
other.enableThinking == enableThinking &&
|
|
other.errorText == errorText &&
|
|
other.flavor == flavor &&
|
|
other.frequencyPenalty == frequencyPenalty &&
|
|
other.inputPricePerThousandTokens == inputPricePerThousandTokens &&
|
|
other.isDefault == isDefault &&
|
|
other.isRemote == isRemote &&
|
|
_deepEquality.equals(other.mcpTools, mcpTools) &&
|
|
other.name == name &&
|
|
other.network == network &&
|
|
other.outputPricePerThousandTokens == outputPricePerThousandTokens &&
|
|
other.owner == owner &&
|
|
other.presencePenalty == presencePenalty &&
|
|
other.providerKey == providerKey &&
|
|
other.providerUrl == providerUrl &&
|
|
other.rawText == rawText &&
|
|
other.region == region &&
|
|
other.resultSummary == resultSummary &&
|
|
other.runner == runner &&
|
|
other.signCert == signCert &&
|
|
other.signKey == signKey &&
|
|
other.state == state &&
|
|
other.subType == subType &&
|
|
other.target == target &&
|
|
other.targetMode == targetMode &&
|
|
other.temperature == temperature &&
|
|
other.testContent == testContent &&
|
|
other.text == text &&
|
|
other.topK == topK &&
|
|
other.topP == topP &&
|
|
other.type == type &&
|
|
other.userCert == userCert &&
|
|
other.userKey == userKey;
|
|
|
|
@override
|
|
int get hashCode =>
|
|
// ignore: unnecessary_parenthesis
|
|
(apiVersion == null ? 0 : apiVersion!.hashCode) +
|
|
(asset == null ? 0 : asset!.hashCode) +
|
|
(browserUrl == null ? 0 : browserUrl!.hashCode) +
|
|
(category == null ? 0 : category!.hashCode) +
|
|
(chain == null ? 0 : chain!.hashCode) +
|
|
(clientId == null ? 0 : clientId!.hashCode) +
|
|
(clientSecret == null ? 0 : clientSecret!.hashCode) +
|
|
(compatibleProvider == null ? 0 : compatibleProvider!.hashCode) +
|
|
(configText == null ? 0 : configText!.hashCode) +
|
|
(contractMethod == null ? 0 : contractMethod!.hashCode) +
|
|
(contractName == null ? 0 : contractName!.hashCode) +
|
|
(createdTime == null ? 0 : createdTime!.hashCode) +
|
|
(currency == null ? 0 : currency!.hashCode) +
|
|
(displayName == null ? 0 : displayName!.hashCode) +
|
|
(enableThinking == null ? 0 : enableThinking!.hashCode) +
|
|
(errorText == null ? 0 : errorText!.hashCode) +
|
|
(flavor == null ? 0 : flavor!.hashCode) +
|
|
(frequencyPenalty == null ? 0 : frequencyPenalty!.hashCode) +
|
|
(inputPricePerThousandTokens == null ? 0 : inputPricePerThousandTokens!.hashCode) +
|
|
(isDefault == null ? 0 : isDefault!.hashCode) +
|
|
(isRemote == null ? 0 : isRemote!.hashCode) +
|
|
(mcpTools.hashCode) +
|
|
(name == null ? 0 : name!.hashCode) +
|
|
(network == null ? 0 : network!.hashCode) +
|
|
(outputPricePerThousandTokens == null ? 0 : outputPricePerThousandTokens!.hashCode) +
|
|
(owner == null ? 0 : owner!.hashCode) +
|
|
(presencePenalty == null ? 0 : presencePenalty!.hashCode) +
|
|
(providerKey == null ? 0 : providerKey!.hashCode) +
|
|
(providerUrl == null ? 0 : providerUrl!.hashCode) +
|
|
(rawText == null ? 0 : rawText!.hashCode) +
|
|
(region == null ? 0 : region!.hashCode) +
|
|
(resultSummary == null ? 0 : resultSummary!.hashCode) +
|
|
(runner == null ? 0 : runner!.hashCode) +
|
|
(signCert == null ? 0 : signCert!.hashCode) +
|
|
(signKey == null ? 0 : signKey!.hashCode) +
|
|
(state == null ? 0 : state!.hashCode) +
|
|
(subType == null ? 0 : subType!.hashCode) +
|
|
(target == null ? 0 : target!.hashCode) +
|
|
(targetMode == null ? 0 : targetMode!.hashCode) +
|
|
(temperature == null ? 0 : temperature!.hashCode) +
|
|
(testContent == null ? 0 : testContent!.hashCode) +
|
|
(text == null ? 0 : text!.hashCode) +
|
|
(topK == null ? 0 : topK!.hashCode) +
|
|
(topP == null ? 0 : topP!.hashCode) +
|
|
(type == null ? 0 : type!.hashCode) +
|
|
(userCert == null ? 0 : userCert!.hashCode) +
|
|
(userKey == null ? 0 : userKey!.hashCode);
|
|
|
|
@override
|
|
String toString() => 'Provider[apiVersion=$apiVersion, asset=$asset, browserUrl=$browserUrl, category=$category, chain=$chain, clientId=$clientId, clientSecret=$clientSecret, compatibleProvider=$compatibleProvider, configText=$configText, contractMethod=$contractMethod, contractName=$contractName, createdTime=$createdTime, currency=$currency, displayName=$displayName, enableThinking=$enableThinking, errorText=$errorText, flavor=$flavor, frequencyPenalty=$frequencyPenalty, inputPricePerThousandTokens=$inputPricePerThousandTokens, isDefault=$isDefault, isRemote=$isRemote, mcpTools=$mcpTools, name=$name, network=$network, outputPricePerThousandTokens=$outputPricePerThousandTokens, owner=$owner, presencePenalty=$presencePenalty, providerKey=$providerKey, providerUrl=$providerUrl, rawText=$rawText, region=$region, resultSummary=$resultSummary, runner=$runner, signCert=$signCert, signKey=$signKey, state=$state, subType=$subType, target=$target, targetMode=$targetMode, temperature=$temperature, testContent=$testContent, text=$text, topK=$topK, topP=$topP, type=$type, userCert=$userCert, userKey=$userKey]';
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final json = <String, dynamic>{};
|
|
if (this.apiVersion != null) {
|
|
json[r'apiVersion'] = this.apiVersion;
|
|
} else {
|
|
json[r'apiVersion'] = null;
|
|
}
|
|
if (this.asset != null) {
|
|
json[r'asset'] = this.asset;
|
|
} else {
|
|
json[r'asset'] = null;
|
|
}
|
|
if (this.browserUrl != null) {
|
|
json[r'browserUrl'] = this.browserUrl;
|
|
} else {
|
|
json[r'browserUrl'] = null;
|
|
}
|
|
if (this.category != null) {
|
|
json[r'category'] = this.category;
|
|
} else {
|
|
json[r'category'] = null;
|
|
}
|
|
if (this.chain != null) {
|
|
json[r'chain'] = this.chain;
|
|
} else {
|
|
json[r'chain'] = null;
|
|
}
|
|
if (this.clientId != null) {
|
|
json[r'clientId'] = this.clientId;
|
|
} else {
|
|
json[r'clientId'] = null;
|
|
}
|
|
if (this.clientSecret != null) {
|
|
json[r'clientSecret'] = this.clientSecret;
|
|
} else {
|
|
json[r'clientSecret'] = null;
|
|
}
|
|
if (this.compatibleProvider != null) {
|
|
json[r'compatibleProvider'] = this.compatibleProvider;
|
|
} else {
|
|
json[r'compatibleProvider'] = null;
|
|
}
|
|
if (this.configText != null) {
|
|
json[r'configText'] = this.configText;
|
|
} else {
|
|
json[r'configText'] = null;
|
|
}
|
|
if (this.contractMethod != null) {
|
|
json[r'contractMethod'] = this.contractMethod;
|
|
} else {
|
|
json[r'contractMethod'] = null;
|
|
}
|
|
if (this.contractName != null) {
|
|
json[r'contractName'] = this.contractName;
|
|
} else {
|
|
json[r'contractName'] = null;
|
|
}
|
|
if (this.createdTime != null) {
|
|
json[r'createdTime'] = this.createdTime;
|
|
} else {
|
|
json[r'createdTime'] = null;
|
|
}
|
|
if (this.currency != null) {
|
|
json[r'currency'] = this.currency;
|
|
} else {
|
|
json[r'currency'] = null;
|
|
}
|
|
if (this.displayName != null) {
|
|
json[r'displayName'] = this.displayName;
|
|
} else {
|
|
json[r'displayName'] = null;
|
|
}
|
|
if (this.enableThinking != null) {
|
|
json[r'enableThinking'] = this.enableThinking;
|
|
} else {
|
|
json[r'enableThinking'] = null;
|
|
}
|
|
if (this.errorText != null) {
|
|
json[r'errorText'] = this.errorText;
|
|
} else {
|
|
json[r'errorText'] = null;
|
|
}
|
|
if (this.flavor != null) {
|
|
json[r'flavor'] = this.flavor;
|
|
} else {
|
|
json[r'flavor'] = null;
|
|
}
|
|
if (this.frequencyPenalty != null) {
|
|
json[r'frequencyPenalty'] = this.frequencyPenalty;
|
|
} else {
|
|
json[r'frequencyPenalty'] = null;
|
|
}
|
|
if (this.inputPricePerThousandTokens != null) {
|
|
json[r'inputPricePerThousandTokens'] = this.inputPricePerThousandTokens;
|
|
} else {
|
|
json[r'inputPricePerThousandTokens'] = null;
|
|
}
|
|
if (this.isDefault != null) {
|
|
json[r'isDefault'] = this.isDefault;
|
|
} else {
|
|
json[r'isDefault'] = null;
|
|
}
|
|
if (this.isRemote != null) {
|
|
json[r'isRemote'] = this.isRemote;
|
|
} else {
|
|
json[r'isRemote'] = null;
|
|
}
|
|
json[r'mcpTools'] = this.mcpTools;
|
|
if (this.name != null) {
|
|
json[r'name'] = this.name;
|
|
} else {
|
|
json[r'name'] = null;
|
|
}
|
|
if (this.network != null) {
|
|
json[r'network'] = this.network;
|
|
} else {
|
|
json[r'network'] = null;
|
|
}
|
|
if (this.outputPricePerThousandTokens != null) {
|
|
json[r'outputPricePerThousandTokens'] = this.outputPricePerThousandTokens;
|
|
} else {
|
|
json[r'outputPricePerThousandTokens'] = null;
|
|
}
|
|
if (this.owner != null) {
|
|
json[r'owner'] = this.owner;
|
|
} else {
|
|
json[r'owner'] = null;
|
|
}
|
|
if (this.presencePenalty != null) {
|
|
json[r'presencePenalty'] = this.presencePenalty;
|
|
} else {
|
|
json[r'presencePenalty'] = null;
|
|
}
|
|
if (this.providerKey != null) {
|
|
json[r'providerKey'] = this.providerKey;
|
|
} else {
|
|
json[r'providerKey'] = null;
|
|
}
|
|
if (this.providerUrl != null) {
|
|
json[r'providerUrl'] = this.providerUrl;
|
|
} else {
|
|
json[r'providerUrl'] = null;
|
|
}
|
|
if (this.rawText != null) {
|
|
json[r'rawText'] = this.rawText;
|
|
} else {
|
|
json[r'rawText'] = null;
|
|
}
|
|
if (this.region != null) {
|
|
json[r'region'] = this.region;
|
|
} else {
|
|
json[r'region'] = null;
|
|
}
|
|
if (this.resultSummary != null) {
|
|
json[r'resultSummary'] = this.resultSummary;
|
|
} else {
|
|
json[r'resultSummary'] = null;
|
|
}
|
|
if (this.runner != null) {
|
|
json[r'runner'] = this.runner;
|
|
} else {
|
|
json[r'runner'] = null;
|
|
}
|
|
if (this.signCert != null) {
|
|
json[r'signCert'] = this.signCert;
|
|
} else {
|
|
json[r'signCert'] = null;
|
|
}
|
|
if (this.signKey != null) {
|
|
json[r'signKey'] = this.signKey;
|
|
} else {
|
|
json[r'signKey'] = null;
|
|
}
|
|
if (this.state != null) {
|
|
json[r'state'] = this.state;
|
|
} else {
|
|
json[r'state'] = null;
|
|
}
|
|
if (this.subType != null) {
|
|
json[r'subType'] = this.subType;
|
|
} else {
|
|
json[r'subType'] = null;
|
|
}
|
|
if (this.target != null) {
|
|
json[r'target'] = this.target;
|
|
} else {
|
|
json[r'target'] = null;
|
|
}
|
|
if (this.targetMode != null) {
|
|
json[r'targetMode'] = this.targetMode;
|
|
} else {
|
|
json[r'targetMode'] = null;
|
|
}
|
|
if (this.temperature != null) {
|
|
json[r'temperature'] = this.temperature;
|
|
} else {
|
|
json[r'temperature'] = null;
|
|
}
|
|
if (this.testContent != null) {
|
|
json[r'testContent'] = this.testContent;
|
|
} else {
|
|
json[r'testContent'] = null;
|
|
}
|
|
if (this.text != null) {
|
|
json[r'text'] = this.text;
|
|
} else {
|
|
json[r'text'] = null;
|
|
}
|
|
if (this.topK != null) {
|
|
json[r'topK'] = this.topK;
|
|
} else {
|
|
json[r'topK'] = null;
|
|
}
|
|
if (this.topP != null) {
|
|
json[r'topP'] = this.topP;
|
|
} else {
|
|
json[r'topP'] = null;
|
|
}
|
|
if (this.type != null) {
|
|
json[r'type'] = this.type;
|
|
} else {
|
|
json[r'type'] = null;
|
|
}
|
|
if (this.userCert != null) {
|
|
json[r'userCert'] = this.userCert;
|
|
} else {
|
|
json[r'userCert'] = null;
|
|
}
|
|
if (this.userKey != null) {
|
|
json[r'userKey'] = this.userKey;
|
|
} else {
|
|
json[r'userKey'] = null;
|
|
}
|
|
return json;
|
|
}
|
|
|
|
/// Returns a new [Provider] instance and imports its values from
|
|
/// [value] if it's a [Map], null otherwise.
|
|
// ignore: prefer_constructors_over_static_methods
|
|
static Provider? 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 "Provider[$key]" is missing from JSON.');
|
|
assert(json[key] != null, 'Required key "Provider[$key]" has a null value in JSON.');
|
|
});
|
|
return true;
|
|
}());
|
|
|
|
return Provider(
|
|
apiVersion: mapValueOfType<String>(json, r'apiVersion'),
|
|
asset: mapValueOfType<String>(json, r'asset'),
|
|
browserUrl: mapValueOfType<String>(json, r'browserUrl'),
|
|
category: mapValueOfType<String>(json, r'category'),
|
|
chain: mapValueOfType<String>(json, r'chain'),
|
|
clientId: mapValueOfType<String>(json, r'clientId'),
|
|
clientSecret: mapValueOfType<String>(json, r'clientSecret'),
|
|
compatibleProvider: mapValueOfType<String>(json, r'compatibleProvider'),
|
|
configText: mapValueOfType<String>(json, r'configText'),
|
|
contractMethod: mapValueOfType<String>(json, r'contractMethod'),
|
|
contractName: mapValueOfType<String>(json, r'contractName'),
|
|
createdTime: mapValueOfType<String>(json, r'createdTime'),
|
|
currency: mapValueOfType<String>(json, r'currency'),
|
|
displayName: mapValueOfType<String>(json, r'displayName'),
|
|
enableThinking: mapValueOfType<bool>(json, r'enableThinking'),
|
|
errorText: mapValueOfType<String>(json, r'errorText'),
|
|
flavor: mapValueOfType<String>(json, r'flavor'),
|
|
frequencyPenalty: num.parse('${json[r'frequencyPenalty']}'),
|
|
inputPricePerThousandTokens: num.parse('${json[r'inputPricePerThousandTokens']}'),
|
|
isDefault: mapValueOfType<bool>(json, r'isDefault'),
|
|
isRemote: mapValueOfType<bool>(json, r'isRemote'),
|
|
mcpTools: AgentMcpTools.listFromJson(json[r'mcpTools']),
|
|
name: mapValueOfType<String>(json, r'name'),
|
|
network: mapValueOfType<String>(json, r'network'),
|
|
outputPricePerThousandTokens: num.parse('${json[r'outputPricePerThousandTokens']}'),
|
|
owner: mapValueOfType<String>(json, r'owner'),
|
|
presencePenalty: num.parse('${json[r'presencePenalty']}'),
|
|
providerKey: mapValueOfType<String>(json, r'providerKey'),
|
|
providerUrl: mapValueOfType<String>(json, r'providerUrl'),
|
|
rawText: mapValueOfType<String>(json, r'rawText'),
|
|
region: mapValueOfType<String>(json, r'region'),
|
|
resultSummary: mapValueOfType<String>(json, r'resultSummary'),
|
|
runner: mapValueOfType<String>(json, r'runner'),
|
|
signCert: mapValueOfType<String>(json, r'signCert'),
|
|
signKey: mapValueOfType<String>(json, r'signKey'),
|
|
state: mapValueOfType<String>(json, r'state'),
|
|
subType: mapValueOfType<String>(json, r'subType'),
|
|
target: mapValueOfType<String>(json, r'target'),
|
|
targetMode: mapValueOfType<String>(json, r'targetMode'),
|
|
temperature: num.parse('${json[r'temperature']}'),
|
|
testContent: mapValueOfType<String>(json, r'testContent'),
|
|
text: mapValueOfType<String>(json, r'text'),
|
|
topK: mapValueOfType<int>(json, r'topK'),
|
|
topP: num.parse('${json[r'topP']}'),
|
|
type: mapValueOfType<String>(json, r'type'),
|
|
userCert: mapValueOfType<String>(json, r'userCert'),
|
|
userKey: mapValueOfType<String>(json, r'userKey'),
|
|
);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
static List<Provider> listFromJson(dynamic json, {bool growable = false,}) {
|
|
final result = <Provider>[];
|
|
if (json is List && json.isNotEmpty) {
|
|
for (final row in json) {
|
|
final value = Provider.fromJson(row);
|
|
if (value != null) {
|
|
result.add(value);
|
|
}
|
|
}
|
|
}
|
|
return result.toList(growable: growable);
|
|
}
|
|
|
|
static Map<String, Provider> mapFromJson(dynamic json) {
|
|
final map = <String, Provider>{};
|
|
if (json is Map && json.isNotEmpty) {
|
|
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
|
for (final entry in json.entries) {
|
|
final value = Provider.fromJson(entry.value);
|
|
if (value != null) {
|
|
map[entry.key] = value;
|
|
}
|
|
}
|
|
}
|
|
return map;
|
|
}
|
|
|
|
// maps a json object with a list of Provider-objects as value to a dart map
|
|
static Map<String, List<Provider>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
|
final map = <String, List<Provider>>{};
|
|
if (json is Map && json.isNotEmpty) {
|
|
// ignore: parameter_assignments
|
|
json = json.cast<String, dynamic>();
|
|
for (final entry in json.entries) {
|
|
map[entry.key] = Provider.listFromJson(entry.value, growable: growable,);
|
|
}
|
|
}
|
|
return map;
|
|
}
|
|
|
|
/// The list of required keys that must be present in a JSON.
|
|
static const requiredKeys = <String>{
|
|
};
|
|
}
|
|
|