(name:str, state: PipelineState, prompt_template: str, llm)
| 102 | return state |
| 103 | |
| 104 | def 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 | |
| 120 | def info_add(name: str, state: PipelineState, information: str, llm) -> PipelineState: |
| 121 | logger(f"{name} is adding information...") |
no test coverage detected