Skip to content

Conversation

sxjeru
Copy link
Contributor

@sxjeru sxjeru commented Jun 22, 2025

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • 📝 docs
  • 🔨 chore

🔀 变更说明 | Description of Change

Ref:https://cloud.tencent.com/document/product/1729/111007#6d9d0237-cb50-42f7-917f-87344d28c8a9

📝 补充信息 | Additional Information

Summary by Sourcery

Bug Fixes:

  • Remove unsupported 'frequency_penalty' and 'presence_penalty' parameters from Hunyuan chatCompletion payload

Copy link

vercel bot commented Jun 22, 2025

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

A member of the Team first needs to authorize it.

Copy link
Contributor

sourcery-ai bot commented Jun 22, 2025

Reviewer's Guide

This PR updates the Hunyuan runtime’s chatCompletion handler to strip out unsupported parameters (frequency_penalty and presence_penalty) by excluding them from the payload and explicitly setting them to undefined for compatibility.

Class diagram for updated Hunyuan chatCompletion payload handling

classDiagram
    class LobeHunyuanAI {
        +baseURL: string
        +chatCompletion: object
    }
    class chatCompletion {
        +handlePayload(payload)
    }
    LobeHunyuanAI --> chatCompletion
    %% Highlight the change: handlePayload now removes frequency_penalty and presence_penalty
    class handlePayload {
        - frequency_penalty
        - presence_penalty
        + frequency_penalty: undefined
        + presence_penalty: undefined
    }
    chatCompletion --> handlePayload
Loading

File-Level Changes

Change Details Files
Remove unsupported parameters from Hunyuan chat payload
  • Expanded destructuring to exclude frequency_penalty and presence_penalty
  • Disabled ESLint warnings for unused variables
  • Explicitly set frequency_penalty and presence_penalty to undefined in the returned payload
src/libs/model-runtime/hunyuan/index.ts

Assessment against linked issues

Issue Objective Addressed Explanation

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 22, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link
Contributor

gru-agent bot commented Jun 22, 2025

TestGru Assignment

Summary

Link CommitId Status Reason
Detail 4c55c96 🚫 Skipped No files need to be tested {"src/libs/model-runtime/hunyuan/index.ts":"File path does not match include patterns."}

History Assignment

Tip

You can @gru-agent and leave your feedback. TestGru will make adjustments based on your input

@lobehubbot
Copy link
Member

👍 @sxjeru

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.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

@dosubot dosubot bot added the Model Provider 模型服务商 label Jun 22, 2025
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @sxjeru - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link

codecov bot commented Jun 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.38%. Comparing base (2d1babc) to head (5b59c1f).
Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##             main    #8247     +/-   ##
=========================================
  Coverage   87.37%   87.38%             
=========================================
  Files         843      843             
  Lines       62875    62877      +2     
  Branches     5671     4142   -1529     
=========================================
+ Hits        54940    54942      +2     
  Misses       7935     7935             
Flag Coverage Δ
app 87.38% <100.00%> (+<0.01%) ⬆️
server 95.67% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

vercel bot commented Jun 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lobe-chat-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 22, 2025 7:48am

@arvinxx arvinxx merged commit 826d724 into lobehub:main Jun 22, 2025
17 of 18 checks passed
@lobehubbot
Copy link
Member

❤️ Great PR @sxjeru ❤️

The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world.
项目的成长离不开用户反馈和贡献,感谢您的贡献! 如果您对 LobeHub 开发者社区感兴趣,请加入我们的 discord,然后私信 @arvinxx@canisminor1990。他们会邀请您加入我们的私密开发者频道。我们将会讨论关于 Lobe Chat 的开发,分享和讨论全球范围内的 AI 消息。

github-actions bot pushed a commit that referenced this pull request Jun 22, 2025
### [Version&nbsp;1.96.5](v1.96.4...v1.96.5)
<sup>Released on **2025-06-22**</sup>

#### 🐛 Bug Fixes

