Refactor AI model selection and config handling

This commit is contained in:
Ankit Mahato
2025-08-28 06:42:32 +05:30
parent 8fa3433cf8
commit 6e1f2b4773
56 changed files with 1074 additions and 1390 deletions

View File

@@ -96,10 +96,9 @@ Future<void> callGenerativeModel(
required Function(String?) onAnswer,
required Function(dynamic) onError,
}) async {
final modelRequestData = aiRequestModel?.modelRequestData;
if (modelRequestData != null) {
if (aiRequestModel != null) {
try {
if (modelRequestData.stream ?? false) {
if (aiRequestModel.stream ?? false) {
final answerStream = await streamGenAIRequest(aiRequestModel);
processGenAIStreamOutput(answerStream, (w) {
onAnswer('$w ');