Skip to content

Conversation

arvinxx
Copy link
Member

@arvinxx arvinxx commented Sep 10, 2023

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • 💄 style
  • 🔨 chore
  • 📝 docs

🔀 变更说明 | Description of Change

support Azure OpenAI, close #131

refs: #151

📝 补充信息 | Additional Information

#178

关联改造点

结合这次升级,改造了 settings 的数据结构,将 OpenAI 相关的数据收敛到 languageModel 字段下。

interface OpenAIConfig {
  OPENAI_API_KEY: string;
  azureApiVersion?: string;
  endpoint?: string;
  models?: string[];
  useAzure?: boolean;
}

export type GlobalLLMConfig = {
  openAI: OpenAIConfig;
};


export const DEFAULT_LLM_CONFIG: GlobalLLMConfig = {
  openAI: {
    OPENAI_API_KEY: '',
    azureApiVersion: '2023-08-01-preview',
    models: DEFAULT_OPENAI_MODEL_LIST,
  },
};


export const DEFAULT_SETTINGS: GlobalSettings = {
  defaultAgent: DEFAULT_AGENT,
  languageModel: DEFAULT_LLM_CONFIG,
  ...DEFAULT_BASE_SETTINGS,
};

@vercel
Copy link

vercel bot commented Sep 10, 2023

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

Name Status Preview Comments Updated (UTC)
lobe-chat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 10, 2023 2:10pm

@arvinxx arvinxx merged commit f0c9532 into main Sep 10, 2023
@arvinxx arvinxx deleted the feat/azure-openai branch September 10, 2023 14:18
github-actions bot pushed a commit that referenced this pull request Sep 10, 2023
## [Version 0.73.0](v0.72.4...v0.73.0)
<sup>Released on **2023-09-10**</sup>

#### ✨ Features

- **misc**: Support Azure OpenAI.

<br/>

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

#### What's improved

* **misc**: Support Azure OpenAI, closes [#177](#177) ([f0c9532](f0c9532))

</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 0.73.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@libli
Copy link

libli commented Sep 11, 2023

在运行项目时怎么配置环境变量来使用azure?我希望我运行时直接配置好azure api-key & endpoint & api-version,用户直接用就行了。需要配哪些环境变量?

@arvinxx
Copy link
Member Author

arvinxx commented Sep 11, 2023

在运行项目时怎么配置环境变量来使用azure?我希望我运行时直接配置好azure api-key & endpoint & api-version,用户直接用就行了。需要配哪些环境变量?

azure api-key 和 endpoint 用现有的就好, api-version 目前还没有专门的环境变量,另外可能要再加一个开启 Azure API 配置变量。我晚上补一下吧,另外把文档也写一下。

@libli
Copy link

libli commented Sep 11, 2023

明白了,apiversion和model name也直接放在endpoint url里面就行了。直接用现在的两个环境变量就可以了。对吧?

@arvinxx
Copy link
Member Author

arvinxx commented Sep 11, 2023

不对哈,api version会加一个环境变量,我现在默认给了一个值来着。模型名称的话是需要部署名称和模型名称一样才行。这个我晚点写完文档你就知道了

@libli
Copy link

libli commented Sep 11, 2023

等你的文档来测试。另外azure openAI很不错的,国内服务器就可以直接调用,也可以用国内visa开通支付,不会被封号。用起来比openai的爽很多。可以试试。提交申请一两天就会开通。

@arvinxx
Copy link
Member Author

arvinxx commented Sep 11, 2023

等你的文档来测试。另外azure openAI很不错的,国内服务器就可以直接调用,也可以用国内visa开通支付,不会被封号。用起来比openai的爽很多。可以试试。提交申请一两天就会开通。

我自己有申请,而且有 GPT-4 的,但我自己测下来,响应速度比 OpenAI 的慢一些…

@arvinxx
Copy link
Member Author

arvinxx commented Sep 11, 2023

TiagoFer0128 pushed a commit to TiagoFer0128/lobe-chat that referenced this pull request Dec 14, 2023
## [Version&nbsp;0.73.0](lobehub/lobe-chat@v0.72.4...v0.73.0)
<sup>Released on **2023-09-10**</sup>

#### ✨ Features

- **misc**: Support Azure OpenAI.

<br/>

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

#### What's improved

* **misc**: Support Azure OpenAI, closes [#177](lobehub/lobe-chat#177) ([f0c9532](lobehub/lobe-chat@f0c9532))

</details>

<div align="right">

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

</div>
miroshar-success added a commit to miroshar-success/OpenAI_Integraion_platform that referenced this pull request Apr 5, 2024
## [Version&nbsp;0.73.0](lobehub/lobe-chat@v0.72.4...v0.73.0)
<sup>Released on **2023-09-10**</sup>

#### ✨ Features

- **misc**: Support Azure OpenAI.

<br/>

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

#### What's improved

* **misc**: Support Azure OpenAI, closes [#177](lobehub/lobe-chat#177) ([f0c9532](lobehub/lobe-chat@f0c9532))

</details>

<div align="right">

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

</div>
AlfonsW55 added a commit to AlfonsW55/lobe-chat that referenced this pull request May 15, 2024
## [Version&nbsp;0.73.0](lobehub/lobe-chat@v0.72.4...v0.73.0)
<sup>Released on **2023-09-10**</sup>

#### ✨ Features

- **misc**: Support Azure OpenAI.

<br/>

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

#### What's improved

* **misc**: Support Azure OpenAI, closes [#177](lobehub/lobe-chat#177) ([f0c9532](lobehub/lobe-chat@f0c9532))

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

Successfully merging this pull request may close these issues.

[Request] 支持 Azure OpenAI
3 participants