@electerm/electerm-react 3.15.86 → 3.15.90
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/client/components/ai/agent.js +2 -1
- package/client/components/ai/ai-config-modal.jsx +1 -0
- package/client/components/ai/ai-config-props.js +1 -0
- package/client/components/ai/ai-config.jsx +23 -1
- package/client/components/bookmark-form/ai-bookmark-form.jsx +2 -1
- package/client/components/terminal/terminal-command-dropdown.jsx +3 -1
- package/package.json +1 -1
|
@@ -35,6 +35,14 @@ const proxyOptions = [
|
|
|
35
35
|
{ value: 'https://proxy.example.com:3128' }
|
|
36
36
|
]
|
|
37
37
|
|
|
38
|
+
const authHeaderOptions = [
|
|
39
|
+
{ value: 'Authorization: Bearer' },
|
|
40
|
+
{ value: 'x-api-key' },
|
|
41
|
+
{ value: 'api-key' },
|
|
42
|
+
{ value: 'Authorization: Api-Key' },
|
|
43
|
+
{ value: 'Authorization' }
|
|
44
|
+
]
|
|
45
|
+
|
|
38
46
|
export default function AIConfigForm ({ initialValues, onSubmit, showAIConfig }) {
|
|
39
47
|
const [form] = Form.useForm()
|
|
40
48
|
const [testing, setTesting] = useState(false)
|
|
@@ -68,7 +76,8 @@ export default function AIConfigForm ({ initialValues, onSubmit, showAIConfig })
|
|
|
68
76
|
values.apiPathAI,
|
|
69
77
|
values.apiKeyAI,
|
|
70
78
|
values.proxyAI,
|
|
71
|
-
false
|
|
79
|
+
false,
|
|
80
|
+
values.authHeaderNameAI
|
|
72
81
|
)
|
|
73
82
|
if (res && res.error) {
|
|
74
83
|
message.error(res.error)
|
|
@@ -190,6 +199,19 @@ export default function AIConfigForm ({ initialValues, onSubmit, showAIConfig })
|
|
|
190
199
|
<Password placeholder='Enter your API key' />
|
|
191
200
|
</Form.Item>
|
|
192
201
|
|
|
202
|
+
<Form.Item
|
|
203
|
+
label='Auth Header'
|
|
204
|
+
name='authHeaderNameAI'
|
|
205
|
+
tooltip='Header format for API authentication. e.g. "Authorization: Bearer" sends "Authorization: Bearer <key>", "x-api-key" sends "x-api-key: <key>"'
|
|
206
|
+
>
|
|
207
|
+
<AutoComplete
|
|
208
|
+
options={authHeaderOptions}
|
|
209
|
+
filterOption={filter}
|
|
210
|
+
>
|
|
211
|
+
<Input placeholder='e.g. Authorization: Bearer' />
|
|
212
|
+
</AutoComplete>
|
|
213
|
+
</Form.Item>
|
|
214
|
+
|
|
193
215
|
<Form.Item
|
|
194
216
|
label={e('roleAI')}
|
|
195
217
|
name='roleAI'
|
|
@@ -82,7 +82,8 @@ export default function AIBookmarkForm (props) {
|
|
|
82
82
|
config.apiPathAI,
|
|
83
83
|
config.apiKeyAI,
|
|
84
84
|
config.proxyAI,
|
|
85
|
-
false // Disable streaming for structured response
|
|
85
|
+
false, // Disable streaming for structured response
|
|
86
|
+
config.authHeaderNameAI
|
|
86
87
|
)
|
|
87
88
|
|
|
88
89
|
if (aiResponse && aiResponse.error) {
|