mirror of
https://github.com/foss42/apidash.git
synced 2025-12-02 18:57:05 +08:00
Refactor AI model selection and config handling
This commit is contained in:
@@ -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 ');
|
||||
|
||||
Reference in New Issue
Block a user