diff options
Diffstat (limited to 'src/client/apis/gpt')
| -rw-r--r-- | src/client/apis/gpt/GPT.ts | 9 | 
1 files changed, 8 insertions, 1 deletions
| diff --git a/src/client/apis/gpt/GPT.ts b/src/client/apis/gpt/GPT.ts index 7bcd541c7..caddc41a2 100644 --- a/src/client/apis/gpt/GPT.ts +++ b/src/client/apis/gpt/GPT.ts @@ -12,6 +12,7 @@ enum GPTCallType {      DESCRIBE = 'describe',      MERMAID = 'mermaid',      DATA = 'data', +    STACK = 'stack',  }  type GPTCallOpts = { @@ -26,6 +27,12 @@ const callTypeMap: { [type: string]: GPTCallOpts } = {      summary: { model: 'gpt-4-turbo', maxTokens: 256, temp: 0.5, prompt: 'Summarize the text given in simpler terms.' },      edit: { model: 'gpt-4-turbo', maxTokens: 256, temp: 0.5, prompt: 'Reword the text.' },      flashcard: { model: 'gpt-4-turbo', maxTokens: 512, temp: 0.5, prompt: 'Make flashcards out of this text with each question and answer labeled as question and answer. Do not label each flashcard and do not include asterisks: ' }, +    stack: { +        model: 'gpt-4o', +        maxTokens: 2048, +        temp: 0.7, +        prompt: 'Create a stack of flashcards out of this text with each question and answer labeled as question and answer. For some questions, ask "what is this image of" and write a keyword that represents the image and label it "keyword". Otherwise, write none. Do not label each flashcard and do not include asterisks.', +    },      completion: { model: 'gpt-4-turbo', maxTokens: 256, temp: 0.5, prompt: "You are a helpful assistant. Answer the user's prompt." },      mermaid: {          model: 'gpt-4-turbo', @@ -64,7 +71,7 @@ let lastResp = '';   * @returns AI Output   */  const gptAPICall = async (inputTextIn: string, callType: GPTCallType, prompt?: any) => { -    const inputText = [GPTCallType.SUMMARY, GPTCallType.FLASHCARD, GPTCallType.QUIZ].includes(callType) ? inputTextIn + '.' : inputTextIn; +    const inputText = [GPTCallType.SUMMARY, GPTCallType.FLASHCARD, GPTCallType.QUIZ, GPTCallType.STACK].includes(callType) ? inputTextIn + '.' : inputTextIn;      const opts: GPTCallOpts = callTypeMap[callType];      if (lastCall === inputText) return lastResp;      try { | 
