llmist 1.2.0 → 1.3.1
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 +12 -75
- package/dist/{chunk-KORMY3CD.js → chunk-RZTAKIDE.js} +605 -4
- package/dist/chunk-RZTAKIDE.js.map +1 -0
- package/dist/{chunk-LELPPETT.js → chunk-TFIKR2RK.js} +459 -3
- package/dist/chunk-TFIKR2RK.js.map +1 -0
- package/dist/cli.cjs +628 -23
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +49 -22
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +769 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +354 -32
- package/dist/index.d.ts +354 -32
- package/dist/index.js +177 -2
- package/dist/index.js.map +1 -1
- package/dist/{mock-stream-DKF5yatf.d.cts → mock-stream-DNt-HBTn.d.cts} +525 -79
- package/dist/{mock-stream-DKF5yatf.d.ts → mock-stream-DNt-HBTn.d.ts} +525 -79
- package/dist/testing/index.cjs +1063 -4
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +437 -3
- package/dist/testing/index.d.ts +437 -3
- package/dist/testing/index.js +54 -4
- package/package.json +1 -1
- package/dist/chunk-KORMY3CD.js.map +0 -1
- package/dist/chunk-LELPPETT.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# llmist
|
|
2
2
|
|
|
3
3
|
[](https://github.com/zbigniewsobiecki/llmist/actions/workflows/ci.yml)
|
|
4
|
-
[](https://codecov.io/gh/zbigniewsobiecki/llmist)
|
|
4
|
+
[](https://codecov.io/gh/zbigniewsobiecki/llmist)
|
|
5
5
|
[](https://www.npmjs.com/package/llmist)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
|
|
8
|
-
> **Universal TypeScript LLM client with streaming-first tool execution and simple, extensible agent framework**
|
|
8
|
+
> **Universal TypeScript LLM client with own function calling grammar, streaming-first tool execution and simple, extensible agent framework**
|
|
9
9
|
|
|
10
10
|
> **⚠️ EARLY WORK IN PROGRESS** - This library is under active development. APIs may change without notice. Use in production at your own risk.
|
|
11
11
|
|
|
@@ -15,12 +15,13 @@ llmist is an asynchonous, streaming-first, provider-agnostic LLM client that mak
|
|
|
15
15
|
|
|
16
16
|
## 🎯 Why llmist?
|
|
17
17
|
|
|
18
|
-
- **🌍 Universal** - Works with any LLM provider (OpenAI, Anthropic, Gemini, custom)
|
|
19
|
-
- **📝 No Structured Outputs** -
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
18
|
+
- **🌍 Universal** - Works with [any LLM provider](./docs/PROVIDERS.md) (OpenAI, Anthropic, Gemini, [custom](./docs/CUSTOM_MODELS.md)) and easy to integrate more
|
|
19
|
+
- **📝 No Structured Outputs** - Simple [block format](./docs/BLOCK_FORMAT.md) with streaming oriented tool calling
|
|
20
|
+
- **🪝 Powerful Hooks** - Monitor, customize, and control [every step of execution](./docs/HOOKS.md)
|
|
21
|
+
- **🎨 Fluent API** - [Builder pattern](./docs/CONFIGURATION.md) with model shortcuts and presets
|
|
22
|
+
- **🧪 Testing-Friendly** - Built-in [mocking system](./docs/TESTING.md) for zero-cost testing
|
|
23
|
+
- **⌨️ Convenient CLI** - [Capable CLI](./docs/CLI.md) showcasing how to build on top of llmist
|
|
24
|
+
- **🏦 Cost-aware** - [Cost APIs per model](./docs/MODEL_CATALOG.md) + prompt-caching aware accounting
|
|
24
25
|
|
|
25
26
|
---
|
|
26
27
|
|
|
@@ -49,18 +50,6 @@ bunx llmist agent "Calculate 15 * 23" --gadget ./calculator.ts --model sonnet
|
|
|
49
50
|
cat document.txt | llmist complete "Summarize" --model gpt-5-nano
|
|
50
51
|
```
|
|
51
52
|
|
|
52
|
-
**Built-in gadgets** are included by default in agent mode:
|
|
53
|
-
- `AskUser` - Prompts for user input when clarification is needed
|
|
54
|
-
- `TellUser` - Displays important messages (info/success/warning/error) and can end conversations
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
# Disable built-in gadgets
|
|
58
|
-
bunx llmist agent "Task" --no-builtins -g ./my-tools.ts
|
|
59
|
-
|
|
60
|
-
# Override parameter format (default: toml, options: toml, yaml, json, auto)
|
|
61
|
-
bunx llmist agent "Task" --parameter-format yaml -g ./my-tools.ts
|
|
62
|
-
```
|
|
63
|
-
|
|
64
53
|
📖 **[CLI Reference](./docs/CLI.md)** | **[CLI Gadgets Guide](./docs/CLI_GADGETS.md)**
|
|
65
54
|
|
|
66
55
|
|
|
@@ -100,7 +89,7 @@ const answer = await LLMist.createAgent()
|
|
|
100
89
|
console.log(answer); // "15 times 23 equals 345"
|
|
101
90
|
```
|
|
102
91
|
|
|
103
|
-
**That's it!**
|
|
92
|
+
**That's it!**
|
|
104
93
|
|
|
105
94
|
📖 **[Getting Started Guide](./docs/GETTING_STARTED.md)** - Learn more in 5 minutes
|
|
106
95
|
|
|
@@ -354,6 +343,7 @@ Uses provider-specific methods (tiktoken for OpenAI, native APIs for Anthropic/G
|
|
|
354
343
|
|
|
355
344
|
**Core Concepts**
|
|
356
345
|
- **[Gadgets (Tools)](./docs/GADGETS.md)** - Creating custom functions
|
|
346
|
+
- **[Block Format](./docs/BLOCK_FORMAT.md)** - Parameter syntax reference
|
|
357
347
|
- **[Hooks](./docs/HOOKS.md)** - Lifecycle monitoring and control
|
|
358
348
|
- **[Streaming](./docs/STREAMING.md)** - Real-time response handling
|
|
359
349
|
- **[Human-in-the-Loop](./docs/HUMAN_IN_LOOP.md)** - Interactive workflows
|
|
@@ -433,60 +423,7 @@ bun run format
|
|
|
433
423
|
|
|
434
424
|
## 🤝 Contributing
|
|
435
425
|
|
|
436
|
-
Contributions welcome!
|
|
437
|
-
|
|
438
|
-
1. ✅ All tests pass: `bun test`
|
|
439
|
-
2. ✅ Code is formatted: `bun run format`
|
|
440
|
-
3. ✅ Linting passes: `bun run lint`
|
|
441
|
-
4. ✅ Types are properly defined
|
|
442
|
-
5. ✅ Examples/docs updated for API changes
|
|
443
|
-
|
|
444
|
-
### Commit Message Convention
|
|
445
|
-
|
|
446
|
-
This project follows [Conventional Commits](https://www.conventionalcommits.org/) specification. All commit messages must be formatted as:
|
|
447
|
-
|
|
448
|
-
```
|
|
449
|
-
<type>(<scope>): <subject>
|
|
450
|
-
```
|
|
451
|
-
|
|
452
|
-
**Types:**
|
|
453
|
-
- `feat:` - New feature (triggers minor version bump)
|
|
454
|
-
- `fix:` - Bug fix (triggers patch version bump)
|
|
455
|
-
- `docs:` - Documentation only changes
|
|
456
|
-
- `style:` - Code style changes (formatting, missing semi-colons, etc)
|
|
457
|
-
- `refactor:` - Code refactoring without feature changes
|
|
458
|
-
- `perf:` - Performance improvements
|
|
459
|
-
- `test:` - Adding or updating tests
|
|
460
|
-
- `build:` - Build system or dependency changes
|
|
461
|
-
- `ci:` - CI configuration changes
|
|
462
|
-
- `chore:` - Other changes that don't modify src or test files
|
|
463
|
-
|
|
464
|
-
**Breaking Changes:** Add `BREAKING CHANGE:` in the footer to trigger major version bump.
|
|
465
|
-
|
|
466
|
-
**Examples:**
|
|
467
|
-
```bash
|
|
468
|
-
feat(agent): add support for streaming tool calls
|
|
469
|
-
fix(cli): prevent crash on invalid gadget path
|
|
470
|
-
docs: update API documentation for v2
|
|
471
|
-
```
|
|
472
|
-
|
|
473
|
-
**Note:** Git hooks will validate your commit messages locally.
|
|
474
|
-
|
|
475
|
-
### Release Process
|
|
476
|
-
|
|
477
|
-
Releases are fully automated using [semantic-release](https://github.com/semantic-release/semantic-release):
|
|
478
|
-
|
|
479
|
-
1. Merge PR to `main` branch
|
|
480
|
-
2. CI workflow runs automatically
|
|
481
|
-
3. If CI passes, release workflow:
|
|
482
|
-
- Analyzes commits since last release
|
|
483
|
-
- Determines version bump based on commit types
|
|
484
|
-
- Updates `package.json` and `CHANGELOG.md`
|
|
485
|
-
- Creates git tag and GitHub release
|
|
486
|
-
- Publishes to npm
|
|
487
|
-
- Syncs changes back to `dev` branch
|
|
488
|
-
|
|
489
|
-
**No manual version bumps needed!**
|
|
426
|
+
Contributions welcome! See **[CONTRIBUTING.md](./CONTRIBUTING.md)** for guidelines, commit conventions, and release process.
|
|
490
427
|
|
|
491
428
|
---
|
|
492
429
|
|