dify icon indicating copy to clipboard operation
dify copied to clipboard

yahoo tools is not avaliable

Open Sherlocksuper opened this issue 10 months ago • 18 comments

Self Checks

  • [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
  • [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] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • [x] Please do not modify this template :) and fill in all the required fields.

Dify version

0.15.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. create an agent
  2. add yahoo tools
  3. any models is ok
  4. ask agent like "please give me 600195.SH tickets info" or "please give me 600195 tickets info"
  5. then the agent will use yahoo tools and result is
request
{"yahoo_finance_ticker": "{\"symbol\": \"600519\"}"}
response
{"yahoo_finance_ticker": "tool invoke error: Expecting value: line 1 column 1 (char 0)"}

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

Sherlocksuper avatar Feb 08 '25 08:02 Sherlocksuper

Hello, @Sherlocksuper! I'm here to help you with bug reports, answer questions, and guide you on how to contribute. Let's tackle this issue together while we wait for a human maintainer to join in.

The error message "tool invoke error: Expecting value: line 1 column 1 (char 0)" typically indicates that the response from the Yahoo Finance API is empty or not in the expected JSON format. This can happen due to several reasons:

  1. Invalid Ticker Symbol: Ensure that the ticker symbol "600519" is valid and recognized by Yahoo Finance. If the symbol is incorrect or not supported, the API might return an empty response.

  2. Connection Issues: There might be a problem with the internet connection or the API endpoint, leading to an incomplete or empty response. Check your network connection and ensure that the API endpoint is accessible.

  3. API Limitations or Changes: Yahoo Finance might have limitations on the number of requests or changes in their API that could affect the response. Verify if there are any known issues or updates regarding the Yahoo Finance API.

  4. Configuration Issues: Double-check the configuration settings for the Yahoo tools in your Dify setup to ensure everything is correctly set up, especially if you are self-hosting.

If the issue persists, you might want to add logging or debugging to capture the exact response from the API to better understand the problem.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

dosubot[bot] avatar Feb 08 '25 08:02 dosubot[bot]

ref: https://help.yahoo.com/kb/SLN2310.html

In Yahoo Finance, Shanghai Stock Exchange is coded as SS and Shenzhen Stock Exchange is coded as SZ.

You can check this link 600195.SS.

muzea avatar Feb 10 '25 12:02 muzea

ref: https://help.yahoo.com/kb/SLN2310.html

In Yahoo Finance, Shanghai Stock Exchange is coded as SS and Shenzhen Stock Exchange is coded as SZ.

You can check this link 600195.SS.

Thanks for you but i tried it again There is still an error

Image

Sherlocksuper avatar Feb 17 '25 09:02 Sherlocksuper

I encountered the same problem. I used 'NVDA' to get stock information by yahoo finance ticker.

{ "error_message": "Failed to invoke tool: Expecting value: line 1 column 1 (char 0)", "error_type": "UnknownError" }

bensontien avatar Feb 19 '25 07:02 bensontien

What model are you using? Maybe the model itself does not support function call?

muzea avatar Feb 19 '25 12:02 muzea

I use local model, DeepSeek-R1-Distill-Qwen-32B. Hmm... But I just test the ticker and this is the error message.

Image Image

bensontien avatar Feb 20 '25 01:02 bensontien

https://github.com/deepseek-ai/DeepSeek-R1/issues/9

deepseek r1 currently does not support function call, you can try to use other models.

muzea avatar Feb 20 '25 02:02 muzea

Thanks for your imfomation. I will try to use other models.

bensontien avatar Feb 20 '25 03:02 bensontien

Image

I use Gemini-2.0-Flash-001 model. But I got the same error. I think yahoo tool doesn't work. Please check it out

jaehyeongAN avatar Feb 20 '25 15:02 jaehyeongAN

Same issue!

Aaryan-Kapoor avatar Feb 23 '25 08:02 Aaryan-Kapoor

There are several issues with similar error messages in yfinance https://github.com/ranaroussi/yfinance/issues/2304 https://github.com/ranaroussi/yfinance/issues/2179

Maybe you have encountered rate-limit, or your IP has been banned by Yahoo.

Dify seems to be preparing a major version update now. After this update, adding more detailed error messages to Yahoo Tools may be helpful for troubleshooting.

muzea avatar Feb 24 '25 13:02 muzea

The dify team can update yfinance [0.2.54] to solve this issue.

tbdavid2019 avatar Feb 25 '25 07:02 tbdavid2019

为什么不从 雪球、东方财富、同花顺去调用数据呢?

filwu8 avatar Feb 25 '25 23:02 filwu8

I have the same issue. Tried to install both versions of yahoo finance plugins.

liweichen avatar Feb 28 '25 04:02 liweichen

Hello, i am running new 1.0 release and get this error too

Request {"yahoo_finance_news": {"symbol": "IBM"}} Response {"yahoo_finance_news": "tool invoke error: PluginInvokeError: {\"args\":{},\"error_type\":\"JSONDecodeError\",\"message\":\"Expecting value: line 1 column 1 (char 0)\"}"}

this was tested with GPT 4o 4omini chatgpt-4o-latest, deepseek reasoning, claude 37 and all; returning the same error.

please can this be investigated and resolved the yahoo finance plugin would be amazing if it was functional.

Woahai321 avatar Mar 01 '25 03:03 Woahai321

It caused by rate limit on my test. Not the tool itself.

fdb02983rhy avatar Mar 01 '25 21:03 fdb02983rhy

The error message says failed tool invoke.

On Sat, Mar 1, 2025, 4:33 PM Kalo Chin @.***> wrote:

It caused by rate limit on my test. Not the tool itself.

— Reply to this email directly, view it on GitHub https://github.com/langgenius/dify/issues/13403#issuecomment-2692429622, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQTPMJOQNOL7DNPU5AYF7L2SIRRLAVCNFSM6AAAAABWXOV6GCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOJSGQZDSNRSGI . You are receiving this because you commented.Message ID: @.***> [image: fdb02983rhy]fdb02983rhy left a comment (langgenius/dify#13403) https://github.com/langgenius/dify/issues/13403#issuecomment-2692429622

It caused by rate limit on my test. Not the tool itself.

— Reply to this email directly, view it on GitHub https://github.com/langgenius/dify/issues/13403#issuecomment-2692429622, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQTPMJOQNOL7DNPU5AYF7L2SIRRLAVCNFSM6AAAAABWXOV6GCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOJSGQZDSNRSGI . You are receiving this because you commented.Message ID: @.***>

liweichen avatar Mar 01 '25 21:03 liweichen

I just found that it caused by the SDK version. See https://github.com/langgenius/dify-official-plugins/pull/352

fdb02983rhy avatar Mar 01 '25 21:03 fdb02983rhy