Skip to content

ZainAli24/langgraph_designpattern_02

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1. In start of this class we installed Vs code insiders.


2. LangGraph Design Patterns

Parallel Execution in LangGraph

Code Example

    futures = [multiply_by_two(number) , multiply_by_three(number)]

    results = [future.result() for future in futures]  

Understanding Execution Patterns

Direct .result() Approach:

  • Pehle ek function call hoga aur uska result aane tak wait karega.
  • Jab pehla complete ho jaye, tabhi doosra function chalega.
  • Matlab step-by-step chalega, ek ke baad doosra (synchronous execution).

Future List Approach:

  • Dono functions ek saath call ho jate hain, magar abhi result nahi liya jata.
  • Jab result chahiye hoga, toh dono ka result ek saath future se le lenge.
  • Parallel execution hoti hai, jo tez hoti hai (asynchronous execution).

Summary

Yani pehle future list mein store karne se dono functions ik saath call hote hain, aur jab result chahiye hota hai, tabhi hum wait karte hain. 🔄🚀


Routing in design patterns using langgraph

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages