Skip to content

Instantly share code, notes, and snippets.

@grahama1970
Last active January 26, 2025 22:24
Show Gist options
  • Save grahama1970/b6b4af47a122ed4c3078234837737163 to your computer and use it in GitHub Desktop.
Save grahama1970/b6b4af47a122ed4c3078234837737163 to your computer and use it in GitHub Desktop.
Deepseek Structured vs (hacked) unstructured outputs: This project evaluates Deepseek's string-based (Markdown) and JSON-based outputs to determine which approach is better suited for structured storage and processing. By converting the Markdown output into an Abstract Syntax Tree (AST) and storing the results in ArangoDB, we test whether the ad…
[
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "Paris: The Enchanting Capital of France"
}
],
"content": "\u2728 Practical Tips",
"level": 1,
"line_number": 1
},
{
"type": "SetextHeading",
"children": [
{
"type": "RawText",
"children": [],
"content": "Paris, the capital of France, is a city synonymous with romance, art, history, and culinary excellence. Known as the "
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "\"City of Light\""
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": " ("
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "La Ville Lumi\u00e8re"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "), it has captivated visitors for centuries with its timeless beauty, vibrant culture, and unparalleled charm."
}
],
"level": 2,
"line_number": 2
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "\ud83c\udf0d Historical & Cultural Significance"
}
],
"content": "\u2728 Practical Tips",
"level": 2,
"line_number": 4
},
{
"type": "List",
"children": [
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Founding"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Established as "
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Lutetia"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": " by the Romans in the 3rd century BCE, Paris evolved into a global hub of politics, art, and philosophy."
}
],
"line_number": 5
}
],
"line_number": 5
},
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Revolutionary Legacy"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": The French Revolution (1789\u20131799) began here, shaping modern democracy."
}
],
"line_number": 6
}
],
"line_number": 6
},
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "UNESCO Heritage"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": The banks of the Seine River, a UNESCO World Heritage Site, are lined with iconic landmarks."
}
],
"line_number": 7
}
],
"line_number": 7
}
],
"line_number": 5
},
{
"type": "ThematicBreak",
"children": [],
"line_number": 8
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "\ud83d\uddfc Iconic Landmarks"
}
],
"content": "\u2728 Practical Tips",
"level": 2,
"line_number": 9
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "Eiffel Tower"
}
],
"content": "\u2728 Practical Tips",
"level": 3,
"line_number": 10
},
{
"type": "List",
"children": [
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Symbol of Paris"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Built in 1889 for the World\u2019s Fair, this iron lattice tower offers panoramic views from its observation decks."
}
],
"line_number": 11
}
],
"line_number": 11
},
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Nighttime Spectacle"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Sparkles with golden lights every hour after sunset."
}
],
"line_number": 12
}
],
"line_number": 12
}
],
"line_number": 11
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "Louvre Museum"
}
],
"content": "\u2728 Practical Tips",
"level": 3,
"line_number": 13
},
{
"type": "List",
"children": [
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "World\u2019s Largest Art Museum"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Home to the "
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Mona Lisa"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ", "
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Venus de Milo"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ", and over 38,000 artworks."
}
],
"line_number": 14
}
],
"line_number": 14
},
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Architectural Marvel"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Glass pyramid entrance blends modernity with the historic palace."
}
],
"line_number": 15
}
],
"line_number": 15
}
],
"line_number": 14
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "Notre-Dame Cathedral"
}
],
"content": "\u2728 Practical Tips",
"level": 3,
"line_number": 16
},
{
"type": "List",
"children": [
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Gothic Masterpiece"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Famous for its rose windows, gargoyles, and spire (currently under restoration after the 2019 fire)."
}
],
"line_number": 17
}
],
"line_number": 17
}
],
"line_number": 17
},
{
"type": "ThematicBreak",
"children": [],
"line_number": 18
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "\ud83c\udf77 Culinary Pleasures"
}
],
"content": "\u2728 Practical Tips",
"level": 2,
"line_number": 19
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "French Cuisine"
}
],
"content": "\u2728 Practical Tips",
"level": 3,
"line_number": 20
},
{
"type": "List",
"children": [
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Patisseries"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Indulge in buttery croissants, macarons (try Ladur\u00e9e), and eclairs."
}
],
"line_number": 21
}
],
"line_number": 21
},
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Cheese & Wine"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Sample Brie, Camembert, and Bordeaux wines at local bistros."
}
],
"line_number": 22
}
],
"line_number": 22
},
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Michelin Stars"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Dine at legendary restaurants like "
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Le Meurice"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": " or "
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Epicure"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "."
}
],
"line_number": 23
}
],
"line_number": 23
}
],
"line_number": 21
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "Markets & Caf\u00e9s"
}
],
"content": "\u2728 Practical Tips",
"level": 3,
"line_number": 24
},
{
"type": "List",
"children": [
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "March\u00e9 Bastille"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Fresh produce, cheeses, and street food."
}
],
"line_number": 25
}
],
"line_number": 25
},
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Caf\u00e9 Culture"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Sip espresso at historic caf\u00e9s like "
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Caf\u00e9 de Flore"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": " or "
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Les Deux Magots"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "."
}
],
"line_number": 26
}
],
"line_number": 26
}
],
"line_number": 25
},
{
"type": "ThematicBreak",
"children": [],
"line_number": 27
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "\ud83c\udfa8 Art & Museums"
}
],
"content": "\u2728 Practical Tips",
"level": 2,
"line_number": 28
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "Mus\u00e9e d\u2019Orsay"
}
],
"content": "\u2728 Practical Tips",
"level": 3,
"line_number": 29
},
{
"type": "List",
"children": [
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Impressionist Treasures"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Houses works by Monet, Van Gogh, and Degas in a converted Beaux-Arts railway station."
}
],
"line_number": 30
}
],
"line_number": 30
}
],
"line_number": 30
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "Centre Pompidou"
}
],
"content": "\u2728 Practical Tips",
"level": 3,
"line_number": 31
},
{
"type": "List",
"children": [
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Modern Art Hub"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Features avant-garde exhibitions and a rooftop view of the city."
}
],
"line_number": 32
}
],
"line_number": 32
}
],
"line_number": 32
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "Montmartre"
}
],
"content": "\u2728 Practical Tips",
"level": 3,
"line_number": 33
},
{
"type": "List",
"children": [
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Bohemian Roots"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Wander cobblestone streets where Picasso and Dal\u00ed once lived. Visit the "
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Sacr\u00e9-C\u0153ur Basilica"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "."
}
],
"line_number": 34
}
],
"line_number": 34
}
],
"line_number": 34
},
{
"type": "ThematicBreak",
"children": [],
"line_number": 35
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "\ud83c\udf3f Romantic Ambiance"
}
],
"content": "\u2728 Practical Tips",
"level": 2,
"line_number": 36
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "Seine River Cruises"
}
],
"content": "\u2728 Practical Tips",
"level": 3,
"line_number": 37
},
{
"type": "List",
"children": [
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Bateaux Mouches"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Glide past illuminated monuments at night."
}
],
"line_number": 38
}
],
"line_number": 38
}
],
"line_number": 38
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "Gardens & Parks"
}
],
"content": "\u2728 Practical Tips",
"level": 3,
"line_number": 39
},
{
"type": "List",
"children": [
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Luxembourg Gardens"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Manicured lawns, statues, and puppet shows."
}
],
"line_number": 40
}
],
"line_number": 40
},
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Tuileries Garden"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Stroll between the Louvre and Place de la Concorde."
}
],
"line_number": 41
}
],
"line_number": 41
}
],
"line_number": 40
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "Bridges of Paris"
}
],
"content": "\u2728 Practical Tips",
"level": 3,
"line_number": 42
},
{
"type": "List",
"children": [
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Pont Alexandre III"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Ornate bridge with gold accents, perfect for photos."
}
],
"line_number": 43
}
],
"line_number": 43
}
],
"line_number": 43
},
{
"type": "ThematicBreak",
"children": [],
"line_number": 44
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "\ud83d\udecd\ufe0f Fashion & Shopping"
}
],
"content": "\u2728 Practical Tips",
"level": 2,
"line_number": 45
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "Luxury Districts"
}
],
"content": "\u2728 Practical Tips",
"level": 3,
"line_number": 46
},
{
"type": "List",
"children": [
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Champs-\u00c9lys\u00e9es"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Flagship stores like Louis Vuitton and iconic Arc de Triomphe."
}
],
"line_number": 47
}
],
"line_number": 47
},
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Le Marais"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Boutique shops and vintage finds."
}
],
"line_number": 48
}
],
"line_number": 48
}
],
"line_number": 47
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "Department Stores"
}
],
"content": "\u2728 Practical Tips",
"level": 3,
"line_number": 49
},
{
"type": "List",
"children": [
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Galeries Lafayette"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Art Nouveau architecture and a stunning glass dome."
}
],
"line_number": 50
}
],
"line_number": 50
}
],
"line_number": 50
},
{
"type": "ThematicBreak",
"children": [],
"line_number": 51
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "\ud83c\udfad Nightlife & Entertainment"
}
],
"content": "\u2728 Practical Tips",
"level": 2,
"line_number": 52
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "Cabarets"
}
],
"content": "\u2728 Practical Tips",
"level": 3,
"line_number": 53
},
{
"type": "List",
"children": [
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Moulin Rouge"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Birthplace of the can-can dance; dazzling performances."
}
],
"line_number": 54
}
],
"line_number": 54
}
],
"line_number": 54
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "Jazz Clubs"
}
],
"content": "\u2728 Practical Tips",
"level": 3,
"line_number": 55
},
{
"type": "List",
"children": [
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Le Caveau de la Huchette"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Swing dancing in a 16th-century cellar."
}
],
"line_number": 56
}
],
"line_number": 56
}
],
"line_number": 56
},
{
"type": "ThematicBreak",
"children": [],
"line_number": 57
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "\ud83c\udf89 Seasonal Highlights"
}
],
"content": "\u2728 Practical Tips",
"level": 2,
"line_number": 58
},
{
"type": "List",
"children": [
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Spring"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Cherry blossoms at "
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Jardin des Plantes"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "."
}
],
"line_number": 59
}
],
"line_number": 59
},
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Summer"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": "
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Paris Plages"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": " (urban beaches along the Seine)."
}
],
"line_number": 60
}
],
"line_number": 60
},
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Autumn"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Golden foliage in "
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Parc des Buttes-Chaumont"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "."
}
],
"line_number": 61
}
],
"line_number": 61
},
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Winter"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Christmas markets and ice skating at "
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "H\u00f4tel de Ville"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "."
}
],
"line_number": 62
}
],
"line_number": 62
}
],
"line_number": 59
},
{
"type": "ThematicBreak",
"children": [],
"line_number": 63
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "\ud83d\udca1 Hidden Gems"
}
],
"content": "\u2728 Practical Tips",
"level": 2,
"line_number": 64
},
{
"type": "List",
"children": [
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Canal Saint-Martin"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Picnic by the water or explore quirky boutiques."
}
],
"line_number": 65
}
],
"line_number": 65
},
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "P\u00e8re Lachaise Cemetery"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Final resting place of Jim Morrison and Oscar Wilde."
}
],
"line_number": 66
}
],
"line_number": 66
},
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "La Coul\u00e9e Verte"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Elevated park built on a former railway line."
}
],
"line_number": 67
}
],
"line_number": 67
}
],
"line_number": 65
},
{
"type": "ThematicBreak",
"children": [],
"line_number": 68
},
{
"type": "Heading",
"children": [
{
"type": "RawText",
"children": [],
"content": "\u2728 Practical Tips"
}
],
"content": "\u2728 Practical Tips",
"level": 2,
"line_number": 69
},
{
"type": "List",
"children": [
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Transport"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Efficient Metro system; walkable neighborhoods."
}
],
"line_number": 70
}
],
"line_number": 70
},
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Language"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Learn basic French phrases\u2014"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "\"Bonjour\""
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": " goes a long way!"
}
],
"line_number": 71
}
],
"line_number": 71
},
{
"type": "ListItem",
"children": [
{
"type": "Paragraph",
"children": [
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": "Timing"
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "EscapeSequence",
"children": [
{
"type": "RawText",
"children": [],
"content": "*"
}
]
},
{
"type": "RawText",
"children": [],
"content": ": Visit in April\u2013June or September\u2013October for fewer crowds."
},
{
"type": "LineBreak",
"children": [],
"content": ""
},
{
"type": "RawText",
"children": [],
"content": "Paris is not just a city\u2014it\u2019s an experience that lingers in the heart long after you\u2019ve left. \ud83e\udd50\u2728"
}
],
"line_number": 72
}
],
"line_number": 72
}
],
"line_number": 70
}
]
from litellm import completion
from dotenv import load_dotenv
import litellm
from pathlib import Path
import json
import uuid
import pyperclip
import redis
from pydantic import BaseModel, Field
import os
from types import SimpleNamespace
from loguru import logger
from src.utils.ast_utils import markdown_to_ast, ast_to_markdown, save_ast_to_file
from src.utils.markdown_utils import string_to_markdown, save_markdown_to_file
from utils.json_utils import clean_json_string, save_json_to_file
load_dotenv('../.env')
def initialize_litellm_cache():
litellm.cache = litellm.Cache(
type="redis",
host="localhost", # Redis is accessible on localhost
port=6379, # Default Redis port
password=None, # No password unless you configured one
ttl=60*60*24*30,
)
litellm.enable_cache()
os.environ["LITELLM_LOG"] = "DEBUG"
class Section(BaseModel):
title: str = Field(..., description="The title of the section")
subtitle: str = Field(..., description="The subtitle of the section")
key_events: list[str] = Field(..., description="A list of key events described in the section")
table: list[str] = Field(..., description="CSV rows representing tabular data in the section")
class ResponseModel(BaseModel):
reasoning: str = Field(..., description="The reasoning or chain of thought provided by the model to formulate a response")
json_response: list[Section] = Field(..., description="A list of ordered/indexed sections (and their sub-sections) containing the detailed response")
def llm_call(messages: list[dict[str, str]]):
json_schema = ResponseModel.model_json_schema()
api_params = {
"model": "deepseek/deepseek-reasoner",
"messages": messages,
# "max_tokens": 4096,
"temperature": 0.5,
"top_p": 0.95,
"stream": False,
# "response_format": { # Use response_format instead of response_model
# "type": "json_object",
# "schema": json_schema,
# },
"stop": None,
"timeout": 60,
"caching": True,
"metadata": {"request_id": uuid.uuid4(), "hidden": True},
# "metadata": {
# "response_format": "json", # Force JSON output
# "response_schema": json_schema, # Pass schema separately
# },
}
response = litellm.completion(**api_params)
if api_params.get("stream", True):
full_content = ""
for chunk in response:
content = chunk.choices[0].delta.content or ""
full_content += content
content = full_content
return response
if __name__ == "__main__":
litellm.set_verbose = True
initialize_litellm_cache()
json_schema = ResponseModel.model_json_schema()
schema_description = f"""
Your response MUST be a JSON object following this structure:
{json.dumps(json_schema, indent=2)}
Rules:
1. No markdown formatting
2. No additional explanations
3. Strictly follow the schema types
"""
system_message = (
"You are a helpful assistant tha always responds in JSON format.\n"
f"{schema_description} "
)
user_message = "Can you tell me about France's capital city and its many pleasures?"
message: list[dict[str, str]] = [
{"role": "system", "content": system_message},
{"role": "user", "content": user_message}]
response = llm_call(message)
result:str = response.choices[0].message.content
json_result = clean_json_string(result, return_dict=True)
success = save_json_to_file(json_result, Path("json_output.json"))
from litellm import completion
from dotenv import load_dotenv
import litellm
from pathlib import Path
import uuid
import pyperclip
import redis
import os
from types import SimpleNamespace
from loguru import logger
from src.utils.ast_utils import markdown_to_ast, ast_to_markdown, save_ast_to_file
from src.utils.markdown_utils import string_to_markdown, save_markdown_to_file
load_dotenv('../.env')
def initialize_litellm_cache():
litellm.cache = litellm.Cache(
type="redis",
host="localhost", # Redis is accessible on localhost
port=6379, # Default Redis port
password=None, # No password unless you configured one
ttl=60*60*24*30,
)
litellm.enable_cache()
os.environ["LITELLM_LOG"] = "DEBUG"
def llm_call(messages: list[dict[str, str]]):
api_params = {
"model":"deepseek/deepseek-reasoner",
"messages": messages,
# "max_tokens": 4096,
"temperature": 0.5,
"top_p": 0.95,
"stream": False,
"stop": None,
"timeout": 60,
"caching": True,
"metadata": {"request_id": uuid.uuid4(), "hidden": True},
}
response = litellm.completion(**api_params)
if api_params.get("stream", True):
full_content = ""
for chunk in response:
content = chunk.choices[0].delta.content or ""
full_content += content
content = full_content
return response
if __name__ == "__main__":
litellm.set_verbose = True
initialize_litellm_cache()
system_message = (
"You are a helpful assistant that responsed in well formatted markdown. "
"Remember to start with a # title and then a description of the topic. "
"Every new sections or subsection needs a markdown header. "
)
user_message = "Can you tell me about France's capital city and its many pleasures?"
message: list[dict[str, str]] = [
{"role": "system", "content": system_message},
{"role": "user", "content": user_message}]
response = llm_call(message)
result:str = response.choices[0].message.content
# convert deepseek string response to markdown and save to file
markdown_content = string_to_markdown(result)
success = save_markdown_to_file(markdown_content, Path("markdown_output.md"))
# Convert markdown to ast and save to file
ast_content = markdown_to_ast(markdown_content)
success = save_ast_to_file(ast_content, Path("ast_output.json"))
{
"reasoning": "The user asked about France's capital city (Paris) and its pleasures. I provided historical context, cultural highlights, and key attractions, ensuring alignment with the required JSON structure by separating into sections with titles, subtitles, key events, and CSV-style tables.",
"json_response": [
{
"title": "Paris: Capital of France",
"subtitle": "The City of Light and Its Historical Significance",
"key_events": [
"Founded in the 3rd century BCE by the Parisii tribe",
"Became the capital of France in 987 CE under Hugh Capet",
"Center of the French Revolution (1789\u20131799)",
"Hosted the 1900 and 2024 Summer Olympics"
],
"table": [
"Landmark,Year Established,Notable Feature",
"Eiffel Tower,1887,Iconic iron lattice tower",
"Louvre Museum,1793,Largest art museum in the world",
"Notre-Dame Cathedral,1163,Gothic architecture",
"Champs-\u00c9lys\u00e9es,17th century,Famous avenue",
"Montmartre,N/A,Historic artistic district"
]
},
{
"title": "Pleasures of Paris",
"subtitle": "Cultural, Culinary, and Aesthetic Delights",
"key_events": [
"Annual Bastille Day celebrations (July 14)",
"Paris Fashion Week (biannual event)",
"Nuit Blanche all-night arts festival",
"Vincent van Gogh exhibitions at Mus\u00e9e d'Orsay"
],
"table": [
"Category,Example,Description",
"Cuisine,Croissants/Baguettes,Iconic French baked goods",
"Wine,Champagne/Bordeaux,World-renowned vineyards",
"Shopping,Galeries Lafayette,Luxury department store",
"Art,Street murals in Le Marais,Bohemian cultural hub",
"Romance,Seine River cruises,Evening boat tours"
]
}
]
}

