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

🐛 fix: fix parameter conditions for perplexity

Open gijigae opened this issue 1 year ago • 8 comments

💻 变更类型 | Change Type

  • [ ] ✨ feat
  • [x] 🐛 fix
  • [ ] ♻️ refactor
  • [ ] 💄 style
  • [ ] 🔨 chore
  • [ ] ⚡️ perf
  • [ ] 📝 docs

🔀 变更说明 | Description of Change

Updated the paramter conditions for Perplexity to resolve #1368 . Perplexity only accepts either frequency_penalty or presence_penalty, and not both. If the value of presence_penalty is something other than 0, the presence_penality will be passed to a model.

📝 补充信息 | Additional Information

The details will be added to a document as well.

gijigae avatar Feb 26 '24 14:02 gijigae

@gijigae is attempting to deploy a commit to the LobeHub Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Feb 26 '24 14:02 vercel[bot]

👍 @gijigae

Thank you for raising your pull request and contributing to our Community Please make sure you have followed our contributing guidelines. We will review it as soon as possible. If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。 如果您遇到任何问题,请随时与我们联系。

lobehubbot avatar Feb 26 '24 14:02 lobehubbot

Codecov Report

Attention: Patch coverage is 0% with 18 lines in your changes are missing coverage. Please review.

Project coverage is 86.32%. Comparing base (42ea0f5) to head (da9b73c). Report is 5 commits behind head on main.

Files Patch % Lines
src/libs/agent-runtime/perplexity/index.ts 0.00% 18 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1394      +/-   ##
==========================================
- Coverage   86.33%   86.32%   -0.01%     
==========================================
  Files         217      218       +1     
  Lines       11059    11118      +59     
  Branches     1177     1186       +9     
==========================================
+ Hits         9548     9598      +50     
- Misses       1511     1520       +9     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 26 '24 14:02 codecov[bot]

Thanks @arvinxx for the feedback! Really appreciate your help. Tried the approach in ZhipuAI, but the response received from Perplexity were somewhat repetitive.

https://github.com/lobehub/lobe-chat/blob/dd9d93ea9971b1231080ab272c26eb0040d9cc13/src/libs/agent-runtime/zhipu/index.ts#L83

gijigae avatar Feb 28 '24 10:02 gijigae

@gijigae I have update the code, please check whether it works well?

arvinxx avatar Feb 28 '24 12:02 arvinxx

Thanks @arvinxx for the update! Tested and it's showing same words over and over. Will check what's causing the problem.

image

gijigae avatar Feb 28 '24 15:02 gijigae

@gijigae hi, is there any update?

arvinxx avatar Mar 25 '24 03:03 arvinxx

@gijigae hi, is there any update?

Hello @arvinxx , I'm still trying to figure out why Perplexity returns gibburish data with the code you updated.

gijigae avatar Mar 26 '24 10:03 gijigae

:tada: This issue has been resolved in version 0.156.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

lobehubbot avatar May 09 '24 14:05 lobehubbot