Try catches, ensuring SuccessStatusCode
This commit is contained in:
1 parent
8b476e6939
commit
4494a2a202
4 files changed
+43
-20
No files matched your search
@@ -24,6 +24,7 @@ public class LLMAgentService(ApiService apiService, Configuration config, ILogge
|
||||
Reasoning = config.Reasoning
|
||||
};
|
||||
var response = await apiService.Post("chat", content);
|
||||
response.EnsureSuccessStatusCode();
|
||||
|
||||
// Response
|
||||
var contentMessage = await response.Content.ReadAsStringAsync();
|
||||
@@ -55,6 +56,7 @@ public class LLMAgentService(ApiService apiService, Configuration config, ILogge
|
||||
};
|
||||
|
||||
var response = await apiService.Post("models/unload", content);
|
||||
response.EnsureSuccessStatusCode();
|
||||
var message = await response.Content.ReadAsStringAsync();
|
||||
logger.LogInformation(message);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user