Paris: The Enchanting Capital of France

Paris, the capital of France, is a city synonymous with romance, art, history, and culinary excellence. Known as the *"City of Light"* (*La Ville Lumière*), it has captivated visitors for centuries with its timeless beauty, vibrant culture, and unparalleled charm.

🌍 Historical & Cultural Significance

  • **Founding**: Established as *Lutetia* by the Romans in the 3rd century BCE, Paris evolved into a global hub of politics, art, and philosophy.
  • **Revolutionary Legacy**: The French Revolution (1789–1799) began here, shaping modern democracy.
  • **UNESCO Heritage**: The banks of the Seine River, a UNESCO World Heritage Site, are lined with iconic landmarks.

🗼 Iconic Landmarks

Eiffel Tower

  • **Symbol of Paris**: Built in 1889 for the World’s Fair, this iron lattice tower offers panoramic views from its observation decks.
  • **Nighttime Spectacle**: Sparkles with golden lights every hour after sunset.

Louvre Museum

  • **World’s Largest Art Museum**: Home to the *Mona Lisa*, *Venus de Milo*, and over 38,000 artworks.
  • **Architectural Marvel**: Glass pyramid entrance blends modernity with the historic palace.

Notre-Dame Cathedral

  • **Gothic Masterpiece**: Famous for its rose windows, gargoyles, and spire (currently under restoration after the 2019 fire).

