nuxt-ollama 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -16
- package/dist/module.json +1 -1
- package/dist/module.mjs +5 -0
- package/dist/runtime/composables/useOllama.d.ts +2 -1
- package/dist/runtime/composables/useOllama.js +9 -1
- package/dist/runtime/server/utils/useOllama.d.ts +2 -1
- package/dist/runtime/server/utils/useOllama.js +9 -1
- package/package.json +1 -1
- package/dist/runtime/useOllama.d.ts +0 -2
- package/dist/runtime/useOllama.js +0 -9
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@ You have to install Ollama to use this module. See [Official Website](https://ol
|
|
|
13
13
|
|
|
14
14
|
- [🏀 Online playground](https://stackblitz.com/github/jericho1060/nuxt-ollama?file=playground%2Fapp.vue)
|
|
15
15
|
<!-- - [📖 Documentation](https://example.com) -->
|
|
16
|
+
|
|
16
17
|
## Quick Setup
|
|
17
18
|
|
|
18
19
|
Install the module to your Nuxt application with one command:
|
|
@@ -76,6 +77,7 @@ See official [Ollama JavaScript Library documentation](https://github.com/ollama
|
|
|
76
77
|
```ts
|
|
77
78
|
// nuxt.config.ts
|
|
78
79
|
export default defineNuxtConfig({
|
|
80
|
+
//...
|
|
79
81
|
ollama: {
|
|
80
82
|
protocol: 'http', // or 'https'
|
|
81
83
|
host: 'localhost', //domain or ip address
|
|
@@ -96,26 +98,13 @@ Contributions are welcome, feel free to open an issue or submit a pull request!
|
|
|
96
98
|
|
|
97
99
|
```bash
|
|
98
100
|
# Install dependencies
|
|
99
|
-
|
|
101
|
+
npm install
|
|
100
102
|
|
|
101
103
|
# Generate type stubs
|
|
102
|
-
|
|
104
|
+
npm run dev:prepare
|
|
103
105
|
|
|
104
106
|
# Develop with the playground
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
# Build the playground
|
|
108
|
-
bun dev:build
|
|
109
|
-
|
|
110
|
-
# Run ESLint
|
|
111
|
-
bun lint
|
|
112
|
-
|
|
113
|
-
# Run Vitest
|
|
114
|
-
bun test
|
|
115
|
-
bun test:watch
|
|
116
|
-
|
|
117
|
-
# Release new version
|
|
118
|
-
bun release
|
|
107
|
+
npm run dev
|
|
119
108
|
```
|
|
120
109
|
|
|
121
110
|
</details>
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -26,6 +26,11 @@ const module = defineNuxtModule({
|
|
|
26
26
|
as: "useOllama",
|
|
27
27
|
from: resolver.resolve("./runtime/composables/useOllama")
|
|
28
28
|
});
|
|
29
|
+
addImports({
|
|
30
|
+
name: "useOllamaUtils",
|
|
31
|
+
as: "useOllamaUtils",
|
|
32
|
+
from: resolver.resolve("./runtime/composables/useOllamaUtils")
|
|
33
|
+
});
|
|
29
34
|
addServerImportsDir(resolver.resolve("./runtime/server/utils"));
|
|
30
35
|
}
|
|
31
36
|
});
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { Ollama } from 'ollama/browser';
|
|
2
|
+
export declare function useOllama(): Ollama;
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { Ollama } from "ollama/browser";
|
|
2
|
+
import { useRuntimeConfig } from "#imports";
|
|
3
|
+
export function useOllama() {
|
|
4
|
+
const options = useRuntimeConfig().public.ollama;
|
|
5
|
+
return new Ollama({
|
|
6
|
+
host: `${options.protocol}://${options.host}:${options.port}`,
|
|
7
|
+
proxy: options.proxy
|
|
8
|
+
});
|
|
9
|
+
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { Ollama } from 'ollama';
|
|
2
|
+
export declare function useOllama(): Ollama;
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { Ollama } from "ollama";
|
|
2
|
+
import { useRuntimeConfig } from "#imports";
|
|
3
|
+
export function useOllama() {
|
|
4
|
+
const options = useRuntimeConfig().public.ollama;
|
|
5
|
+
return new Ollama({
|
|
6
|
+
host: `${options.protocol}://${options.host}:${options.port}`,
|
|
7
|
+
proxy: options.proxy
|
|
8
|
+
});
|
|
9
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Ollama } from "ollama";
|
|
2
|
-
import { useRuntimeConfig } from "#imports";
|
|
3
|
-
export function useOllama() {
|
|
4
|
-
const options = useRuntimeConfig().public.ollama;
|
|
5
|
-
return new Ollama({
|
|
6
|
-
host: `${options.protocol}://${options.host}:${options.port}`,
|
|
7
|
-
proxy: options.proxy
|
|
8
|
-
});
|
|
9
|
-
}
|