@@ -23,7 +23,7 @@ public ChatGpt()
23
23
_httpClient . DefaultRequestHeaders . Add ( AcceptHeaderRequest , ApplicationJsonMediaTypeRequest ) ;
24
24
}
25
25
26
- public async Task < IEnumerable < string > ? > GetReasonsToMyBitch ( )
26
+ public async Task < List < string > ? > GetReasonsToMyBitch ( )
27
27
{
28
28
const string prompt = "Return only a CSV list separated by semicolons, of phrases with various reasons that justify " +
29
29
"my delay in leaving work, to my wife. Do not repeat this question in your response. " +
@@ -32,7 +32,7 @@ public ChatGpt()
32
32
return await DoRequest ( prompt ) ;
33
33
}
34
34
35
- public async Task < IEnumerable < string > ? > GetExcusesToMyMates ( )
35
+ public async Task < List < string > ? > GetExcusesToMyMates ( )
36
36
{
37
37
const string prompt = "Return only a CSV list separated by semicolons, of phrases with various reasons that " +
38
38
"justify why I can't go out for a drink with my friends. Do not repeat this question in " +
@@ -41,7 +41,7 @@ public ChatGpt()
41
41
return await DoRequest ( prompt ) ;
42
42
}
43
43
44
- private async Task < IEnumerable < string > ? > DoRequest ( string prompt )
44
+ private async Task < List < string > ? > DoRequest ( string prompt )
45
45
{
46
46
var promptJson = new CompletionChatRequest
47
47
{
@@ -58,6 +58,6 @@ public ChatGpt()
58
58
var responseContent = await responseMessage . Content . ReadAsStringAsync ( ) . ConfigureAwait ( false ) ;
59
59
60
60
var response = JsonSerializer . Deserialize < CompletionChatResponse > ( responseContent , _serializerOptions ) ;
61
- return response ? . Content ? . Split ( ";" ) ;
61
+ return response ? . Content ? . Split ( ";" ) . ToList ( ) ;
62
62
}
63
- }
63
+ }
0 commit comments