llm.rb 4.8.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.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +337 -590
  3. data/data/anthropic.json +770 -0
  4. data/data/deepseek.json +75 -0
  5. data/data/google.json +1050 -0
  6. data/data/openai.json +1421 -0
  7. data/data/xai.json +792 -0
  8. data/data/zai.json +330 -0
  9. data/lib/llm/agent.rb +42 -41
  10. data/lib/llm/bot.rb +1 -263
  11. data/lib/llm/buffer.rb +7 -0
  12. data/lib/llm/{session → context}/deserializer.rb +4 -3
  13. data/lib/llm/context.rb +292 -0
  14. data/lib/llm/cost.rb +26 -0
  15. data/lib/llm/error.rb +8 -0
  16. data/lib/llm/function/array.rb +61 -0
  17. data/lib/llm/function/fiber_group.rb +91 -0
  18. data/lib/llm/function/task_group.rb +89 -0
  19. data/lib/llm/function/thread_group.rb +94 -0
  20. data/lib/llm/function.rb +75 -10
  21. data/lib/llm/mcp/command.rb +108 -0
  22. data/lib/llm/mcp/error.rb +31 -0
  23. data/lib/llm/mcp/pipe.rb +82 -0
  24. data/lib/llm/mcp/rpc.rb +118 -0
  25. data/lib/llm/mcp/transport/stdio.rb +85 -0
  26. data/lib/llm/mcp.rb +102 -0
  27. data/lib/llm/message.rb +13 -11
  28. data/lib/llm/model.rb +2 -2
  29. data/lib/llm/prompt.rb +17 -7
  30. data/lib/llm/provider.rb +32 -17
  31. data/lib/llm/providers/anthropic/files.rb +3 -3
  32. data/lib/llm/providers/anthropic.rb +19 -4
  33. data/lib/llm/providers/deepseek.rb +10 -3
  34. data/lib/llm/providers/{gemini → google}/audio.rb +6 -6
  35. data/lib/llm/providers/{gemini → google}/error_handler.rb +2 -2
  36. data/lib/llm/providers/{gemini → google}/files.rb +11 -11
  37. data/lib/llm/providers/{gemini → google}/images.rb +7 -7
  38. data/lib/llm/providers/{gemini → google}/models.rb +5 -5
  39. data/lib/llm/providers/{gemini → google}/request_adapter/completion.rb +7 -3
  40. data/lib/llm/providers/{gemini → google}/request_adapter.rb +1 -1
  41. data/lib/llm/providers/{gemini → google}/response_adapter/completion.rb +7 -7
  42. data/lib/llm/providers/{gemini → google}/response_adapter/embedding.rb +1 -1
  43. data/lib/llm/providers/{gemini → google}/response_adapter/file.rb +1 -1
  44. data/lib/llm/providers/{gemini → google}/response_adapter/files.rb +1 -1
  45. data/lib/llm/providers/{gemini → google}/response_adapter/image.rb +1 -1
  46. data/lib/llm/providers/{gemini → google}/response_adapter/models.rb +1 -1
  47. data/lib/llm/providers/{gemini → google}/response_adapter/web_search.rb +2 -2
  48. data/lib/llm/providers/{gemini → google}/response_adapter.rb +8 -8
  49. data/lib/llm/providers/{gemini → google}/stream_parser.rb +3 -3
  50. data/lib/llm/providers/{gemini.rb → google.rb} +41 -26
  51. data/lib/llm/providers/llamacpp.rb +10 -3
  52. data/lib/llm/providers/ollama.rb +19 -4
  53. data/lib/llm/providers/openai/files.rb +3 -3
  54. data/lib/llm/providers/openai/response_adapter/completion.rb +9 -1
  55. data/lib/llm/providers/openai/response_adapter/responds.rb +9 -1
  56. data/lib/llm/providers/openai/responses.rb +9 -1
  57. data/lib/llm/providers/openai/stream_parser.rb +2 -0
  58. data/lib/llm/providers/openai.rb +19 -4
  59. data/lib/llm/providers/xai.rb +10 -3
  60. data/lib/llm/providers/zai.rb +9 -2
  61. data/lib/llm/registry.rb +81 -0
  62. data/lib/llm/schema/parser.rb +109 -0
  63. data/lib/llm/schema.rb +4 -0
  64. data/lib/llm/server_tool.rb +5 -5
  65. data/lib/llm/session.rb +10 -1
  66. data/lib/llm/tool.rb +85 -4
  67. data/lib/llm/tracer/logger.rb +1 -1
  68. data/lib/llm/tracer/telemetry.rb +7 -7
  69. data/lib/llm/tracer.rb +3 -3
  70. data/lib/llm/usage.rb +5 -0
  71. data/lib/llm/version.rb +1 -1
  72. data/lib/llm.rb +39 -6
  73. data/llm.gemspec +45 -8
  74. metadata +81 -28
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 696d0be686c58d66ce0904d0ed0aff879906511060704c61adc945b458ed1f37
4
- data.tar.gz: 7d03d786ff1fdbaa24e470f87d6e0c3c6b5acfc8e6b73c1cda88fdb9c1a4db58
3
+ metadata.gz: e876d90bb27d23cb36f97ee0edbc1fe8079a09f473b3a38a31fbd0247f3b9035
4
+ data.tar.gz: 82fce429783bcc2b8cb3bf8efc4b705ecc4e793cd6b0301ec616b48ec2d68f97
5
5
  SHA512:
6
- metadata.gz: aeb39e7a8b7a9826be90f3f4739ae0fae40df6bc6c7053e77110ccf1ebe9c5f44316b0edf0e2de3782d0fa93dce110ac8cc0328623056b6c71e55be3abf792c3
7
- data.tar.gz: c665f150d6c12cbe27541ea743a0fbea4eb107eb5bc93d4e9af480460108430a3057852458f9c5bd1fa5d17ed67633462513ff098c02f0fef43de9dc5ab44224
6
+ metadata.gz: e2164d4b134ad12316e1ffa1bdf0d73bc52e14c2514e48bfd6a4963dcb9b3f1bcec932728627a49fec1e4a941e576784d48ae50c59ee174eaa8191dda54123c3
7
+ data.tar.gz: 02bf971e89ee97485f83b87a44eef3cdfec0dc4eb5fc7aad3f1383dce34ef3f889a89ae77738933945248c8ea7d76062270cba2fad2d734eba77ea105abffbe4