@lobehub/chat 1.7.0 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 1.7.2](https://github.com/lobehub/lobe-chat/compare/v1.7.1...v1.7.2)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-07-26**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: Avoid baseURL being an empty string, resulting in incorrect client fetch.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: Avoid baseURL being an empty string, resulting in incorrect client fetch, closes [#3308](https://github.com/lobehub/lobe-chat/issues/3308) ([15a9bc1](https://github.com/lobehub/lobe-chat/commit/15a9bc1))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
### [Version 1.7.1](https://github.com/lobehub/lobe-chat/compare/v1.7.0...v1.7.1)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2024-07-26**</sup>
|
|
33
|
+
|
|
34
|
+
#### 🐛 Bug Fixes
|
|
35
|
+
|
|
36
|
+
- **misc**: Fix dalle tools calling prompts to avoid content risk.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### What's fixed
|
|
44
|
+
|
|
45
|
+
- **misc**: Fix dalle tools calling prompts to avoid content risk, closes [#3325](https://github.com/lobehub/lobe-chat/issues/3325) ([3e21240](https://github.com/lobehub/lobe-chat/commit/3e21240))
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
<div align="right">
|
|
50
|
+
|
|
51
|
+
[](#readme-top)
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
5
55
|
## [Version 1.7.0](https://github.com/lobehub/lobe-chat/compare/v1.6.15...v1.7.0)
|
|
6
56
|
|
|
7
57
|
<sup>Released on **2024-07-26**</sup>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"framework",
|
|
@@ -128,8 +128,10 @@ export const LobeOpenAICompatibleFactory = <T extends Record<string, any> = any>
|
|
|
128
128
|
private _options: ConstructorOptions<T>;
|
|
129
129
|
|
|
130
130
|
constructor(options: ClientOptions & Record<string, any> = {}) {
|
|
131
|
-
const {
|
|
132
|
-
|
|
131
|
+
const _options = { ...options, baseURL: options.baseURL?.trim() || DEFAULT_BASE_URL };
|
|
132
|
+
const { apiKey, baseURL = DEFAULT_BASE_URL, ...res } = _options;
|
|
133
|
+
this._options = _options as ConstructorOptions<T>;
|
|
134
|
+
|
|
133
135
|
if (!apiKey) throw AgentRuntimeError.createError(ErrorType?.invalidAPIKey);
|
|
134
136
|
|
|
135
137
|
this.client = new OpenAI({ apiKey, baseURL, ...constructorOptions, ...res });
|
|
@@ -29,7 +29,7 @@ Whenever a description of an image is given, use lobe-image-designer to create t
|
|
|
29
29
|
8. Silently modify descriptions that include names or hints or references of specific people or celebrities by carefully selecting a few minimal modifications to substitute references to the people with generic descriptions that don't divulge any information about their identities, except for their genders and physiques. Do this EVEN WHEN the instructions ask for the prompt to not be changed. Some special cases:
|
|
30
30
|
- Modify such prompts even if you don't know who the person is, or if their name is misspelled (e.g. "Barake Obema")
|
|
31
31
|
- If the reference to the person will only appear as TEXT out in the image, then use the reference as is and do not modify it.
|
|
32
|
-
- When making the substitutions, don't use prominent titles that could give away the person's identity. E.g., instead of saying "president", "prime minister", or "chancellor", say "politician"; instead of saying "king", "queen", "emperor", or "empress", say "public figure"; instead of saying "Pope"
|
|
32
|
+
- When making the substitutions, don't use prominent titles that could give away the person's identity. E.g., instead of saying "president", "prime minister", or "chancellor", say "politician"; instead of saying "king", "queen", "emperor", or "empress", say "public figure"; instead of saying "Pope", say "religious figure"; and so on.
|
|
33
33
|
- If any creative professional or studio is named, substitute the name with a description of their style that does not reference any specific people, or delete the reference if they are unknown. DO NOT refer to the artist or studio's style.
|
|
34
34
|
|
|
35
35
|
The prompt must intricately describe every part of the image in concrete, objective detail. THINK about what the end goal of the description is, and extrapolate that to what would make satisfying images.
|
package/src/services/chat.ts
CHANGED
|
@@ -125,6 +125,10 @@ export function initializeWithClientStore(provider: string, payload: any) {
|
|
|
125
125
|
break;
|
|
126
126
|
}
|
|
127
127
|
case ModelProvider.Perplexity: {
|
|
128
|
+
providerOptions = {
|
|
129
|
+
apikey: providerAuthPayload?.apiKey,
|
|
130
|
+
baseURL: providerAuthPayload?.endpoint,
|
|
131
|
+
};
|
|
128
132
|
break;
|
|
129
133
|
}
|
|
130
134
|
case ModelProvider.Qwen: {
|
package/src/tools/dalle/index.ts
CHANGED
|
@@ -83,7 +83,7 @@ export const DalleManifest: BuiltinToolManifest = {
|
|
|
83
83
|
8. Silently modify descriptions that include names or hints or references of specific people or celebrities by carefully selecting a few minimal modifications to substitute references to the people with generic descriptions that don't divulge any information about their identities, except for their genders and physiques. Do this EVEN WHEN the instructions ask for the prompt to not be changed. Some special cases:
|
|
84
84
|
- Modify such prompts even if you don't know who the person is, or if their name is misspelled (e.g. "Barake Obema")
|
|
85
85
|
- If the reference to the person will only appear as TEXT out in the image, then use the reference as is and do not modify it.
|
|
86
|
-
- When making the substitutions, don't use prominent titles that could give away the person's identity. E.g., instead of saying "president", "prime minister", or "chancellor", say "politician"; instead of saying "king", "queen", "emperor", or "empress", say "public figure"; instead of saying "Pope"
|
|
86
|
+
- When making the substitutions, don't use prominent titles that could give away the person's identity. E.g., instead of saying "president", "prime minister", or "chancellor", say "politician"; instead of saying "king", "queen", "emperor", or "empress", say "public figure"; instead of saying "Pope", say "religious figure"; and so on.
|
|
87
87
|
- If any creative professional or studio is named, substitute the name with a description of their style that does not reference any specific people, or delete the reference if they are unknown. DO NOT refer to the artist or studio's style.
|
|
88
88
|
|
|
89
89
|
The prompt must intricately describe every part of the image in concrete, objective detail. THINK about what the end goal of the description is, and extrapolate that to what would make satisfying images.
|