Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
@VirPrologue
VirPrologue
Follow

VirPrologue VirPrologue

Block or report VirPrologue

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don't include any personal information such as legal names or email addresses. Markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
VirPrologue /README.md

VirPrologue

An AI-powered story writing assistant that helps create engaging narratives with context awareness and character development.

InstallationBasic UsageFeaturesExamples

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/virprologue.git
cd virprologue
  1. Install dependencies:
pip install -r requirements.txt
  1. Set your OpenAI API key:
export OPENAI_API_KEY='your-api-key'

Basic Usage

from virprologue import StoryWriter, Character
# Initialize the writer
writer = StoryWriter()
# Create a story
story = writer.generate_story(
 prompt="The mysterious package arrived at midnight...",
 style="mystery",
 length=1000
)
print(story)

Features

1. Character Management

Create and manage characters with personalities and relationships:

# Create a character
protagonist = Character(
 name="Emma",
 description="A brilliant detective with a troubled past",
 personality={
 "intelligence": 0.9,
 "determination": 0.8,
 "skepticism": 0.7
 },
 background="Former FBI profiler turned private investigator"
)
# Add to story
writer.add_character(protagonist)

2. Writing Styles

Support for multiple genres:

  • modern
  • fantasy
  • sci-fi
  • mystery
  • romance
  • historical
  • horror
  • children
# Generate fantasy story
fantasy_story = writer.generate_story(
 prompt="The ancient spell book glowed with an eerie light...",
 style="fantasy"
)

3. Context Awareness

VirPrologue maintains story context for coherent narratives:

# First part
part1 = writer.generate_story(
 prompt="The detective found footprints leading to the garden..."
)
# Continues with context awareness
part2 = writer.generate_story(
 prompt="Following the trail, she discovered..."
)

Examples

Character Interaction Example

# Create characters
detective = Character(
 name="Inspector Chen",
 description="Methodical detective",
 personality={"analytical": 0.9},
 background="20 years on the force"
)
witness = Character(
 name="Dr. Smith",
 description="Nervous scientist",
 personality={"anxious": 0.7},
 background="Quantum physics researcher"
)
# Set relationships
detective.add_relationship("Dr. Smith", "suspicious of his story")
witness.add_relationship("Inspector Chen", "fears being blamed")
# Add to story
writer.add_character(detective)
writer.add_character(witness)
# Generate scene
scene = writer.generate_story(
 prompt="Inspector Chen watched Dr. Smith's hands tremble as he explained..."
)

Configuration Example

from virprologue import WritingConfig
config = WritingConfig(
 model_name="gpt-4",
 max_tokens=1000,
 temperature=0.7, # Creativity level (0.0-1.0)
 context_memory_size=5 # Number of previous segments to remember
)

API Reference

StoryWriter

class StoryWriter:
 def __init__(self, api_key: Optional[str] = None):
 """Initialize with optional API key"""
 
 def generate_story(
 self,
 prompt: str,
 style: str = "modern",
 length: int = 1000
 ) -> str:
 """Generate story content"""
 
 def add_character(self, character: Character) -> None:
 """Add character to story"""
 
 def reset_context(self) -> None:
 """Clear context history"""

Character

@dataclass
class Character:
 name: str
 description: str
 personality: Dict[str, float]
 background: str
 relationships: Dict[str, str] = None

Requirements

  • Python 3.8+
  • OpenAI API key
  • Required packages:
    openai>=0.27.0
    python-dotenv>=0.19.0
    typing-extensions>=4.0.0
    

License

MIT License


Created for storytellers and creative writers 📚✨

# VirPrologue

Pinned Loading

  1. VirPrologue VirPrologue Public

    Writing AI for the general public

    Python

  2. writer writer Public

    Forked from mintlify/writer

    ✍️ AI powered documentation writer

    TypeScript

  3. writegen writegen Public

    Forked from jimzers/writegen

    A fun AI writer :)

    JavaScript

  4. AIStoryWriter AIStoryWriter Public

    Forked from datacrystals/AIStoryWriter

    LLM story writer with a focus on high-quality long output based on a user provided prompt.

    Python

AltStyle によって変換されたページ (->オリジナル) /