dify icon indicating copy to clipboard operation
dify copied to clipboard

Issue with agent

Open alfi4000 opened this issue 1 year ago • 16 comments

Self Checks

  • [X] I have searched for existing issues search for existing issues, including closed ones.
  • [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [X] Pleas do not modify this template :) and fill in all the required fields.

Dify version

0.5.11

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

use instructions: Your task is to check the weather websites online like weather.com and others and summarize their result in a table with temperature, wind speed, rain, flood warning, and other staff. Also, include the percentage of how likely it is to rain, when it starts, and ends. Ensure that the table is well-formatted and easy to read. You MUST provide the source of the information and the time it was last updated. You will be penalized if the information is inaccurate or incomplete. You will use duckduckgo to search on popular theater websites and get the time from the tool current_time wich you need to search on those weather websites! Search with duck duck go on those weather websites and for the current day that what you got from the tool current_time and summarize in a table then the result!
These are the weather websites!: weather.com accuweather.com forecast.weather.gov weather.gov ktla.com theweathernetwork.com

✔️ Expected Behavior

to let it search duckduckgo and show me summarized the result!

❌ Actual Behavior

Getting error! Bildschirmfoto 2024-03-30 um 12 29 35 can someone help me I am not getting what I am doing wrong I just see the DuckDuckGogo error I am not a programmer I just found that defy and thought that it is a try worth but now facing that duckduckgo issue that I already try 3hours to figure out!

alfi4000 avatar Mar 30 '24 19:03 alfi4000

Hey @alfi4000, it sounds like you're facing a challenge with Dify v0.5.11, specifically when trying to use DuckDuckGo for web scraping to summarize weather forecasts from various websites. Let's tackle this step by step.

First off, make sure your Dify instance can access the internet since it's essential for scraping websites. If you're running Dify in a Docker container, check your Docker network settings to ensure outbound connections are allowed.

The issue might also stem from DuckDuckGo blocking your requests, possibly due to a high volume of requests in a short period or because they're identified as bot traffic. Consider adding delays between your requests or exploring different methods to access the websites.

Regarding the task of summarizing weather forecasts, it requires some advanced configuration and scripting in Dify, given the different structures and formats of the target websites. I recommend checking out the Dify scripting documentation for guidance on using Dify's scripting capabilities to extract and format the necessary information.

If the "DuckDuckGo error" persists, providing more details about the error would be incredibly helpful. Information such as any additional messages that accompany the error, whether it occurs immediately or after some time, can offer more insight into the problem.

I hope this helps you move forward. If you have more details or further questions, feel free to share!

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

dosubot[bot] avatar Mar 30 '24 19:03 dosubot[bot]

It seems that it's a langchain related issue, could you pls tell me the version of your langchain in your environment? but also, I recommend use another search engine like Google or Bing, as DuckDuckGo limited their interfaces for anonymous requests.

Yeuoly avatar Mar 31 '24 08:03 Yeuoly

Thanks for taking the time! :) I am unsure how to find out the langchain version I just pulled the image yesterday so it could be the latest, the google api is paid (SerpAPi) only a few request each month on google search, its because I just use those tools as hobbyist and don't want to spend money just for search requests and bing same but there I first need to give my credit card info and pay before I get an api!

alfi4000 avatar Apr 01 '24 05:04 alfi4000

then you can try tavily! there are 1000 free credits you can use for fun and interest.

Yeuoly avatar Apr 01 '24 09:04 Yeuoly

then you can try tavily! there are 1000 free credits you can use for fun and interest.

That worked I just have too fine-tune my app, but will I get monthly the 1000 credit or just one time? It's ok if you don't know its for me just unclear!

alfi4000 avatar Apr 02 '24 01:04 alfi4000

in ./api/requirements.txt file , change duckduckgo version from 5.1.0 to 5.2.2 , then compile the code . this will solve the problem .

Akatsuki-Ryu avatar Apr 02 '24 14:04 Akatsuki-Ryu

in ./api/requirements.txt file , change duckduckgo version from 5.1.0 to 5.2.2 , then compile the code . this will solve the problem .

i have runned after I changed it this command and it recreated the container: sudo docker-compose down sudo docker-compose pull sudo docker-compose up -d

but still getting an error:
unknown error: local variable 'snippets' referenced before assignment

alfi4000 avatar Apr 02 '24 17:04 alfi4000

I have also tryed to completely start from scratch still same issue! I deleted all files from diff docker and local pc and git cloned repo again and runned it but still getting error!

alfi4000 avatar Apr 02 '24 17:04 alfi4000

the latest release should fix the problem , if you read the docker-compose file , you will notice it is pulling the image, but you need to build the image locally by loading the dockerfile . meaning you need to modify the docker-compose file to make it build from local source code instead of pulling the image . as we speak , I guess a fix has already been pushed and the this or next release image it should be fixed .

for your reference you should change the docker-compose file like this . there are two place you need to make changes

  api:
    # image: langgenius/dify-api:0.6.0-preview-workflow.1
    build:
      context: ../api/
      dockerfile: ../api/Dockerfile
    restart: always
    environment:

Akatsuki-Ryu avatar Apr 02 '24 17:04 Akatsuki-Ryu

I have out taken the image line and added the build but as I understood there is a different place too where I have to make that change!?

alfi4000 avatar Apr 02 '24 18:04 alfi4000

Sorry if I am looking like a stupid I am not so familiar with those stuff I still learning how docker etc. works!

alfi4000 avatar Apr 02 '24 18:04 alfi4000

As I get it the second should be worker that would be the only one that would make sense to me!

alfi4000 avatar Apr 02 '24 18:04 alfi4000

I just added it to api and worker and runned command: sudo docker pull I saw few red market things but it continues!: WARNING: The candidate selected for download or install is a yanked version: 'twilio' candidate (version 9.0.0 at https://files.pythonhosted.org/packages/1c/d6/7ba1e2fc5b5695cfef2b5f943e687ed0b4a4e3b92973cf4d7cde6b5668de/twilio-9.0.0-py2.py3-none-any.whl (from https://pypi.org/simple/twilio/) (requires-python:>=3.7.0)) Reason for being yanked: All inequality(eg date_after, date_before) fields are not present in this version.

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip is available: 23.0.1 -> 24.0 [notice] To update, run: pip install --upgrade pip

that were showing at the end:

WARNING: Image for service api was built because it did not already exist. To rebuild this image you must use docker-compose build or docker-compose up --build. docker_weaviate_1 is up-to-date docker_redis_1 is up-to-date docker_db_1 is up-to-date docker_web_1 is up-to-date Recreating docker_api_1 ... done Recreating docker_worker_1 ... Recreating docker_worker_1 ... done

alfi4000 avatar Apr 02 '24 18:04 alfi4000

I just noticed they have an issue they are just restarting and restarting after 10sec

alfi4000 avatar Apr 02 '24 18:04 alfi4000

So i removed them so I have done something wrong ill wait for a advise what to do before I do anything !

alfi4000 avatar Apr 02 '24 18:04 alfi4000

Could I instead of editing the code not just running instead --build? Sorry if am sounding stupid I am not yet so familiar with docker!

alfi4000 avatar Apr 04 '24 02:04 alfi4000

Could I instead of editing the code not just running instead --build? Sorry if am sounding stupid I am not yet so familiar with docker!

@alfi4000 For more information about docker, please refer there docs here https://www.docker.com/get-started/ if you need to seek help from the community, please head to our discussion page.

crazywoola avatar Apr 16 '24 04:04 crazywoola