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 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
  <!-- - [📖 &nbsp;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
- bun install
101
+ npm install
100
102
 
101
103
  # Generate type stubs
102
- bun dev:prepare
104
+ npm run dev:prepare
103
105
 
104
106
  # Develop with the playground
105
- bun dev
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
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.12"
6
6
  },
7
- "version": "1.0.4",
7
+ "version": "1.0.6",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.1",
10
10
  "unbuild": "2.0.0"
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
- export { useOllama } from '../useOllama.js';
1
+ import { Ollama } from 'ollama/browser';
2
+ export declare function useOllama(): Ollama;
@@ -1 +1,9 @@
1
- export { useOllama } from "../useOllama.js";
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
- export { useOllama } from '../../useOllama.js';
1
+ import { Ollama } from 'ollama';
2
+ export declare function useOllama(): Ollama;
@@ -1 +1,9 @@
1
- export { useOllama } from "../../useOllama.js";
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,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-ollama",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Easy ollama integration for Nuxt",
5
5
  "repository": "jericho1060/nuxt-ollama",
6
6
  "license": "MIT",
@@ -1,2 +0,0 @@
1
- import { Ollama } from 'ollama';
2
- export declare function useOllama(): Ollama;
@@ -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
- }