Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/thoda-dev/nuxt-ollama. Simple integration of the official Ollama JavaScript Library for your Nuxt application.
Something went wrong. Try again.
377 B · 14 lines
TypeScript
at master
123456789101112131415import { Ollama } from 'ollama/browser'import { useRequestURL } from '#imports'
export function useOllama() { const { origin } = useRequestURL()
return new Ollama({ host: origin, fetch: (input: RequestInfo | URL, init?: RequestInit) => { const url = new URL(input.toString()) return fetch(`${origin}/api/__ollama${url.pathname}`, init) }, })}