llm.rb 4.9.0 → 4.11.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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +152 -0
  3. data/README.md +178 -31
  4. data/data/anthropic.json +209 -242
  5. data/data/deepseek.json +15 -15
  6. data/data/google.json +553 -403
  7. data/data/openai.json +740 -535
  8. data/data/xai.json +250 -253
  9. data/data/zai.json +157 -90
  10. data/lib/llm/context/deserializer.rb +2 -1
  11. data/lib/llm/context.rb +58 -2
  12. data/lib/llm/contract/completion.rb +7 -0
  13. data/lib/llm/error.rb +4 -0
  14. data/lib/llm/eventhandler.rb +7 -0
  15. data/lib/llm/function/registry.rb +106 -0
  16. data/lib/llm/function/task.rb +39 -0
  17. data/lib/llm/function.rb +12 -7
  18. data/lib/llm/mcp/transport/http/event_handler.rb +66 -0
  19. data/lib/llm/mcp/transport/http.rb +156 -0
  20. data/lib/llm/mcp/transport/stdio.rb +7 -0
  21. data/lib/llm/mcp.rb +74 -30
  22. data/lib/llm/message.rb +9 -2
  23. data/lib/llm/provider.rb +10 -0
  24. data/lib/llm/providers/anthropic/response_adapter/completion.rb +6 -0
  25. data/lib/llm/providers/anthropic/stream_parser.rb +37 -4
  26. data/lib/llm/providers/anthropic.rb +1 -1
  27. data/lib/llm/providers/google/response_adapter/completion.rb +12 -5
  28. data/lib/llm/providers/google/stream_parser.rb +54 -11
  29. data/lib/llm/providers/google/utils.rb +30 -0
  30. data/lib/llm/providers/google.rb +2 -0
  31. data/lib/llm/providers/ollama/response_adapter/completion.rb +6 -0
  32. data/lib/llm/providers/ollama/stream_parser.rb +10 -4
  33. data/lib/llm/providers/ollama.rb +1 -1
  34. data/lib/llm/providers/openai/response_adapter/completion.rb +7 -0
  35. data/lib/llm/providers/openai/response_adapter/responds.rb +84 -10
  36. data/lib/llm/providers/openai/responses/stream_parser.rb +63 -4
  37. data/lib/llm/providers/openai/responses.rb +1 -1
  38. data/lib/llm/providers/openai/stream_parser.rb +68 -4
  39. data/lib/llm/providers/openai.rb +1 -1
  40. data/lib/llm/schema/all_of.rb +31 -0
  41. data/lib/llm/schema/any_of.rb +31 -0
  42. data/lib/llm/schema/one_of.rb +31 -0
  43. data/lib/llm/schema/parser.rb +36 -0
  44. data/lib/llm/schema.rb +45 -8
  45. data/lib/llm/stream/queue.rb +51 -0
  46. data/lib/llm/stream.rb +102 -0
  47. data/lib/llm/tool.rb +53 -47
  48. data/lib/llm/version.rb +1 -1
  49. data/lib/llm.rb +3 -2
  50. data/llm.gemspec +2 -2
  51. metadata +12 -1
data/data/deepseek.json CHANGED
@@ -8,16 +8,13 @@
8
8
  "name": "DeepSeek",
9
9
  "doc": "https://api-docs.deepseek.com/quick_start/pricing",
10
10
  "models": {
11
- "deepseek-reasoner": {
12
- "id": "deepseek-reasoner",
13
- "name": "DeepSeek Reasoner",
14
- "family": "deepseek-thinking",
11
+ "deepseek-chat": {
12
+ "id": "deepseek-chat",
13
+ "name": "DeepSeek Chat",
14
+ "family": "deepseek",
15
15
  "attachment": true,
16
- "reasoning": true,
16
+ "reasoning": false,
17
17
  "tool_call": true,
18
- "interleaved": {
19
- "field": "reasoning_content"
20
- },
21
18
  "temperature": true,
22
19
  "knowledge": "2025-09",
23
20
  "release_date": "2025-12-01",
@@ -38,16 +35,19 @@
38
35
  },
39
36
  "limit": {
40
37
  "context": 128000,
41
- "output": 64000
38
+ "output": 8192
42
39
  }
43
40
  },
44
- "deepseek-chat": {
45
- "id": "deepseek-chat",
46
- "name": "DeepSeek Chat",
47
- "family": "deepseek",
41
+ "deepseek-reasoner": {
42
+ "id": "deepseek-reasoner",
43
+ "name": "DeepSeek Reasoner",
44
+ "family": "deepseek-thinking",
48
45
  "attachment": true,
49
- "reasoning": false,
46
+ "reasoning": true,
50
47
  "tool_call": true,
48
+ "interleaved": {
49
+ "field": "reasoning_content"
50
+ },
51
51
  "temperature": true,
52
52
  "knowledge": "2025-09",
53
53
  "release_date": "2025-12-01",
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "limit": {
70
70
  "context": 128000,
71
- "output": 8192
71
+ "output": 64000
72
72
  }
73
73
  }
74
74
  }