### Docker Compose Deployment for MuMuAINovel Source: https://github.com/neosun100/mumuainovel/blob/main/README.md This snippet demonstrates the recommended deployment method for MuMuAINovel using Docker Compose. It involves cloning the repository, configuring environment variables in a .env file, and starting the services with `docker-compose up -d`. Ensure you have Docker and Docker Compose installed. ```bash # 1. Clone the project git clone https://github.com/neosun100/MuMuAINovel.git cd MuMuAINovel # 2. Configure environment variables cp .env.example .env # Edit .env file, fill in API Key and database password # 3. Start services docker-compose up -d # 4. Access the application # Open browser and visit http://localhost:8000 ``` -------------------------------- ### Foreshadowing API Examples (Bash) Source: https://github.com/neosun100/mumuainovel/blob/main/README_EN.md Examples for interacting with the Foreshadowing API, including creating foreshadows, retrieving reminders, and resolving foreshadows. These operations are performed using HTTP POST and GET requests. ```bash # Create foreshadow POST /api/foreshadows { "project_id": "uuid", "title": "Mysterious Letter", "description": "Protagonist receives a letter from the future", "foreshadow_type": "plot", "planted_chapter": 3 } # Get pending foreshadow reminders GET /api/foreshadows/reminders?project_id={id}¤t_chapter=10 # Resolve foreshadow POST /api/foreshadows/{id}/resolve { "resolved_chapter": 15, "resolution_description": "The truth of the letter is revealed" } ``` -------------------------------- ### Style Analysis API Examples (Bash) Source: https://github.com/neosun100/mumuainovel/blob/main/README_EN.md Demonstrates how to analyze the writing style of a project using the Style Analysis API. It shows the POST request to initiate analysis and provides an example response detailing various stylistic elements. ```bash # Analyze project writing style POST /api/style-analysis/project/{project_id}/analyze # Response example { "narrative_style": "Enthusiastic", "description_style": "Delicate and vivid", "pacing": "Well-balanced", "language_style": "Modern vernacular", "emotional_tone": "Positive", "style_summary": "The work has a bright style..." } ``` -------------------------------- ### Timeline API Examples (Bash) Source: https://github.com/neosun100/mumuainovel/blob/main/README_EN.md Examples for managing timeline events within a project. This includes creating new timeline events with details like title, type, story day, chapter number, and related characters, as well as retrieving timeline events based on project ID and event type. ```bash # Create timeline event POST /api/timeline { "project_id": "uuid", "title": "Protagonist Awakening", "event_type": "major_plot", "story_day": 1, "chapter_number": 5, "related_characters": ["Character A", "Character B"] } # Get timeline GET /api/timeline?project_id={id}&event_type=major_plot ``` -------------------------------- ### Character Growth API Examples (Bash) Source: https://github.com/neosun100/mumuainovel/blob/main/README_EN.md Examples for tracking character growth over time. This includes creating new growth records with details about the change and retrieving a character's growth timeline based on character ID and growth type. ```bash # Create growth record POST /api/character-growth { "project_id": "uuid", "character_id": "uuid", "growth_type": "ability", "chapter_number": 10, "before_state": "Ordinary person", "after_state": "Awakened", "description": "Protagonist awakens hidden abilities in crisis" } # Get character growth timeline GET /api/character-growth/character/{character_id}?growth_type=ability ``` -------------------------------- ### Consistency Check API Examples (Bash) Source: https://github.com/neosun100/mumuainovel/blob/main/README_EN.md Examples for using the Consistency Check API to verify chapter and plot consistency. It includes an example of checking a chapter and a sample response structure detailing scores and suggestions. ```bash # Check chapter consistency POST /api/consistency/chapter/{chapter_id}/check # Response example { "overall_score": 85, "character_consistency": { "score": 90, "issues": [] }, "plot_consistency": { "score": 80, "issues": ["Minor timeline contradiction"] }, "suggestions": ["Check time description in chapter 5"] } ``` -------------------------------- ### Quality Scoring API Examples (Bash) Source: https://github.com/neosun100/mumuainovel/blob/main/README_EN.md Examples for retrieving quality metrics for chapters. It includes endpoints for basic quality metrics and a comprehensive AI evaluation, along with a sample response structure containing scores, grade, and suggestions. ```bash # Get basic quality metrics GET /api/quality/chapter/{chapter_id}/basic # AI comprehensive evaluation POST /api/quality/chapter/{chapter_id}/evaluate # Response example { "basic_total": 75, "ai_evaluation": { "writing_quality": 80, "pacing": 70, "plot_development": 75, "dialogue": 80 }, "grade": "B", "suggestions": ["Add more environmental descriptions"] } ``` -------------------------------- ### Duplicate Detection API Examples (Bash) Source: https://github.com/neosun100/mumuainovel/blob/main/README_EN.md Examples for detecting duplicate content within chapters and across the entire project. It shows how to check for internal chapter duplicates and project-level duplicates with adjustable thresholds and chapter limits. ```bash # Check chapter internal duplicates GET /api/duplicate/chapter/{chapter_id}/check?threshold=0.7 # Check project-level duplicates GET /api/duplicate/project/{project_id}/check?threshold=0.7&max_chapters=20 ``` -------------------------------- ### Get Polish Preview Source: https://context7.com/neosun100/mumuainovel/llms.txt Returns a preview of polishing suggestions without applying changes to the original text. ```APIDOC ## POST /api/polish/preview ### Description Returns a preview of polishing suggestions without applying changes to the original text. ### Method POST ### Endpoint /api/polish/preview ### Parameters #### Request Body - **text** (string) - Required - The sample text to generate a polishing preview for. - **polish_intensity** (string) - Optional - The intensity level of polishing for the preview. Example values: "light", "medium", "heavy". ### Request Example ```json { "text": "Sample text to polish", "polish_intensity": "light" } ``` ### Response #### Success Response (200) - **preview_text** (string) - The text with suggested polishing changes. - **suggestions** (array) - A list of specific suggestions or changes made. #### Response Example ```json { "preview_text": "Polished sample text.", "suggestions": [ { "original": "Sample text", "polished": "Polished sample", "reason": "Improved flow" } ] } ``` ``` -------------------------------- ### Get Project Outlines Source: https://context7.com/neosun100/mumuainovel/llms.txt Retrieves all outlines for a specific project, ordered by chapter index, including content summaries and structural metadata. ```APIDOC ## GET /api/outlines/project/{project_id} ### Description Retrieves all outlines associated with a given project ID, ordered chronologically. ### Method GET ### Endpoint https://api.example.com/api/outlines/project/{project_id} ### Parameters #### Path Parameters - **project_id** (string) - Required - The unique identifier for the project. #### Query Parameters None ### Request Example ```bash curl -X GET "https://api.example.com/api/outlines/project/your_project_uuid" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ### Response #### Success Response (200) - **outlines** (array) - A list of outline objects. - **outline_id** (string) - The unique identifier for the outline. - **title** (string) - The title of the outline. - **summary** (string) - A brief summary of the outline's content. - **chapter_index** (integer) - The chronological index of the outline. #### Response Example ```json { "outlines": [ { "outline_id": "outline_uuid_1", "title": "Chapter 1: The Beginning", "summary": "Introduction of the main character and setting.", "chapter_index": 1 }, { "outline_id": "outline_uuid_2", "title": "Chapter 2: The Call to Adventure", "summary": "The protagonist receives a mysterious message.", "chapter_index": 2 } ] } ``` ``` -------------------------------- ### Configure ESLint for Type-Aware Linting in TypeScript/React Source: https://github.com/neosun100/mumuainovel/blob/main/frontend/README.md This configuration expands ESLint to enable type-aware lint rules for TypeScript and React projects. It requires specifying project configuration files and the root directory. Ensure you have the necessary ESLint plugins installed. ```javascript export default defineConfig([ globalIgnores(['dist']), { files: ['**/*.{ts,tsx}'] extends: [ // Other configs... // Remove tseslint.configs.recommended and replace with this tseslint.configs.recommendedTypeChecked, // Alternatively, use this for stricter rules tseslint.configs.strictTypeChecked, // Optionally, add this for stylistic rules tseslint.configs.stylisticTypeChecked, // Other configs... ], languageOptions: { parserOptions: { project: ['./tsconfig.node.json', './tsconfig.app.json'], tsconfigRootDir: import.meta.dirname }, // other options... }, }, ]) ``` -------------------------------- ### Install Sentence-Transformers Library Source: https://github.com/neosun100/mumuainovel/blob/main/backend/embedding/models--sentence-transformers--paraphrase-multilingual-MiniLM-L12-v2/snapshots/86741b4e3f5cb7765a600d3a3d55a0f6a6cb443d/README.md Installs the Sentence-Transformers library, which simplifies the process of using pre-trained models for sentence and paragraph embeddings. This is a prerequisite for using the model with the Sentence-Transformers framework. ```bash pip install -U sentence-transformers ``` -------------------------------- ### Get Specific Project Details Source: https://context7.com/neosun100/mumuainovel/llms.txt Retrieves comprehensive details for a specific project, identified by its ID. This includes settings, statistics, and world-building configurations. ```bash curl -X GET "https://api.example.com/api/projects/{project_id}" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Docker Hub Image Deployment for MuMuAINovel Source: https://github.com/neosun100/mumuainovel/blob/main/README.md This snippet outlines how to deploy MuMuAINovel using a pre-built Docker image from Docker Hub. It includes pulling the latest image, configuring environment variables, and starting the services. This method is convenient for users who prefer not to build the image from source. ```bash # Pull latest image (includes model files) docker pull mumujie/mumuainovel:latest # Configure and start cp .env.example .env docker-compose up -d ``` -------------------------------- ### Pull and Run MuMuAINovel Docker Hub Image Source: https://github.com/neosun100/mumuainovel/blob/main/README_EN.md This snippet provides instructions for users who prefer to use the pre-built Docker Hub image for MuMuAINovel. It involves pulling the latest image and then starting the services using Docker Compose, assuming the .env file is already configured. ```bash # Pull latest image (includes model files) docker pull mumujie/mumuainovel:latest # Configure and start cp backend/.env.example .env docker-compose up -d ``` -------------------------------- ### Get Custom Prompts Source: https://context7.com/neosun100/mumuainovel/llms.txt Retrieves user-defined prompt templates used for various AI generation tasks. This allows users to access and review their customized prompts. ```bash curl -X GET "https://api.example.com/api/settings/prompts" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Create Foreshadow (Bash) Source: https://context7.com/neosun100/mumuainovel/llms.txt Creates a new foreshadowing element with setup content, planned resolution chapter, importance level, and resolution hints. Requires project ID, chapter ID, content, and other details. ```bash curl -X POST "https://api.example.com/api/foreshadows" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "project_id": "project_uuid", "setup_chapter_id": "chapter_uuid", "content": "The mysterious letter hidden in the old book", "resolution_hint": "Will be revealed during the final confrontation", "planned_resolution_chapter": 25, "importance": "major", "category": "mystery" }' ``` -------------------------------- ### Get Polish Preview Source: https://context7.com/neosun100/mumuainovel/llms.txt Generates a preview of text polishing suggestions without applying any changes to the original content. This is useful for evaluating the potential impact of polishing. It requires the text to be previewed and the desired polish intensity. ```bash curl -X POST "https://api.example.com/api/polish/preview" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "text": "Sample text to polish", "polish_intensity": "light" }' ``` -------------------------------- ### Get Project Timeline Source: https://context7.com/neosun100/mumuainovel/llms.txt Retrieves the chronological timeline of events in the story. Organized by chapter and includes character involvement. Requires project_id. ```bash curl -X GET "https://api.example.com/api/timeline/{project_id}" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Get User Settings Source: https://context7.com/neosun100/mumuainovel/llms.txt Retrieves all user-specific settings, including AI provider configurations, default model selections, and writing preferences. This endpoint is essential for understanding and managing the user's current configuration. ```bash curl -X GET "https://api.example.com/api/settings" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Get Project Characters Source: https://context7.com/neosun100/mumuainovel/llms.txt Retrieves all characters for a project, optionally filtered by role type, with relationship summaries and appearance statistics. ```APIDOC ## GET /api/characters ### Description Retrieves all characters for a project, optionally filtered by role type, with relationship summaries and appearance statistics. ### Method GET ### Endpoint /api/characters ### Parameters #### Query Parameters - **project_id** (string) - Required - The ID of the project to retrieve characters from. - **role_type** (string) - Optional - Filters characters by their role type (e.g., protagonist, antagonist). ### Request Example ```bash curl -X GET "https://api.example.com/api/characters?project_id={project_id}&role_type=protagonist" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ### Response #### Success Response (200 OK) - **characters** (array) - A list of character objects. - **character_id** (string) - The unique identifier for the character. - **name** (string) - The name of the character. - **role_type** (string) - The role of the character. - **relationships_summary** (string) - A summary of the character's relationships. - **appearance_statistics** (object) - Statistics related to the character's appearances. #### Response Example ```json { "characters": [ { "character_id": "char_uuid_123", "name": "Elena Blackwood", "role_type": "protagonist", "relationships_summary": "Close ties with supporting characters X and Y.", "appearance_statistics": {"total_appearances": 50, "chapters_featured": 15} } ] } ``` ``` -------------------------------- ### Get Project Chapters - Bash Source: https://context7.com/neosun100/mumuainovel/llms.txt Retrieves all chapters for a given project with pagination support. The response includes chapter content, word counts, status, and outline associations. This endpoint requires a project ID and supports pagination parameters like page number and page size. ```bash curl -X GET "https://api.example.com/api/chapters?project_id={project_id}&page=1&page_size=20" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Get Refinement Diff with Refinement API Source: https://context7.com/neosun100/mumuainovel/llms.txt Returns a side-by-side comparison of original and refined content with highlighted changes. Requires the refinement ID. ```bash curl -X GET "https://api.example.com/api/refinement/{refinement_id}/diff" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Get Style Profile with Style Analysis API Source: https://context7.com/neosun100/mumuainovel/llms.txt Returns the established style profile for a project, useful for maintaining consistency in AI generation. Requires the project ID. ```bash curl -X GET "https://api.example.com/api/style/profile/{project_id}" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Get Consistency Issues Source: https://context7.com/neosun100/mumuainovel/llms.txt Retrieves all detected consistency issues for a project. Allows filtering by severity level. Requires project_id and optionally severity. ```bash curl -X GET "https://api.example.com/api/consistency/issues?project_id={project_id}&severity=high" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Get Quality Statistics Source: https://context7.com/neosun100/mumuainovel/llms.txt Returns aggregated quality statistics for a project. Includes averages, trends across chapters, and areas for improvement. Requires project_id. ```bash curl -X GET "https://api.example.com/api/quality/stats/{project_id}" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Get Project Foreshadows (Bash) Source: https://context7.com/neosun100/mumuainovel/llms.txt Retrieves all foreshadowing elements for a project, organized by status (pending, resolved, abandoned). Requires project ID and optionally a status filter. ```bash curl -X GET "https://api.example.com/api/foreshadows?project_id={project_id}&status=pending" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Get Foreshadow Reminders (Bash) Source: https://context7.com/neosun100/mumuainovel/llms.txt Returns foreshadowing elements that are approaching their planned resolution chapter, useful for writing prompts. Requires project ID and current chapter number. ```bash curl -X GET "https://api.example.com/api/foreshadows/reminders?project_id={project_id}¤t_chapter=20" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Get Chapter Details - Bash Source: https://context7.com/neosun100/mumuainovel/llms.txt Returns complete information for a specific chapter, including its full content, metadata, generation history, and analysis results. This endpoint requires a chapter ID to fetch the detailed information. ```bash curl -X GET "https://api.example.com/api/chapters/{chapter_id}" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### MCP Server (AI Assistant Integration) Source: https://github.com/neosun100/mumuainovel/blob/main/README.md Details on integrating AI assistants like Claude and Kiro with MuMuAINovel using the MCP server, including installation, configuration, and available tools. ```APIDOC ## MCP Server (AI Assistant Integration) MuMuAINovel provides an MCP (Model Context Protocol) server that allows AI assistants to directly create novels. ### Installation Install the necessary libraries using pip: ```bash pip install mcp httpx ``` ### Configuration (Claude Desktop) To configure an AI assistant like Claude Desktop, edit its configuration file (`~/.config/claude/claude_desktop_config.json`) to include the MuMuAINovel MCP server: ```json { "mcpServers": { "mumuai-novel": { "command": "python", "args": ["/path/to/MuMuAINovel/mcp_novel_server.py"], "env": { "MUMUAI_BASE_URL": "http://localhost:8000", "MUMUAI_USERNAME": "admin", "MUMUAI_PASSWORD": "your_password" } } } } ``` Replace `/path/to/MuMuAINovel/mcp_novel_server.py` with the actual path to the MCP server script. ### Available MCP Tools The following tools are available through the MCP server for AI assistants: | Tool | |---| | `novel_list_projects` | List all novel projects | | `novel_create_project` | Create new project | | `novel_create_characters_batch` | Batch create characters | | `novel_create_outlines_batch` | Batch create outlines | | `novel_batch_generate` | Submit batch generation | | `novel_check_progress` | Check generation progress | | `novel_resume_all` | Resume all interrupted tasks | | `novel_full_pipeline` | One-click create complete novel | ### Usage Example An AI assistant can use these tools to interact with MuMuAINovel. For example: *User: Create a sci-fi novel "Star Conqueror" with protagonist Jack Chen...* *AI: [Calls `novel_full_pipeline` with relevant parameters]* ✅ Project created ✅ 100 characters created ✅ 100 outlines created ✅ Batch generation submitted *Your novel is being generated in the background!* For detailed documentation, refer to `docs/MCP_USAGE_GUIDE.md`. ``` -------------------------------- ### Configure ESLint for React-Specific Linting with React-X and React-DOM Source: https://github.com/neosun100/mumuainovel/blob/main/frontend/README.md This ESLint configuration integrates specific rules for React development using `eslint-plugin-react-x` and `eslint-plugin-react-dom`. It enables recommended linting rules for both React and React DOM, alongside project-specific TypeScript configurations. ```javascript // eslint.config.js import reactX from 'eslint-plugin-react-x' import reactDom from 'eslint-plugin-react-dom' export default defineConfig([ globalIgnores(['dist']), { files: ['**/*.{ts,tsx}'] extends: [ // Other configs... // Enable lint rules for React reactX.configs['recommended-typescript'], // Enable lint rules for React DOM reactDom.configs.recommended, ], languageOptions: { parserOptions: { project: ['./tsconfig.node.json', './tsconfig.app.json'], tsconfigRootDir: import.meta.dirname }, // other options... }, }, ]) ``` -------------------------------- ### Get Character Details - Characters API Source: https://context7.com/neosun100/mumuainovel/llms.txt Fetches complete information for a single character, including all attributes, relationships, appearance history, and growth progression. The API endpoint is GET /api/characters/{character_id}. ```bash curl -X GET "https://api.example.com/api/characters/{character_id}" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Get Project Characters - Characters API Source: https://context7.com/neosun100/mumuainovel/llms.txt Retrieves all characters for a specific project, with optional filtering by role type. Returns relationship summaries and appearance statistics. The API endpoint is GET /api/characters. ```bash curl -X GET "https://api.example.com/api/characters?project_id={project_id}&role_type=protagonist" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Create New Novel Project Source: https://context7.com/neosun100/mumuainovel/llms.txt Creates a new novel project with specified metadata and world-building settings. It allows configuration of title, genre, theme, target word count, and world details. ```bash curl -X POST "https://api.example.com/api/projects" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "title": "The Dragon Chronicles", "genre": "fantasy", "theme": "redemption and sacrifice", "target_words": 100000, "world_time_period": "medieval", "world_location": "fictional kingdom", "world_atmosphere": "dark and mysterious", "outline_mode": "one-to-many" }' ``` -------------------------------- ### Configure PostgreSQL and AI Services in .env Source: https://github.com/neosun100/mumuainovel/blob/main/README_EN.md This snippet shows the essential configuration parameters within the .env file for MuMuAINovel. It includes database connection details for PostgreSQL and API keys for AI services like OpenAI, Gemini, and Claude. Users must replace placeholder values with their actual credentials. ```dotenv # PostgreSQL Database DATABASE_URL=postgresql+asyncpg://mumuai:your_password@postgres:5432/mumuai_novel POSTGRES_PASSWORD=your_secure_password # AI Service (configure at least one) OPENAI_API_KEY=your_openai_key OPENAI_BASE_URL=https://api.openai.com/v1 DEFAULT_AI_PROVIDER=openai DEFAULT_MODEL=gpt-4o-mini # Local Account Login LOCAL_AUTH_ENABLED=true LOCAL_AUTH_USERNAME=admin LOCAL_AUTH_PASSWORD=your_password # LinuxDO OAuth LINUXDO_CLIENT_ID=your_client_id LINUXDO_CLIENT_SECRET=your_client_secret # Gemini GEMINI_API_KEY=your_gemini_key # Claude ANTHROPIC_API_KEY=your_anthropic_key ``` -------------------------------- ### Retrieve Project Outlines Source: https://context7.com/neosun100/mumuainovel/llms.txt Fetches all outlines associated with a specific project. The outlines are returned ordered by their chapter index and include content summaries and structural metadata. Requires the project ID in the URL path. ```bash curl -X GET "https://api.example.com/api/outlines/project/{project_id}" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Get Relationship Types (Bash) Source: https://context7.com/neosun100/mumuainovel/llms.txt Retrieves all predefined relationship types organized by category. Requires an authorization token. ```bash curl -X GET "https://api.example.com/api/relationships/types" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Get Character Details Source: https://context7.com/neosun100/mumuainovel/llms.txt Returns complete character information including all attributes, relationships, appearance history, and growth progression. ```APIDOC ## GET /api/characters/{character_id} ### Description Returns complete character information including all attributes, relationships, appearance history, and growth progression. ### Method GET ### Endpoint /api/characters/{character_id} ### Parameters #### Path Parameters - **character_id** (string) - Required - The unique identifier of the character to retrieve. ### Request Example ```bash curl -X GET "https://api.example.com/api/characters/{character_id}" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ### Response #### Success Response (200 OK) - **character_id** (string) - The unique identifier for the character. - **name** (string) - The name of the character. - **role_type** (string) - The role of the character. - **personality** (string) - Description of the character's personality traits. - **background** (string) - The character's backstory. - **abilities** (string) - A description of the character's abilities. - **goals** (string) - The character's main goals. - **weaknesses** (string) - The character's weaknesses. - **growth_arc** (string) - Description of the character's development arc. - **relationships** (array) - List of relationships. - **appearance_history** (array) - History of character appearances. - **growth_progression** (array) - Details on character's growth. #### Response Example ```json { "character_id": "char_uuid_123", "name": "Elena Blackwood", "role_type": "protagonist", "personality": "Determined, compassionate, struggles with self-doubt", "background": "Former soldier seeking redemption", "abilities": "Expert swordsman, tactical genius", "goals": "Protect the innocent, find inner peace", "weaknesses": "Haunted by past decisions", "growth_arc": "From guilt-ridden warrior to confident leader", "relationships": [{"related_character_id": "char_uuid_456", "type": "ally"}], "appearance_history": [{"chapter": 1, "scene": "Opening"}], "growth_progression": [{"stage": "Initial", "description": "Struggling with past trauma"}] } ``` ``` -------------------------------- ### Retrieve User's Projects Source: https://context7.com/neosun100/mumuainovel/llms.txt Fetches a paginated list of projects owned by the authenticated user. Supports searching and sorting for efficient retrieval. ```bash curl -X GET "https://api.example.com/api/projects?page=1&page_size=10&search=dragon" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### GET /api/chapters Source: https://context7.com/neosun100/mumuainovel/llms.txt Retrieves all chapters for a project with pagination support, including content, word counts, status, and outline associations. ```APIDOC ## GET /api/chapters ### Description Retrieves all chapters for a project with pagination support, including content, word counts, status, and outline associations. ### Method GET ### Endpoint /api/chapters ### Parameters #### Path Parameters None #### Query Parameters - **project_id** (string) - Required - The ID of the project to retrieve chapters from. - **page** (integer) - Optional - The page number for pagination (default: 1). - **page_size** (integer) - Optional - The number of chapters per page (default: 20). ### Request Example ```bash curl -X GET "https://api.example.com/api/chapters?project_id={project_id}&page=1&page_size=20" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ### Response #### Success Response (200) - **chapters** (array of objects) - A list of chapter objects, each containing details like content, word count, status, etc. - **total_chapters** (integer) - The total number of chapters for the project. - **current_page** (integer) - The current page number. - **total_pages** (integer) - The total number of pages. #### Response Example ```json { "chapters": [ { "chapter_id": "ch_1", "title": "The Beginning", "word_count": 2500, "status": "completed", "outline_id": "outline_abc" } // ... more chapters ], "total_chapters": 50, "current_page": 1, "total_pages": 3 } ``` ``` -------------------------------- ### GET /api/chapters/{chapter_id} Source: https://context7.com/neosun100/mumuainovel/llms.txt Returns complete chapter information including full content, metadata, generation history, and analysis results. ```APIDOC ## GET /api/chapters/{chapter_id} ### Description Returns complete chapter information including full content, metadata, generation history, and analysis results. ### Method GET ### Endpoint /api/chapters/{chapter_id} ### Parameters #### Path Parameters - **chapter_id** (string) - Required - The ID of the chapter to retrieve. #### Query Parameters None #### Request Body None ### Request Example ```bash curl -X GET "https://api.example.com/api/chapters/{chapter_id}" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ### Response #### Success Response (200) - **chapter_details** (object) - An object containing all details of the chapter, including content, metadata, history, and analysis. #### Response Example ```json { "chapter_details": { "chapter_id": "ch_1", "title": "The Beginning", "content": "Full content of the chapter...", "metadata": {}, "generation_history": [], "analysis_results": {} } } ``` ``` -------------------------------- ### Optional Environment Configuration for MuMuAINovel Source: https://github.com/neosun100/mumuainovel/blob/main/README.md This snippet details optional environment variables for configuring additional AI providers (LinuxDO OAuth, Gemini, Claude) and database connection pooling in MuMuAINovel. These settings allow for greater flexibility and scalability, especially under high concurrency. ```dotenv # LinuxDO OAuth LINUXDO_CLIENT_ID=your_client_id LINUXDO_CLIENT_SECRET=your_client_secret # Gemini GEMINI_API_KEY=your_gemini_key # Claude ANTHROPIC_API_KEY=your_anthropic_key # Connection Pool (high concurrency) DATABASE_POOL_SIZE=50 DATABASE_MAX_OVERFLOW=30 ``` -------------------------------- ### Batch Expand Outlines (SSE Stream) Source: https://context7.com/neosun100/mumuainovel/llms.txt Processes multiple outlines for expansion into chapter plans concurrently. It streams progress for each individual outline and monitors the overall batch completion status. Requires project ID, a list of outline IDs, chapters per outline, and expansion strategy. ```bash curl -X POST "https://api.example.com/api/outlines/batch-expand-stream" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: text/event-stream" \ -d '{ "project_id": "project_uuid", "outline_ids": ["outline_1", "outline_2", "outline_3"], "chapters_per_outline": 3, "expansion_strategy": "balanced", "auto_create_chapters": false }' ``` -------------------------------- ### Import Project Data Source: https://context7.com/neosun100/mumuainovel/llms.txt Imports a project from a previously exported JSON archive. This recreates all project data, including chapters, outlines, and characters, under the user's account. ```bash curl -X POST "https://api.example.com/api/projects/import" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: multipart/form-data" \ -F "file=@project_backup.json" ``` -------------------------------- ### Get Authenticated User Information Source: https://context7.com/neosun100/mumuainovel/llms.txt Retrieves the profile details of the currently authenticated user. This includes their username, email, trust level, and account status. ```bash curl -X GET "https://api.example.com/api/auth/me" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Required Environment Configuration for MuMuAINovel Source: https://github.com/neosun100/mumuainovel/blob/main/README.md This snippet shows the essential environment variables required in the `.env` file for MuMuAINovel. It covers PostgreSQL database connection details, AI service API keys (OpenAI is shown as default), and local account authentication settings. Ensure sensitive information like passwords and API keys are kept secure. ```dotenv # PostgreSQL Database DATABASE_URL=postgresql+asyncpg://mumuai:your_password@postgres:5432/mumuai_novel POSTGRES_PASSWORD=your_secure_password # AI Service (configure at least one) OPENAI_API_KEY=your_openai_key OPENAI_BASE_URL=https://api.openai.com/v1 DEFAULT_AI_PROVIDER=openai DEFAULT_MODEL=gpt-4o-mini # Local Account Login LOCAL_AUTH_ENABLED=true LOCAL_AUTH_USERNAME=admin LOCAL_AUTH_PASSWORD=your_password ``` -------------------------------- ### Get Project Memories with Memory API Source: https://context7.com/neosun100/mumuainovel/llms.txt Retrieves all stored memories for a project with filtering and pagination options. Requires project ID and can be filtered by memory type. ```bash curl -X GET "https://api.example.com/api/memories?project_id={project_id}&memory_type=plot_revelation" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Initiate OAuth Login Redirect Source: https://context7.com/neosun100/mumuainovel/llms.txt Initiates the OAuth authentication flow with the LinuxDO provider. This endpoint redirects the user to the external authentication service to begin the login process. ```bash curl -X GET "https://api.example.com/api/auth/oauth/linuxdo/login" \ -H "Accept: application/json" ``` -------------------------------- ### Get Relationship Graph (Bash) Source: https://context7.com/neosun100/mumuainovel/llms.txt Returns relationship data formatted for visualization, with nodes representing characters and edges representing relationships. Requires a project ID. ```bash curl -X GET "https://api.example.com/api/relationships/graph/{project_id}" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Apply Refinement with Refinement API Source: https://context7.com/neosun100/mumuainovel/llms.txt Applies the refined content to the chapter, replacing the original text. Requires the refinement ID. ```bash curl -X POST "https://api.example.com/api/refinement/{refinement_id}/apply" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Continue Outline (SSE Stream) Source: https://context7.com/neosun100/mumuainovel/llms.txt Continues an existing outline by generating additional chapters, maintaining narrative consistency with previous content through smart context building, streaming updates via SSE. ```APIDOC ## POST /api/outlines/generate-stream ### Description Continues an existing novel outline using AI, streaming progress updates via Server-Sent Events. ### Method POST ### Endpoint https://api.example.com/api/outlines/generate-stream ### Parameters #### Query Parameters None #### Request Body - **project_id** (string) - Required - The ID of the project. - **chapter_count** (integer) - Required - The number of additional chapters to generate. - **mode** (string) - Required - Set to 'continue' to extend an existing outline. - **plot_stage** (string) - Optional - The current plot stage (e.g., 'climax'). - **story_direction** (string) - Optional - Guidance for the story's direction. - **enable_auto_characters** (boolean) - Optional - Whether to automatically suggest characters. ### Request Example ```json { "project_id": "project_uuid", "chapter_count": 10, "mode": "continue", "plot_stage": "climax", "story_direction": "The hero confronts the final challenge", "enable_auto_characters": true } ``` ### Response #### Success Response (200) - **event** (string) - Server-Sent Event type. - **data** (string) - Event data, typically JSON containing progress or outline information. #### Response Example ``` event: progress data: {"percentage": 75, "message": "Continuing outline..."} event: outline_chunk data: {"chapter_index": 11, "title": "The Final Confrontation", "summary": "..."} ``` ``` -------------------------------- ### GET /api/chapters/{chapter_id}/context Source: https://context7.com/neosun100/mumuainovel/llms.txt Retrieves the assembled context used for chapter generation, including relevant story memories, character information, and plot summaries. ```APIDOC ## GET /api/chapters/{chapter_id}/context ### Description Retrieves the assembled context used for chapter generation, including relevant story memories, character information, and plot summaries. ### Method GET ### Endpoint /api/chapters/{chapter_id}/context ### Parameters #### Path Parameters - **chapter_id** (string) - Required - The ID of the chapter for which to retrieve context. #### Query Parameters None #### Request Body None ### Request Example ```bash curl -X GET "https://api.example.com/api/chapters/{chapter_id}/context" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ### Response #### Success Response (200) - **context** (object) - An object containing the context used for chapter generation. #### Response Example ```json { "context": { "story_memories": [], "character_info": {}, "plot_summary": "" } } ``` ```