- **misc**: Remove unsupported parameters of Hunyuan.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Remove unsupported parameters of Hunyuan, closes [#8247](#8247) ([826d724](826d724))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
@lobehubbot
Copy link
Member

🎉 This PR is included in version 1.96.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sxjeru sxjeru deleted the hunyuan1 branch June 22, 2025 13:16
github-actions bot pushed a commit to jaworldwideorg/OneJA-Bot that referenced this pull request Jun 25, 2025
## [Version&nbsp;1.95.0](v1.94.5...v1.95.0)
<sup>Released on **2025-06-25**</sup>

#### ✨ Features

- **misc**: Add Brave & Google PSE & Kagi as build-in Search Provider, add v0 (Vercel) provider support.

#### 🐛 Bug Fixes

- **misc**: Fix `MiniMax-M1` reasoning tag missing, fix inputTemplate behavior, Google Gemini tools declarations, Remove unsupported parameters of Hunyuan.

#### 💄 Styles

- **openrouter**: Add stable versions of Gemini 2.5 models.
- **misc**: Add `blockAds` & `stealth` params for Browserless, Optimized Gemini thinkingBudget configuration, update i18n, update i18n.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's improved

* **misc**: Add Brave & Google PSE & Kagi as build-in Search Provider, closes [lobehub#8172](https://github.com/jaworldwideorg/OneJA-Bot/issues/8172) ([16ae521](16ae521))
* **misc**: Add v0 (Vercel) provider support, closes [lobehub#8235](https://github.com/jaworldwideorg/OneJA-Bot/issues/8235) ([5842a18](5842a18))

#### What's fixed

* **misc**: Fix `MiniMax-M1` reasoning tag missing, closes [lobehub#8240](https://github.com/jaworldwideorg/OneJA-Bot/issues/8240) ([ea76c11](ea76c11))
* **misc**: Fix inputTemplate behavior, closes [lobehub#8204](https://github.com/jaworldwideorg/OneJA-Bot/issues/8204) ([61c2c3c](61c2c3c))
* **misc**: Google Gemini tools declarations, closes [lobehub#8256](https://github.com/jaworldwideorg/OneJA-Bot/issues/8256) ([08f5d73](08f5d73))
* **misc**: Remove unsupported parameters of Hunyuan, closes [lobehub#8247](https://github.com/jaworldwideorg/OneJA-Bot/issues/8247) ([826d724](826d724))

#### Styles

* **openrouter**: Add stable versions of Gemini 2.5 models, closes [lobehub#8239](https://github.com/jaworldwideorg/OneJA-Bot/issues/8239) ([d34ecab](d34ecab))
* **misc**: Add `blockAds` & `stealth` params for Browserless, closes [lobehub#8255](https://github.com/jaworldwideorg/OneJA-Bot/issues/8255) ([2ff3efa](2ff3efa))
* **misc**: Optimized Gemini thinkingBudget configuration, closes [lobehub#8224](https://github.com/jaworldwideorg/OneJA-Bot/issues/8224) ([03625e8](03625e8))
* **misc**: Update i18n, closes [lobehub#8253](https://github.com/jaworldwideorg/OneJA-Bot/issues/8253) ([b86dc9b](b86dc9b))
* **misc**: Update i18n, closes [lobehub#8242](https://github.com/jaworldwideorg/OneJA-Bot/issues/8242) ([2d1babc](2d1babc))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
AirboZH pushed a commit to yuanze-dev/lobe-chat that referenced this pull request Jul 9, 2025
* 🐛 fix: 去除 hunyuan 频率和存在惩罚参数

* 去除重复的 ESLint no-unused-vars

* Revert "去除重复的 ESLint no-unused-vars"

This reverts commit e6edece.
AirboZH pushed a commit to yuanze-dev/lobe-chat that referenced this pull request Jul 9, 2025
### [Version&nbsp;1.96.5](lobehub/lobe-chat@v1.96.4...v1.96.5)
<sup>Released on **2025-06-22**</sup>

#### 🐛 Bug Fixes

- **misc**: Remove unsupported parameters of Hunyuan.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Remove unsupported parameters of Hunyuan, closes [lobehub#8247](lobehub#8247) ([826d724](lobehub@826d724))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
bbbugg pushed a commit to bbbugg/lobe-chat that referenced this pull request Aug 14, 2025
* 🐛 fix: 去除 hunyuan 频率和存在惩罚参数

* 去除重复的 ESLint no-unused-vars

* Revert "去除重复的 ESLint no-unused-vars"

This reverts commit e6edece.
bbbugg pushed a commit to bbbugg/lobe-chat that referenced this pull request Aug 14, 2025
### [Version&nbsp;1.96.5](lobehub/lobe-chat@v1.96.4...v1.96.5)
<sup>Released on **2025-06-22**</sup>

#### 🐛 Bug Fixes

- **misc**: Remove unsupported parameters of Hunyuan.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Remove unsupported parameters of Hunyuan, closes [lobehub#8247](lobehub#8247) ([dfa428b](lobehub@dfa428b))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Model Provider 模型服务商 released size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

混元模型无法进行测试
3 participants