Update AI models default and optional values
To have stronger code
This commit is contained in:
@@ -14,7 +14,7 @@ class AIApiResponse {
|
||||
|
||||
Map<String, dynamic> toJson() => _$AIApiResponseToJson(this);
|
||||
|
||||
String? get content => choices.isNotEmpty ? choices[0].message.content : null;
|
||||
String get content => choices.isNotEmpty ? choices[0].message.content : '';
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
|
||||
@@ -9,6 +9,6 @@ class AIScribeRepositoryImpl implements AIScribeRepository {
|
||||
|
||||
@override
|
||||
Future<AIResponse> generateText(String prompt) async {
|
||||
return await _dataSource.request(prompt);
|
||||
return _dataSource.request(prompt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class AIResponse {
|
||||
final String? result;
|
||||
final String result;
|
||||
|
||||
const AIResponse({required this.result});
|
||||
|
||||
|
||||
@@ -24,6 +24,6 @@ class CustomPromptAction extends AIAction {
|
||||
|
||||
@override
|
||||
String getLabel(BuildContext context) {
|
||||
return ScribeLocalizations.of(context)!.customPromptAction;
|
||||
return ScribeLocalizations.of(context)?.customPromptAction ?? 'Help me write';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user