feat: set default reasoning effort to low for all AI requests
This commit is contained in:
@@ -7,6 +7,7 @@ class AiConfigFile {
|
||||
required this.provider,
|
||||
required this.endpoint,
|
||||
required this.model,
|
||||
this.reasoningEffort = 'low',
|
||||
this.apiKey,
|
||||
this.description,
|
||||
});
|
||||
@@ -14,6 +15,7 @@ class AiConfigFile {
|
||||
final AiProviderType provider;
|
||||
final String endpoint;
|
||||
final String model;
|
||||
final String reasoningEffort;
|
||||
final String? apiKey;
|
||||
final String? description;
|
||||
|
||||
@@ -25,10 +27,15 @@ class AiConfigFile {
|
||||
(p) => p.name.toLowerCase() == providerStr.toLowerCase(),
|
||||
orElse: () => AiProviderType.compatible,
|
||||
);
|
||||
final effort = (json['reasoningEffort'] as String? ??
|
||||
json['reasoning_effort'] as String? ??
|
||||
'low')
|
||||
.trim();
|
||||
return AiConfigFile(
|
||||
provider: provider,
|
||||
endpoint: (json['endpoint'] as String? ?? '').trim(),
|
||||
model: (json['model'] as String? ?? '').trim(),
|
||||
reasoningEffort: effort.isEmpty ? 'low' : effort,
|
||||
apiKey: json['apiKey'] as String?,
|
||||
description: json['description'] as String?,
|
||||
);
|
||||
@@ -43,6 +50,7 @@ class AiConfigFile {
|
||||
'provider': provider.name,
|
||||
'endpoint': endpoint,
|
||||
'model': model,
|
||||
'reasoningEffort': reasoningEffort,
|
||||
if (apiKey != null) 'apiKey': apiKey,
|
||||
if (description != null) 'description': description,
|
||||
};
|
||||
@@ -62,12 +70,14 @@ class AiConfigFile {
|
||||
AiProviderType? provider,
|
||||
String? endpoint,
|
||||
String? model,
|
||||
String? reasoningEffort,
|
||||
String? apiKey,
|
||||
String? description,
|
||||
}) => AiConfigFile(
|
||||
provider: provider ?? this.provider,
|
||||
endpoint: endpoint ?? this.endpoint,
|
||||
model: model ?? this.model,
|
||||
reasoningEffort: reasoningEffort ?? this.reasoningEffort,
|
||||
apiKey: apiKey ?? this.apiKey,
|
||||
description: description ?? this.description,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user