Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ feat: Add Baichuan model provider #3097

Merged
merged 2 commits into from
Jul 1, 2024
Merged

Conversation

hezhijie0327
Copy link
Contributor

@hezhijie0327 hezhijie0327 commented Jun 30, 2024

💻 变更类型 | Change Type

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

🔀 变更说明 | Description of Change

基于 #2804 实现支持百川大模型

存在一个问题,frequency_penalty 预设需要在 1-2 范围内,默认下会出现 frequency_penalty must be between 1 and 2 - frequencyPenalty 错误 [已修复]

📝 补充信息 | Additional Information

image
image
image

Copy link

vercel bot commented Jun 30, 2024

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

A member of the Team first needs to authorize it.

@lobehubbot
Copy link
Member

👍 @hezhijie0327

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

Copy link

codecov bot commented Jun 30, 2024

Codecov Report

Attention: Patch coverage is 86.55462% with 16 lines in your changes missing coverage. Please review.

Project coverage is 93.38%. Comparing base (a148c3b) to head (a350cd0).
Report is 5 commits behind head on main.

Files Patch % Lines
src/libs/agent-runtime/baichuan/index.ts 71.87% 9 Missing ⚠️
src/app/api/chat/agentRuntime.ts 42.85% 4 Missing ⚠️
src/libs/agent-runtime/AgentRuntime.ts 57.14% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3097      +/-   ##
==========================================
- Coverage   93.43%   93.38%   -0.05%     
==========================================
  Files         382      384       +2     
  Lines       23629    23748     +119     
  Branches     1717     2649     +932     
==========================================
+ Hits        22077    22177     +100     
- Misses       1552     1571      +19     
Flag Coverage Δ
app 93.38% <86.55%> (-0.05%) ⬇️
server 68.19% <77.88%> (+0.14%) ⬆️

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.

@hezhijie0327
Copy link
Contributor Author

hezhijie0327 commented Jun 30, 2024

修复默认 frequency_penalty 范围问题,自动调整,逻辑如下:

a. < 0: 1
b. < 1: 原值 + 1
c. > 2: 2 
d. >= 1 <= 2: 原值
e. undefined: 1

image

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Fix the default frequency_penalty range problem and adjust it automatically. The logic is as follows:

a. < 0: 1
b. < 1: Original value + 1
c. > 2: 2
d. >= 1 <= 2: original value
e. undefined: 1

arvinxx

This comment was marked as outdated.

Copy link

vercel bot commented Jul 1, 2024

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

Name Status Preview Comments Updated (UTC)
lobe-chat-database ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 1, 2024 9:20am

Copy link
Contributor

@arvinxx arvinxx left a comment

Choose a reason for hiding this comment

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

刚测了下有个小问题:

image

报错时候的 Logo 不正确

@hezhijie0327
Copy link
Contributor Author

刚测了下有个小问题:

image 报错时候的 Logo 不正确

欸 我想想... 印象里应该没引入 OpenAI 的图标

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I just tested it and have a small problem:

image The logo when reporting an error is incorrect

Well, let me think about it... I don't think the OpenAI icon was introduced.

@arvinxx
Copy link
Contributor

arvinxx commented Jul 1, 2024

@hezhijie0327 兜底是openai的,要看下是不是provider icon没配正确

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@hezhijie0327 It’s openai, I need to check if the provider icon is not configured correctly.

@hezhijie0327
Copy link
Contributor Author

我看了下 阶跃星辰 也有点问题,我看看智谱的代码
image
image

@arvinxx
Copy link
Contributor

arvinxx commented Jul 1, 2024

@arvinxx
Copy link
Contributor

arvinxx commented Jul 1, 2024

这个我先合了,provider Avatar 这部分代码我来改吧。应该要提出来的

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I'll put this together first, and let me change the provider Avatar code. It should be brought up

@arvinxx arvinxx merged commit 378cf02 into lobehub:main Jul 1, 2024
5 of 7 checks passed
@lobehubbot
Copy link
Member

❤️ Great PR @hezhijie0327 ❤️

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 Jul 1, 2024
## [Version&nbsp;1.2.0](v1.1.18...v1.2.0)
<sup>Released on **2024-07-01**</sup>

#### ✨ Features

- **misc**: Add Baichuan model provider.

<br/>

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

#### What's improved

* **misc**: Add Baichuan model provider, closes [#3097](#3097) ([378cf02](378cf02))

</details>

<div align="right">

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

</div>
@hezhijie0327 hezhijie0327 deleted the baichuan branch July 1, 2024 11:23
github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request Jul 1, 2024
## [Version&nbsp;1.45.0](v1.44.12...v1.45.0)
<sup>Released on **2024-07-01**</sup>

#### ✨ Features

- **misc**: Add Baichuan model provider.

<br/>

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

#### What's improved

* **misc**: Add Baichuan model provider, closes [lobehub#3097](https://github.com/bentwnghk/lobe-chat/issues/3097) ([378cf02](378cf02))

</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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants