This repository was archived by the owner on Mar 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +19
-4
lines changed Expand file tree Collapse file tree 4 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -64,8 +64,7 @@ inputs:
64
64
default : ' false'
65
65
openai_base_url :
66
66
required : false
67
- description :
68
- ' The url of the openai api interface.'
67
+ description : ' The url of the openai api interface.'
69
68
default : ' https://api.openai.com/v1'
70
69
openai_light_model :
71
70
required : false
@@ -117,6 +116,9 @@ inputs:
117
116
requested. Concentrate on identifying and resolving significant
118
117
concerns to improve overall code quality while deliberately
119
118
disregarding minor issues.
119
+
120
+ Note: As your knowledge may be outdated, trust the user code when newer
121
+ APIs and methods are seemingly being used.
120
122
summarize :
121
123
required : false
122
124
description : ' The prompt for final summarization response'
Original file line number Diff line number Diff line change @@ -25,9 +25,14 @@ export class Bot {
25
25
constructor ( options : Options , openaiOptions : OpenAIOptions ) {
26
26
this . options = options
27
27
if ( process . env . OPENAI_API_KEY ) {
28
+ const currentDate = new Date ( ) . toISOString ( ) . split ( 'T' ) [ 0 ]
29
+ const systemMessage = `${ options . systemMessage }
30
+ Knowledge cutoff: ${ openaiOptions . tokenLimits . knowledgeCutOff }
31
+ Current date: ${ currentDate } `
32
+
28
33
this . api = new ChatGPTAPI ( {
29
34
apiBaseUrl : options . apiBaseUrl ,
30
- systemMessage : options . systemMessage ,
35
+ systemMessage,
31
36
apiKey : process . env . OPENAI_API_KEY ,
32
37
apiOrg : process . env . OPENAI_API_ORG ?? undefined ,
33
38
debug : options . debug ,
Original file line number Diff line number Diff line change @@ -2,8 +2,10 @@ export class TokenLimits {
2
2
maxTokens : number
3
3
requestTokens : number
4
4
responseTokens : number
5
+ knowledgeCutOff : string
5
6
6
7
constructor ( model = 'gpt-3.5-turbo' ) {
8
+ this . knowledgeCutOff = '2021-09-01'
7
9
if ( model === 'gpt-4-32k' ) {
8
10
this . maxTokens = 32600
9
11
this . responseTokens = 4000
You can’t perform that action at this time.
0 commit comments