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

Refactor Azure OpenAI Implementation #4619

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

BrandonStudio
Copy link
Contributor

@BrandonStudio BrandonStudio commented Nov 6, 2024

💻 变更类型 | Change Type

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

🔀 变更说明 | Description of Change

  • Migrate from @azure/openai to openai
  • Rename apikey to apiKey
  • Refactor o1model check from o1Models.has to isO1Model
  • Add generic type for OpenAI.transformResponseToStream

📝 补充信息 | Additional Information

Note that on non-database deployment, sending large image results in 431 Request Header Fields Too Large
Same issue happens in GitHub provider

refs:

TODOs:

  • Add Embedding
  • Refactor GitHub to Azure

Rename apikey to apiKey
Refactor o1model check
Add generic type for OpenAI.transformResponseToStream
Copy link

vercel bot commented Nov 6, 2024

@BrandonStudio is attempting to deploy a commit to the LobeChat Community Team on Vercel.

A member of the Team first needs to authorize it.

@lobehubbot
Copy link
Member

👍 @BrandonStudio

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 Nov 6, 2024

Codecov Report

Attention: Patch coverage is 97.74436% with 3 lines in your changes missing coverage. Please review.

Project coverage is 92.52%. Comparing base (87ac46d) to head (8a27fbe).
Report is 24 commits behind head on main.

Files with missing lines Patch % Lines
src/libs/agent-runtime/azureOpenai/index.ts 96.87% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4619      +/-   ##
==========================================
+ Coverage   92.43%   92.52%   +0.09%     
==========================================
  Files         509      512       +3     
  Lines       36602    36820     +218     
  Branches     2229     3401    +1172     
==========================================
+ Hits        33832    34069     +237     
+ Misses       2770     2751      -19     
Flag Coverage Δ
app 92.52% <97.74%> (+0.09%) ⬆️
server 97.34% <ø> (ø)

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.

@BrandonStudio BrandonStudio marked this pull request as ready for review November 7, 2024 03:51
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. azure labels Nov 7, 2024
@BrandonStudio
Copy link
Contributor Author

BrandonStudio commented Nov 7, 2024

I'm not going to complete TODOs for now. I'd rather wait for refactor of LobeOpenAICompatibleAI, which will be another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azure size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants