@sisu-ai/adapter-ollama 1.0.0 → 2.0.0
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 +8 -0
- package/dist/index.js +2 -1
- package/package.json +11 -2
package/README.md
CHANGED
|
@@ -3,9 +3,16 @@
|
|
|
3
3
|
Ollama Chat adapter with native tools support.
|
|
4
4
|
|
|
5
5
|
## Setup
|
|
6
|
+
```bash
|
|
7
|
+
npm i @sisu-ai/adapter-ollama
|
|
8
|
+
```
|
|
9
|
+
|
|
6
10
|
- Start Ollama locally: `ollama serve`
|
|
7
11
|
- Pull a tools-capable model: `ollama pull llama3.1:latest`
|
|
8
12
|
|
|
13
|
+
## Documentation
|
|
14
|
+
Discover what you can do through examples or documentation. Check it out at https://github.com/finger-gun/sisu
|
|
15
|
+
|
|
9
16
|
## Usage
|
|
10
17
|
```ts
|
|
11
18
|
import { ollamaAdapter } from '@sisu-ai/adapter-ollama';
|
|
@@ -24,3 +31,4 @@ const model = ollamaAdapter({ model: 'llama3.1' });
|
|
|
24
31
|
## Notes
|
|
25
32
|
- Tool choice forcing is model-dependent; current loop asks for tools on first turn and plain completion on second.
|
|
26
33
|
- Streaming can be added via Ollama's streaming API if desired.
|
|
34
|
+
- Env: `OLLAMA_BASE_URL` or `BASE_URL` can override the base URL (or pass `baseUrl` in code). Examples may also support a CLI flag `--base-url` to override env.
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { firstConfigValue } from '@sisu-ai/core';
|
|
1
2
|
export function ollamaAdapter(opts) {
|
|
2
|
-
const envBase =
|
|
3
|
+
const envBase = firstConfigValue(['OLLAMA_BASE_URL', 'BASE_URL']);
|
|
3
4
|
const baseUrl = (opts.baseUrl ?? envBase ?? 'http://localhost:11434').replace(/\/$/, '');
|
|
4
5
|
const modelName = `ollama:${opts.model}`;
|
|
5
6
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sisu-ai/adapter-ollama",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,10 +10,19 @@
|
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/finger-gun/sisu",
|
|
16
|
+
"directory": "packages/adapters/ollama"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/finger-gun/sisu#readme",
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/finger-gun/sisu/issues"
|
|
21
|
+
},
|
|
13
22
|
"scripts": {
|
|
14
23
|
"build": "tsc -b"
|
|
15
24
|
},
|
|
16
25
|
"peerDependencies": {
|
|
17
|
-
"@sisu-ai/core": "0.
|
|
26
|
+
"@sisu-ai/core": "0.3.0"
|
|
18
27
|
}
|
|
19
28
|
}
|