fix formatting and imports

This commit is contained in:
Ashita Prasad
2025-05-17 23:03:43 +05:30
parent 962bf0f230
commit 2863bdd951
9 changed files with 128 additions and 62 deletions

View File

@@ -6,11 +6,17 @@ class GeneralQueryFeature {
GeneralQueryFeature(this._client);
Future<String> generateResponse(String prompt, {RequestModel? requestModel, dynamic responseModel}) async {
Future<String> generateResponse(String prompt,
{RequestModel? requestModel, dynamic responseModel}) async {
String enhancedPrompt = prompt;
if (requestModel != null && responseModel != null) {
final method = requestModel.httpRequestModel?.method.toString().split('.').last.toUpperCase() ?? "GET";
final method = requestModel.httpRequestModel?.method
.toString()
.split('.')
.last
.toUpperCase() ??
"GET";
final endpoint = requestModel.httpRequestModel?.url ?? "Unknown Endpoint";
final statusCode = responseModel.statusCode ?? 0;
@@ -37,7 +43,10 @@ Respond in a helpful, direct manner that specifically answers what was asked.
}
final response = await _client.generateCompletion(
request: GenerateCompletionRequest(model: 'llama3.2:3b', prompt: enhancedPrompt),
request: GenerateCompletionRequest(
model: 'llama3.2:3b',
prompt: enhancedPrompt,
),
);
return response.response.toString();
}