GithubHelp home page GithubHelp logo

langgraph-demo's People

Contributors

iloveyou-520 avatar q2wxec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

langgraph-demo's Issues

把addendum改成中文,就报KeyError: 'feedback错误

PS D:\data\langgraph-demo-master\codeagent> python .\workflow.py
---GENERATE SOLUTION---
code_solution:To implement the merge sort algorithm in Python, you can define a function that recursively splits the input list into smaller sublists, sorts them, and then merges them back together in s
orted order.

Imports:

# No specific imports are required for implementing merge sort

Code:

def merge_sort(arr):
    if len(arr) > 1:
        mid = len(arr) // 2
        left_half = arr[:mid]
        right_half = arr[mid:]

        merge_sort(left_half)
        merge_sort(right_half)

        i = j = k = 0

        while i < len(left_half) and j < len(right_half):
            if left_half[i] < right_half[j]:
                arr[k] = left_half[i]
                i += 1
            else:
                arr[k] = right_half[j]
                j += 1
            k += 1

        while i < len(left_half):
            arr[k] = left_half[i]
            i += 1
            k += 1

        while j < len(right_half):
            arr[k] = right_half[j]
            j += 1
            k += 1

    return arr

This merge_sort function takes a list arr as input and sorts it using the merge sort algorithm. It recursively divides the input list into smaller sublists until each sublist contains only one eleme
nt. Then it merges the sublists back together in sorted order.

You can use this function by passing a list to it, for example:

my_list = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]
sorted_list = merge_sort(my_list)
print(sorted_list)

---CHECKING CODE ---
mentor:{'correct': True}
Traceback (most recent call last):
File "D:\data\langgraph-demo-master\codeagent\workflow.py", line 26, in
app.invoke({"keys": {"question": "如何实现归并排序算法?", "iterations": 0}})
File "C:\Users\xie\AppData\Local\Programs\Python\Python39\lib\site-packages\langgraph\pregel_init_.py", line 1171, in invoke
for chunk in self.stream(
File "C:\Users\xie\AppData\Local\Programs\Python\Python39\lib\site-packages\langgraph\pregel_init_.py", line 774, in stream
"feedback": mentor['feedback'],
KeyError: 'feedback'

**不知道为什么把addendum改成下面中文的,就报以上错误
addendum = """


你先前尝试解决过这个问题。
这是你的解决方案:


{generation}


这是来自代码导师的指导:


{feedback}


请重新尝试回答这个问题。
用对代码解决方案的描述,结构化你的答案。
然后列出要导入的内容。
最后列出功能性的代码块。

用户的问题如下:


{question}**

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.