Langchain Basics Gemini Rules — Free Gemini Rules Template
    Neura MarketNeura Market/Gemini
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityDeepSeekDeepSeek
    CoPilotCoPilotStable DiffusionStable DiffusionMidjourneyMidjourney
    View All Directories
    OverviewRulesPromptsMCPsAgentsGamesBlogVideosGuidesCoursesCommunityGemsExtensionsTrending
    GeminiRulesLangchain Basics Gemini Rules
    Back to Rules

    Langchain Basics Gemini Rules

    Sujithr07 July 19, 2026
    0 copies 0 downloads
    Rule Content
    from langchain_google_genai import ChatGoogleGenerativeAI
    from langchain_core.prompts import ChatPromptTemplate
    from pydantic import BaseModel
    from typing import List,Optional
    from langchain_core.output_parsers import PydanticOutputParser
    
    
    from dotenv import load_dotenv
    load_dotenv()
    
    model = ChatGoogleGenerativeAI(model="gemini-2.5-flash-lite")
    
    class Movie(BaseModel):
        title: str
        release_year: Optional[int]
        genre: List[str]
        director: str
        cast: List[str]
        rating: float
        summary: str
    
    parser= PydanticOutputParser(pydantic_object=Movie)
    
    template = ChatPromptTemplate.from_messages([
        ("system",
    """
    Extract movie information from the paragraph
    
    STRICT RULES:
    - Output ONLY valid JSON
    - No explanations, no markdown, no extra text
    - Follow the format EXACTLY
    
    {format_instructions}
    """),
    ("human",
    """
    {paragraph}
    """)
    ])
    
    para = input("give me a paragraph: ")
    
    prompt = template.invoke(
        {
            "paragraph":para,
            "format_instructions":parser.get_format_instructions()
         }
    )
    
    response = model.invoke(prompt)
    parsed_output = parser.parse(response.content)
    print(parsed_output)
     
    

    Comments

    More Rules

    View all

    Sleepycat Seo Platform Gemini Rules

    A
    acovrp

    LITE IDE Gemini Rules

    H
    Heyz24

    Shadowtagai Monorepo V2 Gemini Rules

    S
    ShadowTag-v2

    WoKFlow Gemini Rules

    H
    howyongheng0313

    MetaPrompter Gemini Rules

    U
    ummerr

    Taskora Gemini Rules

    K
    kabilesh-c

    Stay up to date

    Get the latest Gemini prompts, rules, and resources delivered to your inbox weekly.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for Gemini and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Guides

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.

    Neura Market

    Custom AI Systems & Services

    Our team of experienced AI builders will help build custom AI systems, workflows, and solutions for your business.

    Request custom work

    Ready-made automations for this

    Workflows from the Neura Market marketplace related to this Gemini resource

    • Process Multiple Media Files in Telegram with Gemini AI & PostgreSQL Databasen8n · $24.99 · Related topic
    • AI-Powered Auto-Generated Exam Questions and Answers from Google Docs with Geminin8n · $24.99 · Related topic
    • Create Custom PDF Documents from Templates with Gemini & Google Driven8n · $24.99 · Related topic
    • Convert Telegram Messages to Professional LinkedIn Posts with Gemini AI & Approval Workflown8n · $24.99 · Related topic
    Browse all workflows