Feature #3641
Updated by Ram Kordale 5 months ago
Inputs: model, index, chapter_num, <board>-<grade>-<subject>.txt, start_question, num_questions, styles (which is an array of strings) "Output": gcs_file2 <board>-<grade>-<subject>.txt is available in <env>-files bucket (same ones that we have been using for the past few tickets) and has the format: Chapter 1 E Chapter 2 E ... where E is of the format: E1 E2 ... where Ei is of format #$Exercise: <exercise#> (example: 1.2.5.1) #$Question: <question> #$Answer: <answer> As always, get assistant, periodic_prompt, instructions, prompt_prefix and prompt_suffix based on model and index. Substitute "stylexyz1abc" with <style> and do the following: -reset=true -tokens=0 -while there are questions in the file --if (reset) ---reset=false ---prompt=concat(periodic_prompt, prompt_prefix, <question>, prompt_suffix) --else ---prompt=concat(prompt_prefix, <question>, prompt_suffix) --response=call_openai_api(assistant, "temperature": 1, "max_tokens": 4096, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0, prompt) --tokens = tokens + tokens_used_in_call --styled_question = content between "###---###---###" --store styled_question and answer with key <board>-<grade>-<subject>-<chapter>-<exercise>-<style> --if <board>-<grade>-<subject>-<chapter>-<exercise>-standard does not exist ---store <question> and answer with key in <board>-<grade>-<subject>-<chapter>-<exercise>-standard --if (tokens > 40960) reset = true You can start with a single entry file such as #$Exercise: 1.2.5.1 #$Question: Maya dyes dresses. She had to dye 30 dresses. She has so far finished 20 dresses. What fraction of dresses has she finished? #$Answer: 2/3