MCPcopy Index your code
hub / github.com/LangGraph-GUI/LangGraph-GUI-backend / condition_switch

Function condition_switch

src/WorkFlow.py:104–118  ·  view source on GitHub ↗
(name:str, state: PipelineState, prompt_template: str, llm)

Source from the content-addressed store, hash-verified

102 return state
103
104def condition_switch(name:str, state: PipelineState, prompt_template: str, llm) -> PipelineState:
105 logger(f"{name} is working...")
106
107 state["history"] = clip_history(state["history"])
108
109 generation = create_llm_chain(prompt_template, llm, state["history"])
110 data = json.loads(generation)
111
112 condition = data["switch"]
113 state["condition"] = condition
114
115 state["history"] += f"\nCondition is {condition}"
116 state["history"] = clip_history(state["history"])
117
118 return state
119
120def info_add(name: str, state: PipelineState, information: str, llm) -> PipelineState:
121 logger(f"{name} is adding information...")

Callers 1

build_subgraphFunction · 0.85

Calls 3

loggerFunction · 0.90
clip_historyFunction · 0.90
create_llm_chainFunction · 0.90

Tested by

no test coverage detected