🍷 Culinary Pleasures

French Cuisine

  • **Patisseries**: Indulge in buttery croissants, macarons (try Ladurée), and eclairs.
  • **Cheese & Wine**: Sample Brie, Camembert, and Bordeaux wines at local bistros.
  • **Michelin Stars**: Dine at legendary restaurants like **Le Meurice** or **Epicure**.

Markets & Cafés

  • **Marché Bastille**: Fresh produce, cheeses, and street food.
  • **Café Culture**: Sip espresso at historic cafés like **Café de Flore** or **Les Deux Magots**.

🎨 Art & Museums

Musée d’Orsay

  • **Impressionist Treasures**: Houses works by Monet, Van Gogh, and Degas in a converted Beaux-Arts railway station.

Centre Pompidou

  • **Modern Art Hub**: Features avant-garde exhibitions and a rooftop view of the city.

Montmartre

  • **Bohemian Roots**: Wander cobblestone streets where Picasso and Dalí once lived. Visit the **Sacré-Cœur Basilica**.

🌿 Romantic Ambiance

Seine River Cruises

  • **Bateaux Mouches**: Glide past illuminated monuments at night.

Gardens & Parks

  • **Luxembourg Gardens**: Manicured lawns, statues, and puppet shows.
  • **Tuileries Garden**: Stroll between the Louvre and Place de la Concorde.

