Skip to content

Commit

Permalink
fix browser side
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho1060 committed Aug 6, 2024
1 parent ce4692e commit bc3d5ac
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
12 changes: 11 additions & 1 deletion src/runtime/composables/useOllama.ts
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
export { useOllama } from '../useOllama'
import { Ollama } from 'ollama/browser'
import type { ModuleOptions } from '../../module'
import { useRuntimeConfig } from '#imports'

export function useOllama() {
const options: ModuleOptions = useRuntimeConfig().public.ollama as ModuleOptions
return new Ollama({
host: `${options.protocol}://${options.host}:${options.port}`,
proxy: options.proxy,
})
}
12 changes: 11 additions & 1 deletion src/runtime/server/utils/useOllama.ts
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
export { useOllama } from '../../useOllama'
import { Ollama } from 'ollama'
import type { ModuleOptions } from '../../../module'
import { useRuntimeConfig } from '#imports'

export function useOllama() {
const options: ModuleOptions = useRuntimeConfig().public.ollama as ModuleOptions
return new Ollama({
host: `${options.protocol}://${options.host}:${options.port}`,
proxy: options.proxy,
})
}
11 changes: 0 additions & 11 deletions src/runtime/useOllama.ts

This file was deleted.

0 comments on commit bc3d5ac

Please sign in to comment.