Gen-AI Developer Classroom notes 25/May/2025

Dive into langgraph

TypeDict

  • dictionary
x = {
    'name': 'python',
    'version': 3.11
}

x['name']
# python

x['version']
# 3.11
  • Type Dict
from typing_extensions import TypeDict
class Technology(TypeDict):
    name: str
    version: float

tech = Techonology(name='python', version=3.11)

Lets build a workflow with decision to make

Adding LLMs to langgraph

  • To interact with llms with langgraph we need to understand Messages. There are 5 types of messages on larger note
    • HumanMessage: This is your input to llm (prompt)
    • AIMessage: This is response from llm
    • SystemMessage
    • FunctionCallMessage
    • ToolMessage

GCloud CLI Setup

  • Install gcloud cli
  • login into gcloud gcloud auth login
  • setup application auth login gcloud auth application-default login

Extra pip packages

  • INstall langchain and langchain-core
pip install langchain-core langchain
  • Install langchain google vertex
pip install -qU "langchain[google-vertexai]"
  • Install openai (optional)
pip install -qU "langchain[openai]"

By continuous learner

enthusiastic technology learner

Leave a Reply

Discover more from Direct AI Powered By Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading