langgraph icon indicating copy to clipboard operation
langgraph copied to clipboard

dynamic jump to node

Open cjdxhjj opened this issue 7 months ago • 10 comments

Checked other resources

  • [X] I added a very descriptive title to this issue.
  • [X] I searched the LangGraph/LangChain documentation with the integrated search.
  • [X] I used the GitHub search to find a similar question and didn't find it.
  • [X] I am sure that this is a bug in LangGraph/LangChain rather than my code.
  • [X] I am sure this is better as an issue rather than a GitHub discussion, since this is a LangGraph bug and not a design question.

Example Code

def __load_key_indicators(self, state: ZxhState) -> dict:
        self.push_msg(state, 'caption', '产仔分析,加载关键指标')
        res = self.dp.get_product_core_birth_report(state.get('pig_farm_id'))
        if res.code != 0:
            self.push_msg(state, 'reply', f'产仔分析,加载关键指标失败:{res.msg}')
            return {'messages': []}
        else:
            return {'data': ('parturition_analysis_core_indicators', res.data)}

Error Message and Stack Trace (if applicable)

No response

Description

in gradph node, i invoke some extern interface, they may fail with code, i check the code, if error occur, i want do another node, now i have to define an temp node, check the result and add an condiftion edge to do that things, but i have at least one hundred, that may a hevay job

System Info

langchain==0.2.1 langchain-community==0.2.4 langchain-core==0.2.3 langchain-openai==0.1.8 langchain-text-splitters==0.2.0 langgraph==0.0.69 langsmith==0.1.65

linux

python 3.12

cjdxhjj avatar Jul 09 '24 10:07 cjdxhjj