|
@@ -7,10 +7,12 @@
|
|
|
* a key is entered; a blank key materializes a reference-free profile for
|
|
* a key is entered; a blank key materializes a reference-free profile for
|
|
|
* provider-native authentication);
|
|
* provider-native authentication);
|
|
|
* the collapsed 自定义设置 area carries the per-family extras (`baseURL` for
|
|
* the collapsed 自定义设置 area carries the per-family extras (`baseURL` for
|
|
|
- * both families, `reasoningEffort` for deepseek / `reasoning` for pi-ai —
|
|
|
|
|
- * withheld for a hand-declared route, whose models have no reasoning
|
|
|
|
|
- * capability to configure — and DeepSeek's id/name/context-window model
|
|
|
|
|
- * catalog). Everything else stays
|
|
|
|
|
|
|
+ * both families and DeepSeek's id/name/context-window model catalog).
|
|
|
|
|
+ * Reasoning effort is deliberately absent: it is a per-MODEL capability, and
|
|
|
|
|
+ * the models under one provider disagree about it, so a provider-scoped
|
|
|
|
|
+ * control can only be set to a value some of them reject. The composer's
|
|
|
|
|
+ * model picker offers each model its own levels; `settings.yaml` keeps the
|
|
|
|
|
+ * profile field for a deployment that knows its route. Everything else stays
|
|
|
* owned by `settings.yaml`. Profile edits land as minimal `settings.mutate`
|
|
* owned by `settings.yaml`. Profile edits land as minimal `settings.mutate`
|
|
|
* path ops against the stored section — the card reads the redacted
|
|
* path ops against the stored section — the card reads the redacted
|
|
|
* descriptor, so it names only the fields it can see and a stored literal
|
|
* descriptor, so it names only the fields it can see and a stored literal
|
|
@@ -29,14 +31,12 @@ import {
|
|
|
import { apiKeyFailure } from './apiKey.ts'
|
|
import { apiKeyFailure } from './apiKey.ts'
|
|
|
import { EditorFooter } from './EditorFooter.tsx'
|
|
import { EditorFooter } from './EditorFooter.tsx'
|
|
|
import { ModelListEditor } from './ModelListEditor.tsx'
|
|
import { ModelListEditor } from './ModelListEditor.tsx'
|
|
|
-import { EFFORT_FIELD, ReasoningEffortField } from './ReasoningEffortField.tsx'
|
|
|
|
|
-import type { EffortFamily } from './ReasoningEffortField.tsx'
|
|
|
|
|
import { deriveKeyRef, messageOf } from './store.ts'
|
|
import { deriveKeyRef, messageOf } from './store.ts'
|
|
|
import type { en } from './locales.ts'
|
|
import type { en } from './locales.ts'
|
|
|
import styles from './ModelsSection.module.css'
|
|
import styles from './ModelsSection.module.css'
|
|
|
|
|
|
|
|
/** Per-adapter-family curated field sets (unknown namespaces get the hint alone). */
|
|
/** Per-adapter-family curated field sets (unknown namespaces get the hint alone). */
|
|
|
-type EditorLayout = EffortFamily | 'unknown'
|
|
|
|
|
|
|
+type EditorLayout = 'deepseek' | 'pi-ai' | 'unknown'
|
|
|
|
|
|
|
|
/** The public DeepSeek endpoint shown as the deepseek base-URL placeholder. */
|
|
/** The public DeepSeek endpoint shown as the deepseek base-URL placeholder. */
|
|
|
const DEEPSEEK_PUBLIC_BASE_URL = 'https://api.deepseek.com'
|
|
const DEEPSEEK_PUBLIC_BASE_URL = 'https://api.deepseek.com'
|
|
@@ -57,13 +57,6 @@ export interface ProviderEditorProps {
|
|
|
api: Pick<IApiClient, 'settings' | 'credentials' | 'llm'>
|
|
api: Pick<IApiClient, 'settings' | 'credentials' | 'llm'>
|
|
|
/** Section copy. */
|
|
/** Section copy. */
|
|
|
t: (key: keyof typeof en) => string
|
|
t: (key: keyof typeof en) => string
|
|
|
- /**
|
|
|
|
|
- * Whether the owning adapter knows this route only because configuration
|
|
|
|
|
- * declared it. Such a route's models carry no reasoning capability, so the
|
|
|
|
|
- * effort control is withheld; absent means the adapter draws no such
|
|
|
|
|
- * distinction and the control shows.
|
|
|
|
|
- */
|
|
|
|
|
- declared?: boolean
|
|
|
|
|
/** Disable writes (read-only settings provider). */
|
|
/** Disable writes (read-only settings provider). */
|
|
|
readOnly: boolean
|
|
readOnly: boolean
|
|
|
/** Close the editor; `changed` reports whether an Apply committed. */
|
|
/** Close the editor; `changed` reports whether an Apply committed. */
|
|
@@ -303,8 +296,7 @@ export function ProviderEditor(props: ProviderEditorProps): ReactNode {
|
|
|
* family as a parameter is what makes `EFFORT_FIELD` total here: an
|
|
* family as a parameter is what makes `EFFORT_FIELD` total here: an
|
|
|
* unknown namespace never reaches this body.
|
|
* unknown namespace never reaches this body.
|
|
|
*/
|
|
*/
|
|
|
- const curatedFields = (family: EffortFamily): ReactNode => {
|
|
|
|
|
- const effortField = EFFORT_FIELD[family]
|
|
|
|
|
|
|
+ const curatedFields = (family: 'deepseek' | 'pi-ai'): ReactNode => {
|
|
|
const customModels = getPath(draft, ['models'])
|
|
const customModels = getPath(draft, ['models'])
|
|
|
const modelsOverridden = hasPath(draft, ['models'])
|
|
const modelsOverridden = hasPath(draft, ['models'])
|
|
|
const models = modelDrafts(modelsOverridden ? customModels : inheritedModels())
|
|
const models = modelDrafts(modelsOverridden ? customModels : inheritedModels())
|
|
@@ -361,21 +353,6 @@ export function ProviderEditor(props: ProviderEditorProps): ReactNode {
|
|
|
}}
|
|
}}
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
- {/* A hand-declared route's models carry no reasoning capability
|
|
|
|
|
- (pi-ai's installed catalog is what supplies one, and it has
|
|
|
|
|
- nothing under such a route), so a profile effort would make
|
|
|
|
|
- `resolveModel` throw for every model on it and drop the whole
|
|
|
|
|
- provider out of the picker. Offering the control at all would
|
|
|
|
|
- be offering a way to break the route. */}
|
|
|
|
|
- {props.declared === true ? null : (
|
|
|
|
|
- <ReasoningEffortField
|
|
|
|
|
- family={family}
|
|
|
|
|
- value={stringAt(draft, effortField) ?? ''}
|
|
|
|
|
- onChange={(effort) => { setField(effortField, effort) }}
|
|
|
|
|
- t={t}
|
|
|
|
|
- disabled={disabled}
|
|
|
|
|
- />
|
|
|
|
|
- )}
|
|
|
|
|
{/* Both families edit the same rows through the same contract; only
|
|
{/* Both families edit the same rows through the same contract; only
|
|
|
the extras differ — DeepSeek's inherited capacities, pi-ai's
|
|
the extras differ — DeepSeek's inherited capacities, pi-ai's
|
|
|
endpoint interrogation. */}
|
|
endpoint interrogation. */}
|