Tag: LangChain – Quick Guide


  • LangChain – Quick Guide

    LangChain – Quick Guide Table Of Contents: Quick Start Build A Basic Agent Building A Real World Agent. (1) Quickstart pip install -U langchain deepagents export OPENAI_API_KEY = "your-api-key" (2) Building A Basic Agent from langchain.agents import create_agent def get_weather(city:str)->str: """Get Weather For A Given City""" return f"It's Always Sunny In {city}!" agent = create_agent( model = "openai:gpt-5.5", tools = [get_weather], system_prompt = "You Are A Helpful Assistant", ) result = agent.invoke( {"message":[{"role":"user", "content":"What Is The Weather In Bhubaneswar"}]} ) print(result["message"][-1].content_blocks) (3) Building A Real World Agent SYSTEM_PROMPT = """ You are a literary data assistant. IMPORTANT RULES: 1. If

    Read More