feat(core): flatten provider config and load native packages (#35563)
Co-authored-by: Dax Raad <d@ironbay.co>
This commit is contained in:
parent
d603eed5a1
commit
e57d9ca390
107 changed files with 2593 additions and 1984 deletions
|
|
@ -272,7 +272,7 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
|
|||
return {
|
||||
provider: provider?.name ?? value.providerID,
|
||||
model: info?.name ?? value.modelID,
|
||||
reasoning: info?.variants.length !== 0,
|
||||
reasoning: (info?.variants?.length ?? 0) !== 0,
|
||||
}
|
||||
}),
|
||||
cycle(direction: 1 | -1) {
|
||||
|
|
@ -373,12 +373,7 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
|
|||
const v = this.selected()
|
||||
if (!v) return undefined
|
||||
if (v !== "default" && this.list().includes(v)) return v
|
||||
const m = currentModel()!
|
||||
return (
|
||||
data.location.model
|
||||
.list()
|
||||
?.find((item) => item.providerID === m.providerID && item.id === m.modelID)?.request.variant ?? "default"
|
||||
)
|
||||
return "default"
|
||||
},
|
||||
list() {
|
||||
const m = currentModel()
|
||||
|
|
@ -386,7 +381,7 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
|
|||
const info = data.location.model
|
||||
.list()
|
||||
?.find((item) => item.providerID === m.providerID && item.id === m.modelID)
|
||||
return info?.variants.map((variant) => variant.id) ?? []
|
||||
return info?.variants?.map((variant) => variant.id) ?? []
|
||||
},
|
||||
set(value: string | undefined) {
|
||||
const m = currentModel()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue