aboutsummaryrefslogtreecommitdiff
path: root/src/client/apis/gpt
diff options
context:
space:
mode:
authorSophie Zhang <sophie_zhang@brown.edu>2023-10-19 00:58:37 -0400
committerSophie Zhang <sophie_zhang@brown.edu>2023-10-19 00:58:37 -0400
commit612f3d05927113c7b010861c17765fcead4752e5 (patch)
treed5ff18e8d157809b04d29343fe70223c61aa65bb /src/client/apis/gpt
parent8a0ae4e42d217a222d6a127ec640d5f1113832a0 (diff)
feat: recording
Diffstat (limited to 'src/client/apis/gpt')
-rw-r--r--src/client/apis/gpt/GPT.ts10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/client/apis/gpt/GPT.ts b/src/client/apis/gpt/GPT.ts
index d7e7f07fa..66689f2f6 100644
--- a/src/client/apis/gpt/GPT.ts
+++ b/src/client/apis/gpt/GPT.ts
@@ -26,7 +26,7 @@ const openai = new OpenAIApi(configuration);
const gptTrailSlideCustomization = async (inputText: string) => {
const prompt =
- 'We are adding customization to a slide in a presentation. Given a natural language input, translate it into a json with the required fields: [title, presentation_transition, presentation_effect, and config_zoom]. title is the title/name of the slide. presentation_transition is a number in milliseconds for how long it should take to transition to a slide. presentation_effect is an effect applied to the slide when we transition to it. Its only possible values are: [None, Fade in, Flip, Rotate, Bounce, Roll]. config zoom is a number from 0 to 1.0 indicating the percentage we should be zooming into the slide.If the input does not contain info a specific key, please set their value to null. Please only return the json with these keys and their values.';
+ 'We are adding customization to a slide in a presentation. Given a natural language input, translate it into a json with the required fields: [title, presentation_transition, presentation_effect, and config_zoom]. title is the title/name of the slide. presentation_transition is a number in milliseconds for how long it should take to transition to a slide. presentation_effect is an effect applied to the slide when we transition to it. Its only possible values are: [None, Fade in, Flip, Rotate, Bounce, Roll]. config zoom is a number from 0 to 1.0 indicating the percentage we should be zooming into the slide. If the input does not contain info a specific key, please set their value to null. Please only return the json with these keys and their values.';
try {
const response = await openai.createChatCompletion({
@@ -55,10 +55,6 @@ const gptAPICall = async (inputText: string, callType: GPTCallType) => {
if (callType === GPTCallType.SUMMARY) inputText += '.';
const opts: GPTCallOpts = callTypeMap[callType];
try {
- // const configuration = new Configuration({
- // apiKey: process.env.OPENAI_KEY,
- // });
- // const openai = new OpenAIApi(configuration);
const response = await openai.createCompletion({
model: opts.model,
max_tokens: opts.maxTokens,
@@ -74,10 +70,6 @@ const gptAPICall = async (inputText: string, callType: GPTCallType) => {
const gptImageCall = async (prompt: string, n?: number) => {
try {
- // const configuration = new Configuration({
- // apiKey: process.env.OPENAI_KEY,
- // });
- // const openai = new OpenAIApi(configuration);
const response = await openai.createImage({
prompt: prompt,
n: n ?? 1,