-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
59 lines (59 loc) · 2.48 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
export = ChatGPT;
declare class ChatGPT {
/**
* Initializes a new instance of the ChatGPT class.
* @param {string} access_token The API key to use for the ChatGPT API.
* @param {Object} [options] The options for the model.
* @param {[]} [options.messages] The user prompts.
* @param {string} [options.model] Which machine learning model to use.
* @param {number} [options.temperature] What sampling temperature to use.
* @param {number} [options.top_p] An alternative to sampling with temperature.
* @param {number} [options.n] How many chat completion choices to generate for each input message.
* @param {boolean} [options.stream] Should send partial message deltas?
* @param {number} [options.stop] How many tokens to stop the chat completion after.
* @param {number} [options.max_tokens] How many tokens to generate for each chat completion.
* @param {number} [options.presence_penalty] How much to penalize new tokens based on whether they appear in the text so far.
* @param {number} [options.frequency_penalty] How much to penalize new tokens based on their existing frequency in the text so far.
* @param {Object} [options.logit_bias] Modify the likelihood of specified tokens appearing in the completion.
* @param {string} [options.user] A unique identifier representing your end-user.
*
*/
constructor(access_token: string, options?: {
messages?: [];
model?: string;
temperature?: number;
top_p?: number;
n?: number;
stream?: boolean;
stop?: number;
max_tokens?: number;
presence_penalty?: number;
frequency_penalty?: number;
logit_bias?: any;
user?: string;
});
access_token: string;
options: {
messages?: [];
model?: string;
temperature?: number;
top_p?: number;
n?: number;
stream?: boolean;
stop?: number;
max_tokens?: number;
presence_penalty?: number;
frequency_penalty?: number;
logit_bias?: any;
user?: string;
};
/**
* This function is used to send a message to the ChatGPT API.
* @param {string} prompt The message to send to the ChatGPT API.
* @returns {Promise} A promise that resolves to the response from the ChatGPT API.
* @example
* const reply = await chatgpt.complete("Hello, how are you?");
*/
complete(prompt: string): Promise<any>;
}
//# sourceMappingURL=index.d.ts.map