llm.rb 4.7.0 → 4.9.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/README.md +335 -587
- data/data/anthropic.json +770 -0
- data/data/deepseek.json +75 -0
- data/data/google.json +1050 -0
- data/data/openai.json +1421 -0
- data/data/xai.json +792 -0
- data/data/zai.json +330 -0
- data/lib/llm/agent.rb +42 -41
- data/lib/llm/bot.rb +1 -263
- data/lib/llm/buffer.rb +7 -0
- data/lib/llm/{session → context}/deserializer.rb +4 -3
- data/lib/llm/context.rb +292 -0
- data/lib/llm/cost.rb +26 -0
- data/lib/llm/error.rb +8 -0
- data/lib/llm/eventstream/parser.rb +0 -5
- data/lib/llm/function/array.rb +61 -0
- data/lib/llm/function/fiber_group.rb +91 -0
- data/lib/llm/function/task_group.rb +89 -0
- data/lib/llm/function/thread_group.rb +94 -0
- data/lib/llm/function.rb +75 -10
- data/lib/llm/mcp/command.rb +108 -0
- data/lib/llm/mcp/error.rb +31 -0
- data/lib/llm/mcp/pipe.rb +82 -0
- data/lib/llm/mcp/rpc.rb +118 -0
- data/lib/llm/mcp/transport/stdio.rb +85 -0
- data/lib/llm/mcp.rb +102 -0
- data/lib/llm/message.rb +13 -11
- data/lib/llm/model.rb +115 -0
- data/lib/llm/prompt.rb +17 -7
- data/lib/llm/provider.rb +60 -32
- data/lib/llm/providers/anthropic/error_handler.rb +1 -1
- data/lib/llm/providers/anthropic/files.rb +3 -3
- data/lib/llm/providers/anthropic/models.rb +1 -1
- data/lib/llm/providers/anthropic/request_adapter.rb +20 -3
- data/lib/llm/providers/anthropic/response_adapter/models.rb +13 -0
- data/lib/llm/providers/anthropic/response_adapter.rb +2 -0
- data/lib/llm/providers/anthropic.rb +21 -5
- data/lib/llm/providers/deepseek.rb +10 -3
- data/lib/llm/providers/{gemini → google}/audio.rb +6 -6
- data/lib/llm/providers/{gemini → google}/error_handler.rb +20 -5
- data/lib/llm/providers/{gemini → google}/files.rb +11 -11
- data/lib/llm/providers/{gemini → google}/images.rb +7 -7
- data/lib/llm/providers/{gemini → google}/models.rb +5 -5
- data/lib/llm/providers/{gemini → google}/request_adapter/completion.rb +7 -3
- data/lib/llm/providers/{gemini → google}/request_adapter.rb +1 -1
- data/lib/llm/providers/{gemini → google}/response_adapter/completion.rb +7 -7
- data/lib/llm/providers/{gemini → google}/response_adapter/embedding.rb +1 -1
- data/lib/llm/providers/{gemini → google}/response_adapter/file.rb +1 -1
- data/lib/llm/providers/{gemini → google}/response_adapter/files.rb +1 -1
- data/lib/llm/providers/{gemini → google}/response_adapter/image.rb +1 -1
- data/lib/llm/providers/google/response_adapter/models.rb +13 -0
- data/lib/llm/providers/{gemini → google}/response_adapter/web_search.rb +2 -2
- data/lib/llm/providers/{gemini → google}/response_adapter.rb +8 -8
- data/lib/llm/providers/{gemini → google}/stream_parser.rb +3 -3
- data/lib/llm/providers/{gemini.rb → google.rb} +41 -26
- data/lib/llm/providers/llamacpp.rb +10 -3
- data/lib/llm/providers/ollama/error_handler.rb +1 -1
- data/lib/llm/providers/ollama/models.rb +1 -1
- data/lib/llm/providers/ollama/response_adapter/models.rb +13 -0
- data/lib/llm/providers/ollama/response_adapter.rb +2 -0
- data/lib/llm/providers/ollama.rb +19 -4
- data/lib/llm/providers/openai/error_handler.rb +18 -3
- data/lib/llm/providers/openai/files.rb +3 -3
- data/lib/llm/providers/openai/images.rb +17 -11
- data/lib/llm/providers/openai/models.rb +1 -1
- data/lib/llm/providers/openai/response_adapter/completion.rb +9 -1
- data/lib/llm/providers/openai/response_adapter/models.rb +13 -0
- data/lib/llm/providers/openai/response_adapter/responds.rb +9 -1
- data/lib/llm/providers/openai/response_adapter.rb +2 -0
- data/lib/llm/providers/openai/responses.rb +16 -1
- data/lib/llm/providers/openai/stream_parser.rb +2 -0
- data/lib/llm/providers/openai.rb +28 -6
- data/lib/llm/providers/xai/images.rb +7 -6
- data/lib/llm/providers/xai.rb +10 -3
- data/lib/llm/providers/zai.rb +9 -2
- data/lib/llm/registry.rb +81 -0
- data/lib/llm/schema/enum.rb +16 -0
- data/lib/llm/schema/parser.rb +109 -0
- data/lib/llm/schema.rb +5 -0
- data/lib/llm/server_tool.rb +5 -5
- data/lib/llm/session.rb +10 -1
- data/lib/llm/tool/param.rb +1 -1
- data/lib/llm/tool.rb +86 -5
- data/lib/llm/tracer/langsmith.rb +144 -0
- data/lib/llm/tracer/logger.rb +9 -1
- data/lib/llm/tracer/null.rb +8 -0
- data/lib/llm/tracer/telemetry.rb +98 -78
- data/lib/llm/tracer.rb +108 -4
- data/lib/llm/usage.rb +5 -0
- data/lib/llm/version.rb +1 -1
- data/lib/llm.rb +40 -6
- data/llm.gemspec +45 -8
- metadata +87 -28
- data/lib/llm/providers/gemini/response_adapter/models.rb +0 -15
data/data/deepseek.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "deepseek",
|
|
3
|
+
"env": [
|
|
4
|
+
"DEEPSEEK_API_KEY"
|
|
5
|
+
],
|
|
6
|
+
"npm": "@ai-sdk/openai-compatible",
|
|
7
|
+
"api": "https://api.deepseek.com",
|
|
8
|
+
"name": "DeepSeek",
|
|
9
|
+
"doc": "https://api-docs.deepseek.com/quick_start/pricing",
|
|
10
|
+
"models": {
|
|
11
|
+
"deepseek-reasoner": {
|
|
12
|
+
"id": "deepseek-reasoner",
|
|
13
|
+
"name": "DeepSeek Reasoner",
|
|
14
|
+
"family": "deepseek-thinking",
|
|
15
|
+
"attachment": true,
|
|
16
|
+
"reasoning": true,
|
|
17
|
+
"tool_call": true,
|
|
18
|
+
"interleaved": {
|
|
19
|
+
"field": "reasoning_content"
|
|
20
|
+
},
|
|
21
|
+
"temperature": true,
|
|
22
|
+
"knowledge": "2025-09",
|
|
23
|
+
"release_date": "2025-12-01",
|
|
24
|
+
"last_updated": "2026-02-28",
|
|
25
|
+
"modalities": {
|
|
26
|
+
"input": [
|
|
27
|
+
"text"
|
|
28
|
+
],
|
|
29
|
+
"output": [
|
|
30
|
+
"text"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"open_weights": true,
|
|
34
|
+
"cost": {
|
|
35
|
+
"input": 0.28,
|
|
36
|
+
"output": 0.42,
|
|
37
|
+
"cache_read": 0.028
|
|
38
|
+
},
|
|
39
|
+
"limit": {
|
|
40
|
+
"context": 128000,
|
|
41
|
+
"output": 64000
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"deepseek-chat": {
|
|
45
|
+
"id": "deepseek-chat",
|
|
46
|
+
"name": "DeepSeek Chat",
|
|
47
|
+
"family": "deepseek",
|
|
48
|
+
"attachment": true,
|
|
49
|
+
"reasoning": false,
|
|
50
|
+
"tool_call": true,
|
|
51
|
+
"temperature": true,
|
|
52
|
+
"knowledge": "2025-09",
|
|
53
|
+
"release_date": "2025-12-01",
|
|
54
|
+
"last_updated": "2026-02-28",
|
|
55
|
+
"modalities": {
|
|
56
|
+
"input": [
|
|
57
|
+
"text"
|
|
58
|
+
],
|
|
59
|
+
"output": [
|
|
60
|
+
"text"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
"open_weights": true,
|
|
64
|
+
"cost": {
|
|
65
|
+
"input": 0.28,
|
|
66
|
+
"output": 0.42,
|
|
67
|
+
"cache_read": 0.028
|
|
68
|
+
},
|
|
69
|
+
"limit": {
|
|
70
|
+
"context": 128000,
|
|
71
|
+
"output": 8192
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|