chat-ollama icon indicating copy to clipboard operation
chat-ollama copied to clipboard

跟着视频使用groq里面的llama3,但发现接口返回数据有问题,不能显示回复

Open pamxy opened this issue 10 months ago • 11 comments

clone了master的代码,直接无ollama跑了起来,然后配置groq,一切都就绪,发送了一个Hello,结果没回应,F12发现返回403,然后直接groq官网看到可以curl调用,我直接改成postman调用groq的API,可成功调用,是否groq的API接口变动了导致chatollama调用不通?🥶 入参 { "model": "llama3-70b-8192", "family": "Groq", "messages": [ { "role": "user", "id": 13, "content": "Hello", "timestamp": 1713608739048 } ], "stream": true }

返回参数 `{ "url": "/api/models/chat", "statusCode": 403, "statusMessage": "", "message": "403

Attention Required! | Cloudflare

Sorry, you have been blocked

You are unable to access groq.com

  <div class="cf-section cf-highlight">
    <div class="cf-wrapper">
      <div class="cf-screenshot-container cf-screenshot-full">
        
          <span class="cf-no-screenshot error"></span>
        
      </div>
    </div>
  </div><!-- /.captcha-container -->

  <div class="cf-section cf-wrapper">
    <div class="cf-columns two">
      <div class="cf-column">
        <h2 data-translate="blocked_why_headline">Why have I been blocked?</h2>

        <p data-translate="blocked_why_detail">This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.</p>
      </div>

      <div class="cf-column">
        <h2 data-translate="blocked_resolve_headline">What can I do to resolve this?</h2>

        <p data-translate="blocked_resolve_detail">You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.</p>
      </div>
    </div>
  </div><!-- /.section -->

  <div class="cf-error-footer cf-wrapper w-240 lg:w-full py-10 sm:py-4 sm:px-8 mx-auto text-center sm:text-left border-solid border-0 border-t border-gray-300">

Cloudflare Ray ID: xxxxxxxxxx Performance & security by Cloudflare

</div><!-- /#cf-error-details -->
", "stack": "

This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.

What can I do to resolve this?

You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.

at Function.generate (D:\Work\ai\chat-ollama\node_modules\.pnpm\[email protected]\node_modules\groq-sdk\src\error.ts:66:14) at Groq.makeStatusError (D:\Work\ai\chat-ollama\node_modules\.pnpm\[email protected]\node_modules\groq-sdk\src\core.ts:383:21) at Groq.makeRequest (D:\Work\ai\chat-ollama\node_modules\.pnpm\[email protected]\node_modules\groq-sdk\src\core.ts:446:24) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async RetryOperation._fn (D:\Work\ai\chat-ollama\node_modules\.pnpm\[email protected]\node_modules\p-retry\index.js:50:12)
" }`

pamxy avatar Apr 20 '24 10:04 pamxy

我也遇到这个问题

luckbinle avatar Apr 22 '24 06:04 luckbinle

groq 用中国大陆 ip 是无法访问的

satrong avatar Apr 22 '24 06:04 satrong

科学上网了,我自己写的python代码是可以用groq的。

luckbinle avatar Apr 22 '24 06:04 luckbinle

那可能没有代理到。我正在尝试集成一个代理功能

satrong avatar Apr 22 '24 07:04 satrong

这是我后台报的错误,基本和提issue这位兄台是一个问题。

[nuxt] [request error] [unhandled] [403] 403

Attention Required! | Cloudflare

Sorry, you have been blocked

You are unable to access groq.com

  <div class="cf-section cf-highlight">
    <div class="cf-wrapper">
      <div class="cf-screenshot-container cf-screenshot-full">
        
          <span class="cf-no-screenshot error"></span>
        
      </div>
    </div>
  </div><!-- /.captcha-container -->

  <div class="cf-section cf-wrapper">
    <div class="cf-columns two">
      <div class="cf-column">
        <h2 data-translate="blocked_why_headline">Why have I been blocked?</h2>

        <p data-translate="blocked_why_detail">This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.</p>
      </div>

      <div class="cf-column">
        <h2 data-translate="blocked_resolve_headline">What can I do to resolve this?</h2>

        <p data-translate="blocked_resolve_detail">You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.</p>
      </div>
    </div>
  </div><!-- /.section -->

  <div class="cf-error-footer cf-wrapper w-240 lg:w-full py-10 sm:py-4 sm:px-8 mx-auto text-center sm:text-left border-solid border-0 border-t border-gray-300">

Cloudflare Ray ID: 8783b098aec904c0 Performance & security by Cloudflare

</div><!-- /#cf-error-details -->

This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.

What can I do to resolve this?

You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.

at Function.generate (./node_modules/groq-sdk/src/error.ts:66:14) at Groq.makeStatusError (./node_modules/groq-sdk/src/core.ts:383:21) at Groq.makeRequest (./node_modules/groq-sdk/src/core.ts:446:24) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async RetryOperation._fn (./node_modules/p-retry/index.js:50:12)

luckbinle avatar Apr 22 '24 07:04 luckbinle

正常现象

图片

satrong avatar Apr 22 '24 07:04 satrong

哈哈哈😂,好吧

luckbinle avatar Apr 22 '24 07:04 luckbinle

我在另一个翻译软件的插件里面测试也是这样的,我使用curl测试的结果跟你这个返回的一样,python代码运行正常,我在colab里面测试curl也是正常的

kongds1999 avatar Apr 24 '24 05:04 kongds1999

兄弟,解决了麻烦提供下思路

kongds1999 avatar Apr 24 '24 05:04 kongds1999

已增加代理功能,可以尝试体验一下

satrong avatar Apr 28 '24 22:04 satrong

已增加代理功能,可以尝试体验一下

关于代理的文档部分随后跟上

sugarforever avatar Apr 28 '24 22:04 sugarforever