From d29ba781bae7763fa45a3d7617fdc428019d51ca Mon Sep 17 00:00:00 2001 From: finn Date: Fri, 2 Jan 2026 17:36:24 -0700 Subject: [PATCH] implemented offline cache --- README.md | 60 +++++++++++++-- ds_prompt.txt | 17 ++++- ds_prompt_newtest.txt | 25 +++++++ ds_prompt_old.txt | 20 +++++ generate_prompts.py | 165 ++++++++++++++++++++++++++++++++++++++---- historic_prompts.json | 120 +++++++++++++++--------------- pool_prompts.json | 1 + run.sh | 143 ++++++++++++++++++++---------------- settings.cfg | 4 +- 9 files changed, 407 insertions(+), 148 deletions(-) create mode 100644 ds_prompt_newtest.txt create mode 100644 ds_prompt_old.txt create mode 100644 pool_prompts.json diff --git a/README.md b/README.md index 59c6dcb..3b23356 100644 --- a/README.md +++ b/README.md @@ -68,8 +68,10 @@ daily-journal-prompt/ ├── requirements.txt # Python dependencies ├── ds_prompt.txt # AI prompt template for generating journal prompts ├── historic_prompts.json # History of previous 60 prompts (JSON format) +├── pool_prompts.json # Pool of available prompts for selection (JSON format) ├── example.env # Example environment configuration ├── .env # Your actual environment configuration (gitignored) +├── settings.cfg # Configuration file for prompt settings and pool size └── .gitignore # Git ignore rules ``` @@ -80,10 +82,12 @@ daily-journal-prompt/ - **run.sh**: Convenience bash script for easy execution - **test_project.py**: Test suite to verify project setup - **requirements.txt**: Python dependencies (openai, python-dotenv, rich) -- **ds_prompt.txt**: The core prompt template that instructs the AI to generate 6 new journal prompts -- **historic_prompts.json**: JSON array containing the last 60 generated prompts +- **ds_prompt.txt**: The core prompt template that instructs the AI to generate new journal prompts +- **historic_prompts.json**: JSON array containing the last 60 generated prompts (cyclic buffer) +- **pool_prompts.json**: JSON array containing the pool of available prompts for selection - **example.env**: Template for your environment configuration - **.env**: Your actual environment variables (not tracked in git for security) +- **settings.cfg**: Configuration file for prompt settings (length, count) and pool size ## 🎯 Quick Start @@ -140,14 +144,56 @@ python test_project.py ## 🔧 Usage +### New Pool-Based System + +The system now uses a two-step process: + +1. **Fill the Prompt Pool**: Generate prompts using AI and add them to the pool +2. **Draw from Pool**: Select prompts from the pool for journaling sessions + +### Command Line Options + +```bash +# Default: Draw prompts from pool (no API call) +python generate_prompts.py + +# Interactive mode with menu +python generate_prompts.py --interactive + +# Fill the prompt pool using AI (makes API call) +python generate_prompts.py --fill-pool + +# Show pool statistics +python generate_prompts.py --pool-stats + +# Show history statistics +python generate_prompts.py --stats + +# Help +python generate_prompts.py --help +``` + +### Interactive Mode Options + +1. **Draw prompts from pool (no API call)**: Displays prompts from the pool file +2. **Fill prompt pool using API**: Generates new prompts using AI and adds them to pool +3. **View pool statistics**: Shows pool size, target size, and available sessions +4. **View history statistics**: Shows historic prompt count and capacity +5. **Exit**: Quit the program ### Prompt Generation Process -1. The system reads the template from `ds_prompt.txt` -2. It loads the previous 60 prompts from the fixed length cyclic buffer `historic_prompts.json` -3. The AI generates 6 new prompts, attempting to minimize repetition -4. Six new prompts are displayed. -5. User selects one prompt for his/her journal writing session, which is added to the `historic_prompts.json` cyclic buffer. +1. User chooses to fill the prompt pool. +2. The system reads the template from `ds_prompt.txt` +3. It loads the previous 60 prompts from the fixed length cyclic buffer `historic_prompts.json` +4. The AI generates some number of new prompts, attempting to minimize repetition +5. The new prompts are used to fill the prompt pool to the `settings.cfg` configured value. + +### Prompt Selection Process + +1. A `settings.cfg` configurable number of prompts are drawn from the prompt pool and displayed to the user. +2. User selects one prompt for his/her journal writing session, which is added to the `historic_prompts.json` cyclic buffer. +3. All prompts which were displayed are removed from the prompt pool permanently. ## 📝 Prompt Examples diff --git a/ds_prompt.txt b/ds_prompt.txt index a603372..c43bde6 100644 --- a/ds_prompt.txt +++ b/ds_prompt.txt @@ -1,9 +1,20 @@ +Request for generation of writing prompts for journaling + +Payload: +The previous 60 prompts have been provided as a JSON array for reference. + +Guidelines: +Topics can be diverse. Please generate 6 writing prompts in English with a few guidelines. These are meant to inspire one to two pages of writing in a journal as exercise. -Topics can be diverse. -The prompts should be between 500 and 1000 characters. -The previous 60 prompts have been provided as a JSON array for reference. Attempt minimal repetition, but some thematic overlap is acceptable. Newly generated prompts should try extra hard to avoid repetition in previous prompts with the lowest indices. +The prompts should be between 500 and 1000 characters in length. +Prompt History: +The provided history brackets two mechanisms. +The history will allow for reducing repetition, however some thematic overlap is acceptable. Try harder to avoid overlap with lower indices in the array. +As the user discards prompts, the themes will be very slowly steered, so it's okay to take some inspiration from it. + +Expected Output: Output as a JSON array with key names from "newprompt0" to "newpromptN" where N is the number of prompts minus one. Respond ONLY with valid JSON. No explanations, no markdown, no backticks. diff --git a/ds_prompt_newtest.txt b/ds_prompt_newtest.txt new file mode 100644 index 0000000..8efcfc6 --- /dev/null +++ b/ds_prompt_newtest.txt @@ -0,0 +1,25 @@ +Payload +The previous 60 prompts have been provided as a JSON array for reference. + +Guidelines +Topics should be diverse. + +Generate 6 writing prompts in English. + +Each prompt should include a few guidelines or questions to inspire writing. + +Prompts are meant to inspire one to two pages of writing in a journal as an exercise. + +Each prompt should be between 500 and 1000 characters in length. + +Prompt History Considerations +The history helps reduce repetition, but some thematic overlap is acceptable. + +Try harder to avoid overlap with prompts at lower indices in the array. + +As the user discards prompts, themes will slowly steer, so it's okay to take some inspiration from the history. + +Expected Output +Output must be a JSON array with keys from "newprompt0" to "newprompt5" in the case of 6 prompts. + +Respond ONLY with valid JSON. No explanations, no markdown, no backticks. diff --git a/ds_prompt_old.txt b/ds_prompt_old.txt new file mode 100644 index 0000000..c43bde6 --- /dev/null +++ b/ds_prompt_old.txt @@ -0,0 +1,20 @@ +Request for generation of writing prompts for journaling + +Payload: +The previous 60 prompts have been provided as a JSON array for reference. + +Guidelines: +Topics can be diverse. +Please generate 6 writing prompts in English with a few guidelines. +These are meant to inspire one to two pages of writing in a journal as exercise. +The prompts should be between 500 and 1000 characters in length. + +Prompt History: +The provided history brackets two mechanisms. +The history will allow for reducing repetition, however some thematic overlap is acceptable. Try harder to avoid overlap with lower indices in the array. +As the user discards prompts, the themes will be very slowly steered, so it's okay to take some inspiration from it. + +Expected Output: +Output as a JSON array with key names from "newprompt0" to "newpromptN" where N is the number of prompts minus one. +Respond ONLY with valid JSON. No explanations, no markdown, no backticks. + diff --git a/generate_prompts.py b/generate_prompts.py index be4d1d8..3240e6e 100644 --- a/generate_prompts.py +++ b/generate_prompts.py @@ -31,6 +31,7 @@ class JournalPromptGenerator: self.config_path = config_path self.client = None self.historic_prompts = [] + self.pool_prompts = [] self.prompt_template = "" self.settings = {} @@ -41,6 +42,7 @@ class JournalPromptGenerator: # Load data files self._load_prompt_template() self._load_historic_prompts() + self._load_pool_prompts() def _load_config(self): """Load configuration from environment file.""" @@ -145,6 +147,106 @@ class JournalPromptGenerator: with open("historic_prompts.json", "w") as f: json.dump(self.historic_prompts, f, indent=2) + def _load_pool_prompts(self): + """Load pool prompts from JSON file.""" + try: + with open("pool_prompts.json", "r") as f: + self.pool_prompts = json.load(f) + except FileNotFoundError: + self.console.print("[yellow]Warning: pool_prompts.json not found, starting with empty pool[/yellow]") + self.pool_prompts = [] + except json.JSONDecodeError: + self.console.print("[yellow]Warning: pool_prompts.json is corrupted, starting with empty pool[/yellow]") + self.pool_prompts = [] + + def _save_pool_prompts(self): + """Save pool prompts to JSON file.""" + with open("pool_prompts.json", "w") as f: + json.dump(self.pool_prompts, f, indent=2) + + def add_prompts_to_pool(self, prompts: List[Dict[str, str]]): + """Add generated prompts to the pool.""" + for prompt_dict in prompts: + # Extract prompt text + prompt_key = list(prompt_dict.keys())[0] + prompt_text = prompt_dict[prompt_key] + + # Add to pool with a pool-specific key + pool_key = f"poolprompt{len(self.pool_prompts):03d}" + self.pool_prompts.append({ + pool_key: prompt_text + }) + + self._save_pool_prompts() + self.console.print(f"[green]Added {len(prompts)} prompts to pool[/green]") + + def draw_prompts_from_pool(self, count: int = None) -> List[Dict[str, str]]: + """Draw prompts from the pool (removes them from pool).""" + if count is None: + count = self.settings['num_prompts'] + + if len(self.pool_prompts) < count: + self.console.print(f"[yellow]Warning: Pool only has {len(self.pool_prompts)} prompts, requested {count}[/yellow]") + count = len(self.pool_prompts) + + if count == 0: + self.console.print("[red]Error: Pool is empty[/red]") + return [] + + # Draw prompts from the beginning of the pool + drawn_prompts = self.pool_prompts[:count] + self.pool_prompts = self.pool_prompts[count:] + + # Save updated pool + self._save_pool_prompts() + + # Renumber remaining pool prompts + self._renumber_pool_prompts() + + return drawn_prompts + + def _renumber_pool_prompts(self): + """Renumber pool prompts to maintain sequential numbering.""" + renumbered_prompts = [] + for i, prompt_dict in enumerate(self.pool_prompts): + # Get the prompt text from the first key in the dictionary + prompt_key = list(prompt_dict.keys())[0] + prompt_text = prompt_dict[prompt_key] + + # Create new prompt with correct numbering + new_prompt_key = f"poolprompt{i:03d}" + renumbered_prompts.append({ + new_prompt_key: prompt_text + }) + + self.pool_prompts = renumbered_prompts + + def show_pool_stats(self): + """Show statistics about the prompt pool.""" + total_prompts = len(self.pool_prompts) + + table = Table(title="Prompt Pool Statistics") + table.add_column("Metric", style="cyan") + table.add_column("Value", style="green") + + table.add_row("Prompts in pool", str(total_prompts)) + table.add_row("Prompts per session", str(self.settings['num_prompts'])) + + # Get cached_pool_volume from settings if available + cached_pool_volume = 20 # Default + try: + config = configparser.ConfigParser() + config.read('settings.cfg') + if 'prefetch' in config and 'cached_pool_volume' in config['prefetch']: + cached_pool_volume = int(config['prefetch']['cached_pool_volume']) + except: + pass + + table.add_row("Target pool size", str(cached_pool_volume)) + table.add_row("Available sessions", str(total_prompts // self.settings['num_prompts'])) + + self.console.print(table) + def _renumber_prompts(self): """Renumber all prompts to maintain prompt00-prompt59 range.""" renumbered_prompts = [] @@ -277,6 +379,9 @@ class JournalPromptGenerator: except Exception as e: self.console.print(f"[red]Error calling AI API: {e}[/red]") + self.console.print(f"[yellow]Full response content for debugging:[/yellow]") + self.console.print(f"[yellow]{response_content}[/yellow]") + return [] # Parse the response @@ -337,27 +442,30 @@ class JournalPromptGenerator: while True: self.console.print("\n[bold]Options:[/bold]") - self.console.print("1. Generate new prompts") - self.console.print("2. View history statistics") - self.console.print("3. Exit") + self.console.print("1. Draw prompts from pool (no API call)") + self.console.print("2. Fill prompt pool using API") + self.console.print("3. View pool statistics") + self.console.print("4. View history statistics") + self.console.print("5. Exit") - choice = Prompt.ask("\nEnter your choice", choices=["1", "2", "3"], default="1") + choice = Prompt.ask("\nEnter your choice", choices=["1", "2", "3", "4", "5"], default="1") if choice == "1": - new_prompts = self.generate_prompts() - if new_prompts: - self.display_prompts(new_prompts) + # Draw prompts from pool + drawn_prompts = self.draw_prompts_from_pool() + if drawn_prompts: + self.display_prompts(drawn_prompts) # Ask if user wants to save a prompt if Confirm.ask("\nWould you like to save one of these prompts to a file?"): prompt_num = Prompt.ask( "Which prompt number would you like to save?", - choices=[str(i) for i in range(1, len(new_prompts) + 1)], + choices=[str(i) for i in range(1, len(drawn_prompts) + 1)], default="1" ) prompt_idx = int(prompt_num) - 1 - prompt_dict = new_prompts[prompt_idx] + prompt_dict = drawn_prompts[prompt_idx] prompt_key = list(prompt_dict.keys())[0] prompt_text = prompt_dict[prompt_key] @@ -379,9 +487,19 @@ class JournalPromptGenerator: self.console.print(f"[green]Prompt added to history as prompt00[/green]") elif choice == "2": - self.show_history_stats() + # Fill prompt pool using API + new_prompts = self.generate_prompts() + if new_prompts: + self.add_prompts_to_pool(new_prompts) + self.console.print(f"[green]Added {len(new_prompts)} prompts to pool[/green]") elif choice == "3": + self.show_pool_stats() + + elif choice == "4": + self.show_history_stats() + + elif choice == "5": self.console.print("[green]Goodbye! Happy journaling! 📓[/green]") break @@ -404,6 +522,16 @@ def main(): action="store_true", help="Show history statistics" ) + parser.add_argument( + "--pool-stats", "-p", + action="store_true", + help="Show pool statistics" + ) + parser.add_argument( + "--fill-pool", "-f", + action="store_true", + help="Fill prompt pool using API" + ) args = parser.parse_args() @@ -412,13 +540,22 @@ def main(): if args.stats: generator.show_history_stats() + elif args.pool_stats: + generator.show_pool_stats() + elif args.fill_pool: + # Fill prompt pool using API + new_prompts = generator.generate_prompts() + if new_prompts: + generator.add_prompts_to_pool(new_prompts) + generator.console.print(f"[green]Added {len(new_prompts)} prompts to pool[/green]") elif args.interactive: generator.interactive_mode() else: - # Default: generate and display prompts - new_prompts = generator.generate_prompts() - if new_prompts: - generator.display_prompts(new_prompts) + # Default: draw prompts from pool (no API call) + drawn_prompts = generator.draw_prompts_from_pool() + if drawn_prompts: + generator.display_prompts(drawn_prompts) + generator.console.print("[yellow]Note: These prompts were drawn from the pool. Use --fill-pool to add more prompts.[/yellow]") if __name__ == "__main__": diff --git a/historic_prompts.json b/historic_prompts.json index 6f84048..f2e525e 100644 --- a/historic_prompts.json +++ b/historic_prompts.json @@ -1,182 +1,182 @@ [ { - "prompt00": "\"newprompt3\": \"Recall a teacher, mentor, or elder who said something to you in passing that you have never forgotten. It might have been a compliment, a criticism, or an offhand observation. Reconstruct the scene. Why did their words carry such weight? How have you turned them over in your mind since? Explore the power of brief, seemingly casual utterances to shape a person's self-concept.\"," + "prompt00": "Recall a public space you frequented often in the past but have not visited in years (a library, a park, a diner, a store). Reconstruct it from memory in vivid detail. Then, imagine returning to it today. Describe the inevitable changes\u2014the renovations, the new faces, the faded paint. But also, hunt for the one thing that remains exactly, miraculously the same. How does the coexistence of change and permanence in this space make you feel about the passage of your own time?" }, { - "prompt01": "\"newprompt0\": \"Write a detailed portrait of a tree you know well\u2014not just its appearance, but its history in that spot, the way its branches move in different winds, the creatures that inhabit it, the shadows it casts at various hours. Imagine its perspective across seasons and years. What has it witnessed? What would it say about change, resilience, or stillness if it could speak? Let the tree become a mirror for your own sense of place and time.\"," + "prompt01": "\"newprompt3\": \"Recall a teacher, mentor, or elder who said something to you in passing that you have never forgotten. It might have been a compliment, a criticism, or an offhand observation. Reconstruct the scene. Why did their words carry such weight? How have you turned them over in your mind since? Explore the power of brief, seemingly casual utterances to shape a person's self-concept.\"," }, { - "prompt02": "Describe a memory you have that is tied to a specific smell. Don't just tell the story of the event; focus on describing the scent itself in as much detail as possible\u2014its texture, its weight in the air, its nuances. How does conjuring that smell now make you feel in your body? Let the description of the aroma lead you back into the memory's landscape." + "prompt02": "\"newprompt0\": \"Write a detailed portrait of a tree you know well\u2014not just its appearance, but its history in that spot, the way its branches move in different winds, the creatures that inhabit it, the shadows it casts at various hours. Imagine its perspective across seasons and years. What has it witnessed? What would it say about change, resilience, or stillness if it could speak? Let the tree become a mirror for your own sense of place and time.\"," }, { - "prompt03": "Write a letter to your 15-year-old self. Be kind, be blunt, be humorous, or be stern. What do you know now that you desperately needed to hear then? What mystery about your future life could you tantalizingly hint at without giving it all away? Don't just give advice; try to capture the voice and tone you wish an older, wiser person had used with you." + "prompt03": "Describe a memory you have that is tied to a specific smell. Don't just tell the story of the event; focus on describing the scent itself in as much detail as possible\u2014its texture, its weight in the air, its nuances. How does conjuring that smell now make you feel in your body? Let the description of the aroma lead you back into the memory's landscape." }, { - "prompt04": "You find a forgotten door in a place you know well\u2014your home, your workplace, your daily park. It wasn't there yesterday. You open it. Describe what is on the other side using only sensory details: sight, sound, temperature, smell. Do not explain its purpose or origin. Simply document the experience of crossing that threshold." + "prompt04": "Write a letter to your 15-year-old self. Be kind, be blunt, be humorous, or be stern. What do you know now that you desperately needed to hear then? What mystery about your future life could you tantalizingly hint at without giving it all away? Don't just give advice; try to capture the voice and tone you wish an older, wiser person had used with you." }, { - "prompt05": "Make a list of ten tiny, perfect moments from the past month that no one else probably noticed or would remember. The way light fell on a spoon, a stranger's half-smile, the sound of rain stopping. Elaborate on at least three of them, expanding them into full vignettes. Why did these micro-moments stick with you?" + "prompt05": "You find a forgotten door in a place you know well\u2014your home, your workplace, your daily park. It wasn't there yesterday. You open it. Describe what is on the other side using only sensory details: sight, sound, temperature, smell. Do not explain its purpose or origin. Simply document the experience of crossing that threshold." }, { - "prompt06": "Invent a mythological creature for a modern urban setting. What does it look like? What is its behavior and habitat (e.g., subway tunnels, server farms, air vents)? What folklore do people whisper about it? What does it symbolize\u2014anxiety, forgotten connections, hope? Describe a recent 'sighting' of this creature in vivid detail." + "prompt06": "Make a list of ten tiny, perfect moments from the past month that no one else probably noticed or would remember. The way light fell on a spoon, a stranger's half-smile, the sound of rain stopping. Elaborate on at least three of them, expanding them into full vignettes. Why did these micro-moments stick with you?" }, { - "prompt07": "Choose an object in your immediate line of sight that is not electronic. Write its biography. Where was it made? Who owned it before you? What conversations has it overheard? What secrets does it hold? What small damages or wear marks does it have, and what story does each tell? Give this ordinary item an epic history." + "prompt07": "Invent a mythological creature for a modern urban setting. What does it look like? What is its behavior and habitat (e.g., subway tunnels, server farms, air vents)? What folklore do people whisper about it? What does it symbolize\u2014anxiety, forgotten connections, hope? Describe a recent 'sighting' of this creature in vivid detail." }, { - "prompt08": "Describe your current emotional state as a weather system. Is it a still, high-pressure fog? A sudden, sharp hailstorm? A lingering, humid drizzle? Map its boundaries, its intensity, its forecast. What terrain does it move over\u2014the mountains of your responsibilities, the plains of your routine? How does it affect your internal climate?" + "prompt08": "Choose an object in your immediate line of sight that is not electronic. Write its biography. Where was it made? Who owned it before you? What conversations has it overheard? What secrets does it hold? What small damages or wear marks does it have, and what story does each tell? Give this ordinary item an epic history." }, { - "prompt09": "Recall a time you were deeply embarrassed. Write about it from the perspective of a sympathetic observer who was there\u2014or invent one. How might they have perceived the event? What context or kindness might they have seen that you, in your self-focused shame, completely missed? Reframe the memory through their eyes." + "prompt09": "Describe your current emotional state as a weather system. Is it a still, high-pressure fog? A sudden, sharp hailstorm? A lingering, humid drizzle? Map its boundaries, its intensity, its forecast. What terrain does it move over\u2014the mountains of your responsibilities, the plains of your routine? How does it affect your internal climate?" }, { - "prompt10": "What skill or craft have you always wanted to learn but haven't? Immerse yourself in a detailed fantasy of mastering it. Describe the feel of the tools in your hands, the initial frustrations, the first small success, the growing muscle memory. What does the final, perfected product of your labor look or feel like? Live in that imagined\u6210\u5c31\u611f." + "prompt10": "Recall a time you were deeply embarrassed. Write about it from the perspective of a sympathetic observer who was there\u2014or invent one. How might they have perceived the event? What context or kindness might they have seen that you, in your self-focused shame, completely missed? Reframe the memory through their eyes." }, { - "prompt11": "Write a dialogue between two aspects of yourself (e.g., Your Ambitious Self and Your Tired Self; Your Cynical Self and Your Hopeful Self). Give them distinct voices. What are they arguing about, negotiating, or planning? Don't just state positions; let them bicker, persuade, or sit in silence together. See where the conversation goes." + "prompt11": "What skill or craft have you always wanted to learn but haven't? Immerse yourself in a detailed fantasy of mastering it. Describe the feel of the tools in your hands, the initial frustrations, the first small success, the growing muscle memory. What does the final, perfected product of your labor look or feel like? Live in that imagined\u6210\u5c31\u611f." }, { - "prompt12": "Describe your childhood home from the perspective of a small animal (a mouse, a squirrel, a bird) that lived there concurrently with you. What did this creature notice about your family's rhythms, the layout, the dangers, and the treasures (crumbs, cozy materials)? How did it perceive you, the giant human child?" + "prompt12": "Write a dialogue between two aspects of yourself (e.g., Your Ambitious Self and Your Tired Self; Your Cynical Self and Your Hopeful Self). Give them distinct voices. What are they arguing about, negotiating, or planning? Don't just state positions; let them bicker, persuade, or sit in silence together. See where the conversation goes." }, { - "prompt13": "List five paths your life could have taken if you'd made one different choice. Briefly outline each alternate reality. Then, choose one and dive deep: write a journal entry from that version of you today. What are their worries, joys, and regrets? How is their voice similar to or different from your own?" + "prompt13": "Describe your childhood home from the perspective of a small animal (a mouse, a squirrel, a bird) that lived there concurrently with you. What did this creature notice about your family's rhythms, the layout, the dangers, and the treasures (crumbs, cozy materials)? How did it perceive you, the giant human child?" }, { - "prompt14": "Think of a person you see regularly but do not know (a barista, a neighbor, a commuter). Invent a rich, secret inner life for them. What profound private mission are they on? What hidden talent do they possess? What great sorrow or hope are they carrying today as they serve your coffee or stand on the platform? Write from their perspective." + "prompt14": "List five paths your life could have taken if you'd made one different choice. Briefly outline each alternate reality. Then, choose one and dive deep: write a journal entry from that version of you today. What are their worries, joys, and regrets? How is their voice similar to or different from your own?" }, { - "prompt15": "What is a belief you held strongly five or ten years ago that you have since questioned or abandoned? Trace the evolution of that change. Was it a sudden shattering or a slow erosion? What person, experience, or piece of information was the catalyst? Describe the feeling of the ground shifting under that particular piece of your worldview." + "prompt15": "Think of a person you see regularly but do not know (a barista, a neighbor, a commuter). Invent a rich, secret inner life for them. What profound private mission are they on? What hidden talent do they possess? What great sorrow or hope are they carrying today as they serve your coffee or stand on the platform? Write from their perspective." }, { - "prompt16": "Describe a common, mundane process (making tea, tying your shoes, doing laundry) in extreme, almost absurdly epic detail, as if you were writing a sacred manual or a scientific treatise for an alien civilization. Break down every micro-action, every sensation, every potential variable. Find the profound in the procedural." + "prompt16": "What is a belief you held strongly five or ten years ago that you have since questioned or abandoned? Trace the evolution of that change. Was it a sudden shattering or a slow erosion? What person, experience, or piece of information was the catalyst? Describe the feeling of the ground shifting under that particular piece of your worldview." }, { - "prompt17": "You are given a suitcase and told you must leave your home in one hour, not knowing if or when you'll return. You can only take what fits in the case. Describe, in real-time, the frantic and deliberate process of choosing. What practical items make the cut? What irreplaceable tokens? What do you leave behind, and what does that feel like?" + "prompt17": "Describe a common, mundane process (making tea, tying your shoes, doing laundry) in extreme, almost absurdly epic detail, as if you were writing a sacred manual or a scientific treatise for an alien civilization. Break down every micro-action, every sensation, every potential variable. Find the profound in the procedural." }, { - "prompt18": "Write about water in three different forms: as a memory involving a body of water (ocean, river, bath), as a description of drinking a glass of water right now, and as a metaphor for an emotion. Move seamlessly between these three aspects. Let the fluidity of the theme connect them." + "prompt18": "You are given a suitcase and told you must leave your home in one hour, not knowing if or when you'll return. You can only take what fits in the case. Describe, in real-time, the frantic and deliberate process of choosing. What practical items make the cut? What irreplaceable tokens? What do you leave behind, and what does that feel like?" }, { - "prompt19": "What does silence sound like in your current environment? Don't just say 'quiet.' Describe the layers of sound that actually constitute the silence\u2014the hums, ticks, distant rumbles, the sound of your own body. Now, project what this same space sounded like 100 years ago, and what it might sound like 100 years from now." + "prompt19": "Write about water in three different forms: as a memory involving a body of water (ocean, river, bath), as a description of drinking a glass of water right now, and as a metaphor for an emotion. Move seamlessly between these three aspects. Let the fluidity of the theme connect them." }, { - "prompt20": "Create a recipe for a dish that represents your current life phase. List ingredients (e.g., \"two cups of transition,\" \"a pinch of anxiety,\" \"a steady base of routine\"). Write the instructions, including the method, cooking time, and necessary equipment. Describe the final product's taste, texture, and who it should be shared with." + "prompt20": "What does silence sound like in your current environment? Don't just say 'quiet.' Describe the layers of sound that actually constitute the silence\u2014the hums, ticks, distant rumbles, the sound of your own body. Now, project what this same space sounded like 100 years ago, and what it might sound like 100 years from now." }, { - "prompt21": "Recall a dream from the past week, however fragmentary. Don't interpret it. Instead, expand it. Continue the narrative from where it left off. Describe the dream logic, the landscape, the characters. Let it become a story. Where does your dreaming mind take you when given free rein on the page?" + "prompt21": "Create a recipe for a dish that represents your current life phase. List ingredients (e.g., \"two cups of transition,\" \"a pinch of anxiety,\" \"a steady base of routine\"). Write the instructions, including the method, cooking time, and necessary equipment. Describe the final product's taste, texture, and who it should be shared with." }, { - "prompt22": "Make a list of everything that is blue in your immediate environment. Describe each shade specifically (slate, cobalt, robin's egg, faded denim). Then, choose one blue object and write about its journey to being here, in this blue state, in front of you. How did it get its color? What has it reflected?" + "prompt22": "Recall a dream from the past week, however fragmentary. Don't interpret it. Instead, expand it. Continue the narrative from where it left off. Describe the dream logic, the landscape, the characters. Let it become a story. Where does your dreaming mind take you when given free rein on the page?" }, { - "prompt23": "Write a eulogy for something you've lost that isn't a person\u2014a habit, a version of a city, a relationship dynamic, a part of your identity. Acknowledge its virtues and its flaws. Say goodbye properly, with humor, regret, and gratitude. What did it give you? What space has its departure created?" + "prompt23": "Make a list of everything that is blue in your immediate environment. Describe each shade specifically (slate, cobalt, robin's egg, faded denim). Then, choose one blue object and write about its journey to being here, in this blue state, in front of you. How did it get its color? What has it reflected?" }, { - "prompt24": "Describe your hands. Not just their appearance, but their capabilities, their scars, their memories. What have they held, built, comforted, or torn down? What do their specific aches and strengths tell you about the life you've lived so far? If your hands could speak, what would they say they want to do next?" + "prompt24": "Write a eulogy for something you've lost that isn't a person\u2014a habit, a version of a city, a relationship dynamic, a part of your identity. Acknowledge its virtues and its flaws. Say goodbye properly, with humor, regret, and gratitude. What did it give you? What space has its departure created?" }, { - "prompt25": "Imagine you can overhear the conversation of the people at the table next to you in a caf\u00e9, but they are speaking in a language you don't understand. Based on their tone, gestures, pauses, and expressions, invent the dialogue. What crucial, funny, or tragic misunderstanding are they having? What are they *really* talking about?" + "prompt25": "Describe your hands. Not just their appearance, but their capabilities, their scars, their memories. What have they held, built, comforted, or torn down? What do their specific aches and strengths tell you about the life you've lived so far? If your hands could speak, what would they say they want to do next?" }, { - "prompt26": "What is a piece of art (a song, painting, film, book) that fundamentally moved you? Describe the first time you encountered it. Don't just analyze why it's good; describe the physical and emotional reaction it provoked. Has its meaning changed for you over time? How does it live inside you now?" + "prompt26": "Imagine you can overhear the conversation of the people at the table next to you in a caf\u00e9, but they are speaking in a language you don't understand. Based on their tone, gestures, pauses, and expressions, invent the dialogue. What crucial, funny, or tragic misunderstanding are they having? What are they *really* talking about?" }, { - "prompt27": "You have one day completely alone, with no obligations and no possibility of communication. The power and internet are out. How do you spend the hours from waking to sleeping? Detail the rituals, the wanderings, the thoughts, the meals. Do you enjoy the solitude or chafe against it? What arises in the quiet?" + "prompt27": "What is a piece of art (a song, painting, film, book) that fundamentally moved you? Describe the first time you encountered it. Don't just analyze why it's good; describe the physical and emotional reaction it provoked. Has its meaning changed for you over time? How does it live inside you now?" }, { - "prompt28": "Personify a negative emotion you've been feeling lately (e.g., anxiety, envy, restlessness). Give it a name, a form, a voice. Write a character profile of it. What does it want? What does it fear? What flawed logic does it operate under? Then, write a short scene of you having a cup of tea with it, listening to its perspective." + "prompt28": "You have one day completely alone, with no obligations and no possibility of communication. The power and internet are out. How do you spend the hours from waking to sleeping? Detail the rituals, the wanderings, the thoughts, the meals. Do you enjoy the solitude or chafe against it? What arises in the quiet?" }, { - "prompt29": "Describe a city you've never been to, based solely on the stories, images, and snippets you've absorbed about it. Build it from imagination and second-hand clues. Then, contrast that with a description of your own street, seen with the hyper-attentive eyes of a first-time visitor. Make the familiar alien, and the alien familiar." + "prompt29": "Personify a negative emotion you've been feeling lately (e.g., anxiety, envy, restlessness). Give it a name, a form, a voice. Write a character profile of it. What does it want? What does it fear? What flawed logic does it operate under? Then, write a short scene of you having a cup of tea with it, listening to its perspective." }, { - "prompt30": "Think of a crossroads in your past. Now, imagine you see a ghost of your former self standing there, frozen in that moment of decision. What would you want to say to that ghost? Would you offer comfort, a warning, or just silent companionship? Write the encounter. Does the ghost speak back?" + "prompt30": "Describe a city you've never been to, based solely on the stories, images, and snippets you've absorbed about it. Build it from imagination and second-hand clues. Then, contrast that with a description of your own street, seen with the hyper-attentive eyes of a first-time visitor. Make the familiar alien, and the alien familiar." }, { - "prompt31": "What is a tradition in your family or community\u2014big or small\u2014that you find meaningful? Describe its sensory details, its rhythms, its players. Now, trace its origin. How did it start? Has it mutated over time? What does its continued practice say about what your family values, fears, or hopes for?" + "prompt31": "Think of a crossroads in your past. Now, imagine you see a ghost of your former self standing there, frozen in that moment of decision. What would you want to say to that ghost? Would you offer comfort, a warning, or just silent companionship? Write the encounter. Does the ghost speak back?" }, { - "prompt32": "Choose a year from your past. Catalog the soundtrack of that year: songs on the radio, albums you loved, jingles, background music. For each, describe a specific memory or feeling it evokes. How does the music of that time period color your memory of the entire era? What does it sound like to you now?" + "prompt32": "What is a tradition in your family or community\u2014big or small\u2014that you find meaningful? Describe its sensory details, its rhythms, its players. Now, trace its origin. How did it start? Has it mutated over time? What does its continued practice say about what your family values, fears, or hopes for?" }, { - "prompt33": "Write instructions for a stranger on how to be you for a day. Include the essential routines, the internal dialogues to expect, the things to avoid, the small comforts to lean on, and the passwords to your various anxieties. Be brutally honest and surprisingly practical. What would they find hardest to mimic?" + "prompt33": "Choose a year from your past. Catalog the soundtrack of that year: songs on the radio, albums you loved, jingles, background music. For each, describe a specific memory or feeling it evokes. How does the music of that time period color your memory of the entire era? What does it sound like to you now?" }, { - "prompt34": "Describe a moment of unexpected kindness, either given or received. Don't frame it as a grand gesture. Focus on a small, almost invisible act. What were the circumstances? Why was it so potent? How did it ripple out, changing the temperature of your day or your perception of someone?" + "prompt34": "Write instructions for a stranger on how to be you for a day. Include the essential routines, the internal dialogues to expect, the things to avoid, the small comforts to lean on, and the passwords to your various anxieties. Be brutally honest and surprisingly practical. What would they find hardest to mimic?" }, { - "prompt35": "You discover you have a superpower, but it is frustratingly mundane and specific (e.g., the ability to always know exactly what time it is without a clock, to perfectly fold fitted sheets, to find lost buttons). Explore the practical uses, the minor heroics, the unexpected downsides, and the peculiar loneliness of this unique gift." + "prompt35": "Describe a moment of unexpected kindness, either given or received. Don't frame it as a grand gesture. Focus on a small, almost invisible act. What were the circumstances? Why was it so potent? How did it ripple out, changing the temperature of your day or your perception of someone?" }, { - "prompt36": "Go to a window. Describe the view in extreme detail, as if painting it with words, for five minutes. Then, close your eyes and describe the view from a window that was significant to you in the past (your childhood bedroom, a previous office, a grandparent's house). Juxtapose the two landscapes on the page." + "prompt36": "You discover you have a superpower, but it is frustratingly mundane and specific (e.g., the ability to always know exactly what time it is without a clock, to perfectly fold fitted sheets, to find lost buttons). Explore the practical uses, the minor heroics, the unexpected downsides, and the peculiar loneliness of this unique gift." }, { - "prompt37": "What is a question you are tired of being asked? Write a rant about why it's so irritating, reductive, or painful. Then, flip it: write the question you wish people would ask you instead. Answer that new question fully and generously." + "prompt37": "Go to a window. Describe the view in extreme detail, as if painting it with words, for five minutes. Then, close your eyes and describe the view from a window that was significant to you in the past (your childhood bedroom, a previous office, a grandparent's house). Juxtapose the two landscapes on the page." }, { - "prompt38": "Describe a hobby or interest you have from the perspective of someone who finds it utterly baffling and boring. Then, defend it with the passionate zeal of a true devotee. Try to convey its magic and depth to this imagined skeptic. What is the core beauty you see that they miss?" + "prompt38": "What is a question you are tired of being asked? Write a rant about why it's so irritating, reductive, or painful. Then, flip it: write the question you wish people would ask you instead. Answer that new question fully and generously." }, { - "prompt39": "List ten things you would do if you were not afraid. They can be grand (quit my job) or small (sing karaoke). Choose one and vividly imagine doing it. Walk through every step, from decision to action to aftermath. How does the air feel different on the other side of that fear?" + "prompt39": "Describe a hobby or interest you have from the perspective of someone who finds it utterly baffling and boring. Then, defend it with the passionate zeal of a true devotee. Try to convey its magic and depth to this imagined skeptic. What is the core beauty you see that they miss?" }, { - "prompt40": "Write about a time you got exactly what you wanted\u2014and it was not what you expected. Describe the desire, the anticipation, the moment of attainment, and the subtle (or not-so-subtle) disappointment or confusion that followed. What did that experience teach you about wanting?" + "prompt40": "List ten things you would do if you were not afraid. They can be grand (quit my job) or small (sing karaoke). Choose one and vividly imagine doing it. Walk through every step, from decision to action to aftermath. How does the air feel different on the other side of that fear?" }, { - "prompt41": "Personify your favorite season. Give it a personality, a wardrobe, a way of speaking, a scent. Write a monologue from its perspective. What does it think of humans? What is its purpose? What does it love and resent about its place in the yearly cycle? Let it defend itself against its critics." + "prompt41": "Write about a time you got exactly what you wanted\u2014and it was not what you expected. Describe the desire, the anticipation, the moment of attainment, and the subtle (or not-so-subtle) disappointment or confusion that followed. What did that experience teach you about wanting?" }, { - "prompt42": "Describe a room after a significant emotional event has occurred (a fight, a celebration, a profound conversation), but without mentioning the event or the people. Let the objects, the disarray, the quality of light, the lingering smells tell the story. What is the room holding now?" + "prompt42": "Personify your favorite season. Give it a personality, a wardrobe, a way of speaking, a scent. Write a monologue from its perspective. What does it think of humans? What is its purpose? What does it love and resent about its place in the yearly cycle? Let it defend itself against its critics." }, { - "prompt43": "What is a rule you live by? It can be profound ('assume good intent') or practical ('never grocery shop hungry'). Explain its origin story. When have you broken it, and what were the consequences? How has following it shaped your life? Argue for its universal adoption." + "prompt43": "Describe a room after a significant emotional event has occurred (a fight, a celebration, a profound conversation), but without mentioning the event or the people. Let the objects, the disarray, the quality of light, the lingering smells tell the story. What is the room holding now?" }, { - "prompt44": "Imagine you can send a message of exactly 100 words into the future, to be read by you in ten years. What do you say? What do you ask? What current worry do you want to soothe, or what current joy do you want future-you to remember? Write the message. Then, write a 100-word message from you-ten-years-ago to present-you." + "prompt44": "What is a rule you live by? It can be profound ('assume good intent') or practical ('never grocery shop hungry'). Explain its origin story. When have you broken it, and what were the consequences? How has following it shaped your life? Argue for its universal adoption." }, { - "prompt45": "Describe a color to someone who has been blind from birth. Use metaphor, texture, temperature, sound, emotion, and memory. Don't rely on sight-based comparisons ('like the sky'). Try to make them *feel* the essence of 'red' or 'blue' or 'gold' in their bones." + "prompt45": "Imagine you can send a message of exactly 100 words into the future, to be read by you in ten years. What do you say? What do you ask? What current worry do you want to soothe, or what current joy do you want future-you to remember? Write the message. Then, write a 100-word message from you-ten-years-ago to present-you." }, { - "prompt46": "Write about a book that changed your mind. Not just one you loved, but one that actively altered your perspective on a topic. Describe your stance before, the unsettling process of reading it, and the new landscape of thought afterwards. What made you vulnerable to its argument?" + "prompt46": "Describe a color to someone who has been blind from birth. Use metaphor, texture, temperature, sound, emotion, and memory. Don't rely on sight-based comparisons ('like the sky'). Try to make them *feel* the essence of 'red' or 'blue' or 'gold' in their bones." }, { - "prompt47": "Catalog the contents of a junk drawer or a cluttered bag\u2014yours or an imagined one. Describe each item with care, as an archaeologist might. Then, construct a biography of the drawer's owner based solely on these artifacts. What story do these mundane relics tell?" + "prompt47": "Write about a book that changed your mind. Not just one you loved, but one that actively altered your perspective on a topic. Describe your stance before, the unsettling process of reading it, and the new landscape of thought afterwards. What made you vulnerable to its argument?" }, { - "prompt48": "What does your body know how to do that your mind often forgets? (e.g., breathe deeply, relax into sleep, find rhythm in a walk). Write a series of instructions from your body to your mind, teaching it this skill again. Use the language of sensation, not thought." + "prompt48": "Catalog the contents of a junk drawer or a cluttered bag\u2014yours or an imagined one. Describe each item with care, as an archaeologist might. Then, construct a biography of the drawer's owner based solely on these artifacts. What story do these mundane relics tell?" }, { - "prompt49": "Describe a journey you take every day (commute, walk the dog, trip to the kitchen) as a epic quest. Cast yourself as the hero, the mundane obstacles as trials (the traffic dragon, the staircase mountain), and the destination as a holy grail. Infuse the ordinary with mythic significance." + "prompt49": "What does your body know how to do that your mind often forgets? (e.g., breathe deeply, relax into sleep, find rhythm in a walk). Write a series of instructions from your body to your mind, teaching it this skill again. Use the language of sensation, not thought." }, { - "prompt50": "Write a review of today, as if it were a product, a performance, or a restaurant. Give it star ratings in different categories (Productivity, Serendipity, Comfort, Learning). Write the critic's summary. Be witty, be harsh, be fair. What was the highlight? The biggest flaw? Would you recommend today to a friend?" + "prompt50": "Describe a journey you take every day (commute, walk the dog, trip to the kitchen) as a epic quest. Cast yourself as the hero, the mundane obstacles as trials (the traffic dragon, the staircase mountain), and the destination as a holy grail. Infuse the ordinary with mythic significance." }, { - "prompt51": "Think of a word you love the sound of. Write it at the top of the page. Now, free-associate from that word\u2014not just meanings, but sounds, memories, images. Let it spin a web of connections. Where does it lead you? Try to capture the aesthetic and emotional resonance of the word itself." + "prompt51": "Write a review of today, as if it were a product, a performance, or a restaurant. Give it star ratings in different categories (Productivity, Serendipity, Comfort, Learning). Write the critic's summary. Be witty, be harsh, be fair. What was the highlight? The biggest flaw? Would you recommend today to a friend?" }, { - "prompt52": "Describe a piece of technology you use daily from the perspective of a person from 200 years ago. Have them stumble upon it and try to deduce its purpose, its magic, and its societal implications from its form and behavior. What would they find beautiful, terrifying, or absurd?" + "prompt52": "Think of a word you love the sound of. Write it at the top of the page. Now, free-associate from that word\u2014not just meanings, but sounds, memories, images. Let it spin a web of connections. Where does it lead you? Try to capture the aesthetic and emotional resonance of the word itself." }, { - "prompt53": "Write a gratitude list, but for difficult things. Be specific. Not just 'my job,' but 'the particular frustration of my project that forced me to learn a new skill.' Find the hidden gift in the challenge, the strength forged in the irritation, the clarity born of the sorrow." + "prompt53": "Describe a piece of technology you use daily from the perspective of a person from 200 years ago. Have them stumble upon it and try to deduce its purpose, its magic, and its societal implications from its form and behavior. What would they find beautiful, terrifying, or absurd?" }, { - "prompt54": "You meet a version of yourself from a parallel universe where one key life detail is different (you chose a different career, never moved, stayed with a different partner). Have a conversation with them. What do you envy? What do you pity? What fundamental part of 'you' remains the same?" + "prompt54": "Write a gratitude list, but for difficult things. Be specific. Not just 'my job,' but 'the particular frustration of my project that forced me to learn a new skill.' Find the hidden gift in the challenge, the strength forged in the irritation, the clarity born of the sorrow." }, { - "prompt55": "Describe a taste from your childhood that you can almost, but not quite, recall\u2014a specific candy, a grandparent's dish, a seasonal treat. Try to chase the memory with all your senses. What else was happening when you tasted it? Who was there? Why is it lost? The struggle to remember is the story." + "prompt55": "You meet a version of yourself from a parallel universe where one key life detail is different (you chose a different career, never moved, stayed with a different partner). Have a conversation with them. What do you envy? What do you pity? What fundamental part of 'you' remains the same?" }, { - "prompt56": "What is a place that feels like a sanctuary to you? Describe it not just physically, but atmospherically. What rules (spoken or unspoken) govern it? What happens to your internal noise when you enter? What would it mean to carry the essence of that place with you into busier, louder realms?" + "prompt56": "Describe a taste from your childhood that you can almost, but not quite, recall\u2014a specific candy, a grandparent's dish, a seasonal treat. Try to chase the memory with all your senses. What else was happening when you tasted it? Who was there? Why is it lost? The struggle to remember is the story." }, { - "prompt57": "Write about waiting. Describe a specific time you were waiting for something (big or small). Capture the texture of the time itself\u2014how it stretched, what you noticed, the cycles of hope and boredom. What did you learn in the suspension? The action is in the inaction." + "prompt57": "What is a place that feels like a sanctuary to you? Describe it not just physically, but atmospherically. What rules (spoken or unspoken) govern it? What happens to your internal noise when you enter? What would it mean to carry the essence of that place with you into busier, louder realms?" }, { - "prompt58": "Compose a manifesto for a very small, personal revolution. What outdated pattern, fear, or limitation are you overthrowing? What are your guiding principles? What is your first, tiny act of rebellion? Use bold, declarative language. Declare your independence from something that no longer serves you." + "prompt58": "Write about waiting. Describe a specific time you were waiting for something (big or small). Capture the texture of the time itself\u2014how it stretched, what you noticed, the cycles of hope and boredom. What did you learn in the suspension? The action is in the inaction." }, { - "prompt59": "Describe a conflict you witnessed but were not part of\u2014between strangers, friends, or family members. Focus on the subtext: the body language, the words not said, the history simmering beneath the surface. What did you understand about each person from this glimpse? Why has this particular conflict stuck with you?" + "prompt59": "Compose a manifesto for a very small, personal revolution. What outdated pattern, fear, or limitation are you overthrowing? What are your guiding principles? What is your first, tiny act of rebellion? Use bold, declarative language. Declare your independence from something that no longer serves you." } ] \ No newline at end of file diff --git a/pool_prompts.json b/pool_prompts.json new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/pool_prompts.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/run.sh b/run.sh index d36da92..4a2cd31 100755 --- a/run.sh +++ b/run.sh @@ -7,95 +7,114 @@ echo "📓 Daily Journal Prompt Generator" echo "=================================" # Check if Python is installed -if ! command -v python3 &> /dev/null; then - echo "❌ Python 3 is required but not installed." - exit 1 +if ! command -v python3 &>/dev/null; then + echo "❌ Python 3 is required but not installed." + exit 1 fi # Check if .env file exists if [ ! -f ".env" ]; then - echo "⚠️ .env file not found. Creating from example..." - if [ -f "example.env" ]; then - cp example.env .env - echo "✅ Created .env file from example." - echo " Please edit .env and add your API key." - exit 1 - else - echo "❌ example.env not found either." - exit 1 - fi + echo "⚠️ .env file not found. Creating from example..." + if [ -f "example.env" ]; then + cp example.env .env + echo "✅ Created .env file from example." + echo " Please edit .env and add your API key." + exit 1 + else + echo "❌ example.env not found either." + exit 1 + fi fi # Check if dependencies are installed echo "🔍 Checking dependencies..." -if ! python3 -c "import openai, dotenv" &> /dev/null; then - echo "📦 Installing dependencies..." - pip install -r requirements.txt +if ! python3 -c "import openai, dotenv" &>/dev/null; then + echo "📦 Installing dependencies..." + pip install -r requirements.txt fi # Parse command line arguments INTERACTIVE=false SIMPLE=false STATS=false +POOL_STATS=false +FILL_POOL=false HELP=false while [[ $# -gt 0 ]]; do - case $1 in - -i|--interactive) - INTERACTIVE=true - shift - ;; - -s|--simple) - SIMPLE=true - shift - ;; - --stats) - STATS=true - shift - ;; - -h|--help) - HELP=true - shift - ;; - *) - echo "❌ Unknown option: $1" - echo " Use -h for help" - exit 1 - ;; - esac + case $1 in + -i | --interactive) + INTERACTIVE=true + shift + ;; + -s | --simple) + SIMPLE=true + shift + ;; + --stats) + STATS=true + shift + ;; + --pool-stats) + POOL_STATS=true + shift + ;; + --fill-pool) + FILL_POOL=true + shift + ;; + -h | --help) + HELP=true + shift + ;; + *) + echo "❌ Unknown option: $1" + echo " Use -h for help" + exit 1 + ;; + esac done if [ "$HELP" = true ]; then - echo "Usage: ./run.sh [OPTIONS]" - echo "" - echo "Options:" - echo " -i, --interactive Run in interactive mode (with rich interface)" - echo " -s, --simple Run simple version (no rich dependency)" - echo " --stats Show prompt history statistics" - echo " -h, --help Show this help message" - echo "" - echo "Examples:" - echo " ./run.sh # Generate prompts (default)" - echo " ./run.sh -i # Interactive mode" - echo " ./run.sh -s # Simple version" - echo " ./run.sh --stats # Show statistics" - exit 0 + echo "Usage: ./run.sh [OPTIONS]" + echo "" + echo "Options:" + echo " -i, --interactive Run in interactive mode (with rich interface)" + echo " -s, --simple Run simple version (no rich dependency)" + echo " --stats Show prompt history statistics" + echo " --pool-stats Show prompt pool statistics" + echo " --fill-pool Fill prompt pool using AI (makes API call)" + echo " -h, --help Show this help message" + echo "" + echo "Examples:" + echo " ./run.sh # Draw prompts from pool (default)" + echo " ./run.sh -i # Interactive mode" + echo " ./run.sh -s # Simple version" + echo " ./run.sh --stats # Show history statistics" + echo " ./run.sh --pool-stats # Show pool statistics" + echo " ./run.sh --fill-pool # Fill prompt pool using AI" + exit 0 fi if [ "$STATS" = true ]; then - echo "📊 Showing statistics..." - python3 generate_prompts.py --stats + echo "📊 Showing history statistics..." + python3 generate_prompts.py --stats +elif [ "$POOL_STATS" = true ]; then + echo "📊 Showing pool statistics..." + python3 generate_prompts.py --pool-stats +elif [ "$FILL_POOL" = true ]; then + echo "🔄 Filling prompt pool using AI..." + python3 generate_prompts.py --fill-pool elif [ "$INTERACTIVE" = true ]; then - echo "🎮 Starting interactive mode..." - python3 generate_prompts.py --interactive + echo "🎮 Starting interactive mode..." + python3 generate_prompts.py --interactive elif [ "$SIMPLE" = true ]; then - echo "⚡ Running simple version..." - python3 simple_generate.py + echo "⚡ Running simple version..." + python3 simple_generate.py else - echo "✨ Generating prompts..." - python3 generate_prompts.py + echo "✨ Drawing prompts from pool..." + python3 generate_prompts.py fi echo "" echo "✅ Done! Happy journaling! 📓" - diff --git a/settings.cfg b/settings.cfg index b34f725..361a8d1 100644 --- a/settings.cfg +++ b/settings.cfg @@ -5,8 +5,8 @@ [prompts] min_length = 500 max_length = 1000 -num_prompts = 8 +num_prompts = 3 # Prefetch not yet implmented [prefetch] -prompt_cache_depth = 3 +cached_pool_volume = 20