Lgcodegen Graph Spec
LangChain Hub prompt: johannes/lgcodegen-graph-spec
Let me describe the pseudocode shown below, for specifying a langgraph graph we can run.
-
Comment lines begin with '#'.
-
The first word in the first non-comment line is the name of a State class. The State class holds information needed during the graph execution.
For example:
# description of node_1 behavior
node_1 -> node_2
These lines are the specification for node_1.
In some cases, node_1 might need to choose its destination
# node_1 might go to either node_2 or node_3
node_1 -> router_function(node_2, node_3)
The router function is similar to the Node function in that it takes the State as a parameter. It differs in the return value: the router function returns a string, the name of the node function to route to.
- In all other non-comment lines, the first word in the line (excluding lines that start with white space) is the name of a Node function. The Node function takes the State class as a parameter.
The fields stored in State are based on what the nodes do.
Everything we ask for, any sort of user input, we save in the State, in either a field or a list. Every response that is generated, we also save in the State.
The text in the pseudocode are function names, there are no state fields named.
{question}
How to Use
Use with LangChain: hub.pull("johannes/lgcodegen-graph-spec")
Related Prompts
More prompts in Coding & Development
This Prompt Ads Sequential Function Calling To Models Other Than GPT 0613
This prompt ads sequential function calling to models other than GPT-0613
Create a personalized workout routine
Tailor a workout routine specifically designed for individual fitness goals
GODMODE CHEATCODE
God Writes You a Letter Today. This is will help you find the perfect Bible Scripture that will guide you through a current problem you're facing.
Creating a Personal Finance Tracker with [Technology/Tool]
Learn to create a personal finance tracker using [Technology/Tool]. Get code samples and budgeting tips.
Build an entire application using bubble.io with ChatGPT4
Build an entire app with bubble.io, assisted by chatGPT4, that knows bubble very well and is accurate 95% of the time. This prompt will help you maximize the quality of chatGPT assistance. Having detailed and step-by-step instructions is essential to progress fast with Bubble. This initial prompt will help you get started on a good basis. Follow it because I will make it even better.
Become LawyerGPT
Are you in a legal bind? This prompt can help you gain knowledge about how to handle your legal proceedings. DISCLAIMER: Please meet with a real lawyer to discuss your options.