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);
|
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()
|
@JsonSerializable()
|
||||||
|
|||||||
@@ -9,6 +9,6 @@ class AIScribeRepositoryImpl implements AIScribeRepository {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<AIResponse> generateText(String prompt) async {
|
Future<AIResponse> generateText(String prompt) async {
|
||||||
return await _dataSource.request(prompt);
|
return _dataSource.request(prompt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class AIResponse {
|
class AIResponse {
|
||||||
final String? result;
|
final String result;
|
||||||
|
|
||||||
const AIResponse({required this.result});
|
const AIResponse({required this.result});
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,6 @@ class CustomPromptAction extends AIAction {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
String getLabel(BuildContext context) {
|
String getLabel(BuildContext context) {
|
||||||
return ScribeLocalizations.of(context)!.customPromptAction;
|
return ScribeLocalizations.of(context)?.customPromptAction ?? 'Help me write';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user