llm.rb 4.12.0 → 4.14.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +84 -0
- data/README.md +126 -736
- data/lib/llm/context.rb +12 -2
- data/lib/llm/error.rb +4 -0
- data/lib/llm/eventhandler.rb +16 -12
- data/lib/llm/eventstream/event.rb +15 -5
- data/lib/llm/eventstream/parser.rb +29 -14
- data/lib/llm/function.rb +1 -1
- data/lib/llm/mcp/command.rb +1 -1
- data/lib/llm/mcp/error.rb +31 -1
- data/lib/llm/mcp/mailbox.rb +23 -0
- data/lib/llm/mcp/pipe.rb +1 -1
- data/lib/llm/mcp/router.rb +44 -0
- data/lib/llm/mcp/rpc.rb +31 -15
- data/lib/llm/mcp/transport/http/event_handler.rb +11 -9
- data/lib/llm/mcp/transport/http.rb +2 -2
- data/lib/llm/mcp/transport/stdio.rb +1 -1
- data/lib/llm/mcp.rb +46 -2
- data/lib/llm/provider/transport/http/execution.rb +115 -0
- data/lib/llm/provider/transport/http/interruptible.rb +109 -0
- data/lib/llm/provider/transport/http/stream_decoder.rb +92 -0
- data/lib/llm/provider/transport/http.rb +144 -0
- data/lib/llm/provider.rb +17 -103
- data/lib/llm/providers/openai/request_adapter/respond.rb +11 -5
- data/lib/llm/providers/openai/response_adapter/responds.rb +13 -1
- data/lib/llm/providers/openai/responses/stream_parser.rb +31 -0
- data/lib/llm/version.rb +1 -1
- data/lib/llm.rb +8 -0
- data/llm.gemspec +16 -6
- metadata +23 -8
- data/lib/llm/client.rb +0 -36
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ea1addf0bff644fa11e4f69a806f8ff5b7aa04fbbbc3f0592bd51b6ebc07f0f8
|
|
4
|
+
data.tar.gz: a3c846b9744e4ef230e2f23ed6ab42f6b4c84a0165b8bc066b7f6a003ee8fc00
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7387da06d824d42753ff30455b0e464b7ca6eaa43e9410ce814ad96451c5595154d1e721fb69c9edc0971208aaf8a011ce42078827b57971e0e7c0a66eb0db6e
|
|
7
|
+
data.tar.gz: 590442f434086b7215d664e6b5d474130499a14fba16810ff7e0b04878d25e46ca8983057af5fd9275d8415d95da6e1439b84388fa450b8c06bc7841c832a48e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,89 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
Changes since `v4.14.0`.
|
|
6
|
+
|
|
7
|
+
## v4.14.0
|
|
8
|
+
|
|
9
|
+
Changes since `v4.13.0`.
|
|
10
|
+
|
|
11
|
+
This release adds request interruption for contexts, reworks provider
|
|
12
|
+
HTTP internals for lower-overhead streaming, and fixes MCP clients so
|
|
13
|
+
parallel tool calls can safely share one connection.
|
|
14
|
+
|
|
15
|
+
### Add
|
|
16
|
+
|
|
17
|
+
* **Add request interruption support** <br>
|
|
18
|
+
Add `LLM::Context#interrupt!`, `LLM::Context#cancel!`, and
|
|
19
|
+
`LLM::Interrupt` for interrupting in-flight provider requests,
|
|
20
|
+
inspired by Go's context cancellation.
|
|
21
|
+
|
|
22
|
+
### Change
|
|
23
|
+
|
|
24
|
+
* **Rework provider HTTP transport internals** <br>
|
|
25
|
+
Rework provider HTTP around `LLM::Provider::Transport::HTTP` with
|
|
26
|
+
explicit transient and persistent transport handling.
|
|
27
|
+
|
|
28
|
+
* **Reduce SSE parser overhead** <br>
|
|
29
|
+
Dispatch raw parsed values to registered visitors instead of building
|
|
30
|
+
an `Event` object for every streamed line.
|
|
31
|
+
|
|
32
|
+
* **Reduce provider streaming allocations** <br>
|
|
33
|
+
Decode streamed provider payloads directly in
|
|
34
|
+
`LLM::Provider::Transport::HTTP` before handing them to provider
|
|
35
|
+
parsers, which cuts allocation churn and gives a smaller streaming
|
|
36
|
+
speed bump.
|
|
37
|
+
|
|
38
|
+
* **Reduce generic SSE parser allocations** <br>
|
|
39
|
+
Keep unread event-stream buffer data in place until compaction is
|
|
40
|
+
worthwhile, which lowers allocation churn in the remaining generic
|
|
41
|
+
SSE path.
|
|
42
|
+
|
|
43
|
+
### Fix
|
|
44
|
+
|
|
45
|
+
* **Support parallel MCP tool calls on one client** <br>
|
|
46
|
+
Route MCP responses by JSON-RPC id so concurrent tool calls can
|
|
47
|
+
share one client and transport without mismatching replies.
|
|
48
|
+
|
|
49
|
+
* **Use explicit MCP non-blocking read errors** <br>
|
|
50
|
+
Use `IO::EAGAINWaitReadable` while continuing to retry on
|
|
51
|
+
`IO::WaitReadable`.
|
|
52
|
+
|
|
53
|
+
## v4.13.0
|
|
54
|
+
|
|
55
|
+
Changes since `v4.12.0`.
|
|
56
|
+
|
|
57
|
+
This release expands MCP prompt support, improves reasoning support in the
|
|
58
|
+
OpenAI Responses API, and refreshes the docs around llm.rb's runtime model,
|
|
59
|
+
contexts, and advanced workflows.
|
|
60
|
+
|
|
61
|
+
### Add
|
|
62
|
+
|
|
63
|
+
- Add `LLM::MCP#prompts` and `LLM::MCP#find_prompt` for MCP prompt support.
|
|
64
|
+
|
|
65
|
+
### Change
|
|
66
|
+
|
|
67
|
+
- Rework the README around llm.rb as a runtime for AI systems.
|
|
68
|
+
- Add a dedicated deep dive guide for providers, contexts, persistence,
|
|
69
|
+
tools, agents, MCP, tracing, multimodal prompts, and retrieval.
|
|
70
|
+
|
|
71
|
+
### Fix
|
|
72
|
+
|
|
73
|
+
All of these fixes apply to MCP:
|
|
74
|
+
|
|
75
|
+
- fix(mcp): raise `LLM::MCP::MismatchError` on mismatched response ids.
|
|
76
|
+
- fix(mcp): normalize prompt message content while preserving the original payload.
|
|
77
|
+
|
|
78
|
+
All of these fixes apply to OpenAI's Responses API:
|
|
79
|
+
|
|
80
|
+
- fix(openai): emit `on_reasoning_content` for streamed reasoning summaries.
|
|
81
|
+
- fix(openai): skip `previous_response_id` on `store: false` follow-up calls.
|
|
82
|
+
- fix(openai): fall back to an empty object schema for tools without params.
|
|
83
|
+
- fix(openai): preserve original tool-call payloads on re-sent assistant tool messages.
|
|
84
|
+
- fix(openai): emit `output_text` for assistant-authored response content.
|
|
85
|
+
- fix(openai): return `nil` for `system_fingerprint` on normalized response objects.
|
|
86
|
+
|
|
3
87
|
## v4.12.0
|
|
4
88
|
|
|
5
89
|
Changes since `v4.11.1`.
|