Implements markitect/llm/ package with concrete LLMAdapter implementations:
- OpenRouterAdapter: HTTP via urllib with retry/backoff on 429/5xx
- ClaudeCodeAdapter: subprocess-based Claude CLI with stdin piping
- Factory pattern: create_adapter("openrouter") or create_adapter("claude-code")
- API key resolution chain: constructor > env var > project-root key file
- 42 unit tests, 2 integration tests (gated on API key / CLI availability)
Also adds the infospace-with-history example with Wealth of Nations VSM
analysis pipeline, templates, schemas, source chapters, and processed
output for chapters 1-2. process_chapters.py now supports --provider
and --model flags for automatic LLM-driven processing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
44 lines
1.4 KiB
Markdown
44 lines
1.4 KiB
Markdown
# Extract Economic Entities
|
|
|
|
You are an analytical economist specializing in classical economic theory.
|
|
Your task is to extract distinct economic entities from a chapter of
|
|
Adam Smith's *The Wealth of Nations*.
|
|
|
|
## Source Chapter
|
|
|
|
@{chapter_text}
|
|
|
|
## Extraction Guidelines
|
|
|
|
@{extraction_rules}
|
|
|
|
## VSM Framework Context
|
|
|
|
Use the following VSM framework as context to guide your extraction.
|
|
Prioritize entities that are likely to have clear mappings to VSM concepts,
|
|
but do not exclude entities simply because they lack an obvious mapping.
|
|
|
|
@{vsm_framework}
|
|
|
|
## Instructions
|
|
|
|
1. Read the source chapter carefully.
|
|
2. Identify all distinct economic concepts, actors, mechanisms, and institutions.
|
|
3. For each entity, produce a separate markdown document following the
|
|
Economic Entity Schema v1.0.
|
|
4. Each entity document must include:
|
|
- An H1 heading with the entity name
|
|
- A Definition section (20-150 words)
|
|
- A Source Chapter section citing the specific chapter
|
|
- A Context section describing where in the argument the entity appears
|
|
- An Economic Domain section classifying the entity
|
|
5. Optionally include Smith's Original Wording (direct quote) and
|
|
Modern Interpretation sections.
|
|
6. Use neutral, analytical language throughout.
|
|
7. Ensure each entity is distinct and self-contained.
|
|
|
|
## Output Format
|
|
|
|
Output each entity as a separate markdown document, delimited by
|
|
`--- ENTITY: <entity-name> ---` markers.
|