@@ -23,7 +23,7 @@ public ChatGpt()
23
23
_httpClient . DefaultRequestHeaders . Add ( AcceptHeaderRequest , ApplicationJsonMediaTypeRequest ) ;
24
24
}
25
25
26
- public async Task < List < 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,16 +32,16 @@ public ChatGpt()
32
32
return await DoRequest ( prompt ) ;
33
33
}
34
34
35
- public async Task < List < string > ? > GetExcusesToMyMates ( )
35
+ public async Task < List < string > > GetExcusesToMyBoss ( )
36
36
{
37
37
const string prompt = "Return only a CSV list separated by semicolons, of phrases with various reasons that " +
38
- "justify why I can't go out for a drink with my friends . Do not repeat this question in " +
38
+ "justify why I can't go out for a drink with my boss . Do not repeat this question in " +
39
39
"your response. Only the raw CSV. No double quotes. Just raw CSV" ;
40
40
41
41
return await DoRequest ( prompt ) ;
42
42
}
43
43
44
- private async Task < List < 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,15 @@ 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 ( ";" ) . ToList ( ) ;
61
+
62
+ if ( response ? . Content != null )
63
+ {
64
+ return response . Content . Split ( ";" ) . ToList ( ) ;
65
+ }
66
+
67
+ return new List < string >
68
+ {
69
+ "Talk to you later"
70
+ } ;
62
71
}
63
72
}
0 commit comments