Git Product home page Git Product logo

Comments (4)

JianxinMa avatar JianxinMa commented on June 12, 2024

@tuhahaha Let's discuss how we can address this issue when you return from your vacation.

A little more background on the cause of this issue:

When a user clicks the Add button, (1) the URL is saved to a temporary file, and (2) the chatbot will look at that temporary file. The current implementation assumes that Step 1 finishes before Step 2 starts. However, this doesn't always seem to be the case. For example, what if Step 1 is blocked by some other operation? What if the write operation fails? In such scenarios, Step 2 will fail with an IndexError: list index out of range.

from qwen-agent.

JianxinMa avatar JianxinMa commented on June 12, 2024

I suspect that the frequent cause of this issue is either one of the following:

  • (More likely) The user is clicking the Add button while having the popup page open. This can lead to a race condition. We need to add some precautions to prevent this.
  • (Less likely) We are having a permission issue when dealing with that temporary file. Perhaps even the directory is not created properly.

from qwen-agent.

JianxinMa avatar JianxinMa commented on June 12, 2024

Oh, this is a different issue, not the same one that I am talking about in my previous comment. The IndexError occurs when executing te following code:

...
data['content'] = parse_html_bs(...)  # Using bs4 inside to parse html content received from the chrome extension.
...
extract = data['content'][0]['metadata']['title']  # Here!

@tuhahaha It looks like bs4 fails to retrieve the content of the page here. I'm still trying to reproduce this issue and figure out why it occurs.

@tuhahaha Btw, we need to automatically detect the language and use English prompts when dealing with English requests.

from qwen-agent.

JianxinMa avatar JianxinMa commented on June 12, 2024

I just pushed a quick fix. Please pull the latest code and see if it works for you.

Details:

  • I managed to reproduce the issue on a Windows machine. WSL2 works fine, but native Windows does not.
  • On my machine, this is related to the str codec, which is a mess on Windows since it does not always use UTF-8 and may instead use other encodings such as GBK or Latin-1.

from qwen-agent.

Related Issues (20)

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.