mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-03-28 03:29:25 +01:00
fix(easy-setup): fix warning/block for easy setup managing of models
This commit is contained in:
parent
d2cc846562
commit
0a6431675a
|
|
@ -1,6 +1,7 @@
|
|||
import { SystemService } from '#services/system_service'
|
||||
import { ZimService } from '#services/zim_service'
|
||||
import { CollectionManifestService } from '#services/collection_manifest_service'
|
||||
import KVStore from '#models/kv_store'
|
||||
import { inject } from '@adonisjs/core'
|
||||
import type { HttpContext } from '@adonisjs/core/http'
|
||||
|
||||
|
|
@ -12,10 +13,14 @@ export default class EasySetupController {
|
|||
) {}
|
||||
|
||||
async index({ inertia }: HttpContext) {
|
||||
const services = await this.systemService.getServices({ installedOnly: false })
|
||||
const [services, remoteOllamaUrl] = await Promise.all([
|
||||
this.systemService.getServices({ installedOnly: false }),
|
||||
KVStore.getValue('ai.remoteOllamaUrl'),
|
||||
])
|
||||
return inertia.render('easy-setup/index', {
|
||||
system: {
|
||||
services: services,
|
||||
remoteOllamaUrl: remoteOllamaUrl ?? '',
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,7 +112,9 @@ const CURATED_MAP_COLLECTIONS_KEY = 'curated-map-collections'
|
|||
const CURATED_CATEGORIES_KEY = 'curated-categories'
|
||||
const WIKIPEDIA_STATE_KEY = 'wikipedia-state'
|
||||
|
||||
export default function EasySetupWizard(props: { system: { services: ServiceSlim[] } }) {
|
||||
export default function EasySetupWizard(props: {
|
||||
system: { services: ServiceSlim[]; remoteOllamaUrl: string }
|
||||
}) {
|
||||
const { aiAssistantName } = usePage<{ aiAssistantName: string }>().props
|
||||
const CORE_CAPABILITIES = buildCoreCapabilities(aiAssistantName)
|
||||
|
||||
|
|
@ -122,8 +124,10 @@ export default function EasySetupWizard(props: { system: { services: ServiceSlim
|
|||
const [selectedAiModels, setSelectedAiModels] = useState<string[]>([])
|
||||
const [isProcessing, setIsProcessing] = useState(false)
|
||||
const [showAdditionalTools, setShowAdditionalTools] = useState(false)
|
||||
const [remoteOllamaEnabled, setRemoteOllamaEnabled] = useState(false)
|
||||
const [remoteOllamaUrl, setRemoteOllamaUrl] = useState('')
|
||||
const [remoteOllamaEnabled, setRemoteOllamaEnabled] = useState(
|
||||
() => !!props.system.remoteOllamaUrl
|
||||
)
|
||||
const [remoteOllamaUrl, setRemoteOllamaUrl] = useState(() => props.system.remoteOllamaUrl ?? '')
|
||||
const [remoteOllamaUrlError, setRemoteOllamaUrlError] = useState<string | null>(null)
|
||||
|
||||
// Category/tier selection state
|
||||
|
|
@ -843,7 +847,7 @@ export default function EasySetupWizard(props: { system: { services: ServiceSlim
|
|||
{remoteOllamaEnabled && remoteOllamaUrl ? (
|
||||
<Alert
|
||||
title="Remote Ollama selected"
|
||||
message="Models are managed on the remote machine. You can add models from Settings > AI Assistant after setup."
|
||||
message="Models are managed on the remote machine. You can add models from Settings > AI Assistant after setup, note this is only supported when using Ollama, not LM Studio and other OpenAI API software."
|
||||
type="info"
|
||||
variant="bordered"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -377,7 +377,7 @@ export default function ModelsPage(props: {
|
|||
|
||||
<StyledSectionHeader title="Models" className="mt-12 mb-4" />
|
||||
<p className="text-sm text-desert-stone mb-4">
|
||||
Model downloading is only supported when using a local Ollama backend. If you are connected to a remote AI host (e.g. LM Studio), download models directly in that application.
|
||||
Model downloading is only supported when using an Ollama backend. If you are connected to an OpenAI API host (e.g. LM Studio), you will need to download models directly in that application.
|
||||
</p>
|
||||
<div className="flex justify-start items-center gap-3 mt-4">
|
||||
<Input
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user