Bridges of Paris

  • **Pont Alexandre III**: Ornate bridge with gold accents, perfect for photos.

🛍️ Fashion & Shopping

Luxury Districts

  • **Champs-Élysées**: Flagship stores like Louis Vuitton and iconic Arc de Triomphe.
  • **Le Marais**: Boutique shops and vintage finds.

Department Stores

  • **Galeries Lafayette**: Art Nouveau architecture and a stunning glass dome.

🎭 Nightlife & Entertainment

Cabarets

  • **Moulin Rouge**: Birthplace of the can-can dance; dazzling performances.

Jazz Clubs

  • **Le Caveau de la Huchette**: Swing dancing in a 16th-century cellar.

🎉 Seasonal Highlights

  • **Spring**: Cherry blossoms at **Jardin des Plantes**.
  • **Summer**: **Paris Plages** (urban beaches along the Seine).
  • **Autumn**: Golden foliage in **Parc des Buttes-Chaumont**.
  • **Winter**: Christmas markets and ice skating at **Hôtel de Ville**.

💡 Hidden Gems

  • **Canal Saint-Martin**: Picnic by the water or explore quirky boutiques.
  • **Père Lachaise Cemetery**: Final resting place of Jim Morrison and Oscar Wilde.
  • **La Coulée Verte**: Elevated park built on a former railway line.

✨ Practical Tips

  • **Transport**: Efficient Metro system; walkable neighborhoods.
  • **Language**: Learn basic French phrases—*"Bonjour"* goes a long way!
  • **Timing**: Visit in April–June or September–October for fewer crowds. Paris is not just a city—it’s an experience that lingers in the heart long after you’ve left. 🥐✨
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment