langsmithrb_rails 0.1.0 → 0.3.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 (69) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +3 -0
  3. data/.rspec_status +161 -0
  4. data/CHANGELOG.md +38 -0
  5. data/Gemfile +20 -0
  6. data/Gemfile.lock +321 -0
  7. data/LICENSE +21 -0
  8. data/README.md +421 -0
  9. data/Rakefile +10 -0
  10. data/langsmithrb_rails-0.1.0.gem +0 -0
  11. data/langsmithrb_rails-0.1.1.gem +0 -0
  12. data/langsmithrb_rails.gemspec +45 -0
  13. data/lib/generators/langsmithrb_rails/buffer/buffer_generator.rb +94 -0
  14. data/lib/generators/langsmithrb_rails/buffer/templates/create_langsmith_run_buffers.rb +29 -0
  15. data/lib/generators/langsmithrb_rails/buffer/templates/flush_buffer_job.rb +40 -0
  16. data/lib/generators/langsmithrb_rails/buffer/templates/langsmith.rake +71 -0
  17. data/lib/generators/langsmithrb_rails/buffer/templates/langsmith_run_buffer.rb +70 -0
  18. data/lib/generators/langsmithrb_rails/buffer/templates/migration.rb +28 -0
  19. data/lib/generators/langsmithrb_rails/ci/ci_generator.rb +37 -0
  20. data/lib/generators/langsmithrb_rails/ci/templates/langsmith-evals.yml +85 -0
  21. data/lib/generators/langsmithrb_rails/ci/templates/langsmith_export_summary.rb +81 -0
  22. data/lib/generators/langsmithrb_rails/demo/demo_generator.rb +81 -0
  23. data/lib/generators/langsmithrb_rails/demo/templates/chat_controller.js +88 -0
  24. data/lib/generators/langsmithrb_rails/demo/templates/chat_controller.rb +58 -0
  25. data/lib/generators/langsmithrb_rails/demo/templates/chat_message.rb +24 -0
  26. data/lib/generators/langsmithrb_rails/demo/templates/create_chat_messages.rb +19 -0
  27. data/lib/generators/langsmithrb_rails/demo/templates/index.html.erb +180 -0
  28. data/lib/generators/langsmithrb_rails/demo/templates/llm_service.rb +165 -0
  29. data/lib/generators/langsmithrb_rails/evals/evals_generator.rb +52 -0
  30. data/lib/generators/langsmithrb_rails/evals/templates/checks/correctness.rb +71 -0
  31. data/lib/generators/langsmithrb_rails/evals/templates/checks/llm_graded.rb +137 -0
  32. data/lib/generators/langsmithrb_rails/evals/templates/datasets/sample.yml +60 -0
  33. data/lib/generators/langsmithrb_rails/evals/templates/langsmith_evals.rake +255 -0
  34. data/lib/generators/langsmithrb_rails/evals/templates/targets/http.rb +120 -0
  35. data/lib/generators/langsmithrb_rails/evals/templates/targets/ruby.rb +136 -0
  36. data/lib/generators/langsmithrb_rails/install/install_generator.rb +35 -0
  37. data/lib/generators/langsmithrb_rails/install/templates/config.yml +45 -0
  38. data/lib/generators/langsmithrb_rails/install/templates/initializer.rb +34 -0
  39. data/lib/generators/langsmithrb_rails/privacy/privacy_generator.rb +39 -0
  40. data/lib/generators/langsmithrb_rails/privacy/templates/custom_redactor.rb +132 -0
  41. data/lib/generators/langsmithrb_rails/privacy/templates/privacy.yml +88 -0
  42. data/lib/generators/langsmithrb_rails/privacy/templates/privacy_initializer.rb +41 -0
  43. data/lib/generators/langsmithrb_rails/tracing/templates/langsmith_traced.rb +146 -0
  44. data/lib/generators/langsmithrb_rails/tracing/templates/langsmith_traced_job.rb +151 -0
  45. data/lib/generators/langsmithrb_rails/tracing/templates/request_tracing.rb +117 -0
  46. data/lib/generators/langsmithrb_rails/tracing/tracing_generator.rb +78 -0
  47. data/lib/langsmithrb_rails/client.rb +292 -0
  48. data/lib/langsmithrb_rails/config.rb +169 -0
  49. data/lib/langsmithrb_rails/evaluation/evaluator.rb +178 -0
  50. data/lib/langsmithrb_rails/evaluation/llm_evaluator.rb +154 -0
  51. data/lib/langsmithrb_rails/evaluation/string_evaluator.rb +158 -0
  52. data/lib/langsmithrb_rails/evaluation.rb +76 -0
  53. data/lib/langsmithrb_rails/generators/langsmithrb_rails/langsmith_generator.rb +61 -0
  54. data/lib/langsmithrb_rails/generators/langsmithrb_rails/templates/langsmith_initializer.rb +22 -0
  55. data/lib/langsmithrb_rails/langsmith.rb +35 -0
  56. data/lib/langsmithrb_rails/otel/exporter.rb +120 -0
  57. data/lib/langsmithrb_rails/otel.rb +135 -0
  58. data/lib/langsmithrb_rails/railtie.rb +33 -0
  59. data/lib/langsmithrb_rails/redactor.rb +76 -0
  60. data/lib/langsmithrb_rails/run_trees.rb +157 -0
  61. data/lib/langsmithrb_rails/version.rb +5 -0
  62. data/lib/langsmithrb_rails/wrappers/anthropic.rb +146 -0
  63. data/lib/langsmithrb_rails/wrappers/base.rb +81 -0
  64. data/lib/langsmithrb_rails/wrappers/llm.rb +151 -0
  65. data/lib/langsmithrb_rails/wrappers/openai.rb +193 -0
  66. data/lib/langsmithrb_rails/wrappers.rb +41 -0
  67. data/lib/langsmithrb_rails.rb +151 -0
  68. data/pkg/langsmithrb_rails-0.3.0.gem +0 -0
  69. metadata +74 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 072ade06ca9325722361ca200c89fc440612dc8ea67bc87fcc2f3db5a38b5267
4
- data.tar.gz: 638fef470473027462168f62ade47cbb5dc4aed931c52dfd6d18d15d4727324f
3
+ metadata.gz: e7871f0c85cdbf0ec6ea8a29115cca1e5f3e86d8c42d34b69533efd6197b7bc4
4
+ data.tar.gz: f7fea4c3dc9aa3128602f6b2e7b1c43f0becb2256bbe595ed2963376737a7b2d
5
5
  SHA512:
6
- metadata.gz: 202b2cb9e8759c52d9032b7018b6995925982e0b1ab8c8c98c3c3de25aeedb0e0330b3d1b0fe854d71c1a62ca3093616c3a5ab1ff78afdeec713d5c26621abbf
7
- data.tar.gz: f3cd6fe852c571470fb81f1d5eb0b2a1eac49dab906b4d3d0edc4a5e90e354dac5cc206259db3bb93473981a2106b3ad4b3b84ac776c39675934d7e51b8823ed
6
+ metadata.gz: 51dc0027ec369337c3df8ad62b827e5758053b0f11228927669b07c4cbbbb9e2f5617d03dc3766db906980baa5e50f33563ed24e5e8d81aff43d67b52138d4b6
7
+ data.tar.gz: ab000faf12fc4c9eb7fb70a0c36945e3da9868737f3a60e2fef01008f92bd25e9c827dfc2bc070aaf80a3f48081102e61af1381f47edac8e13d6ebe5e36c1fb0
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --require spec_helper
2
+ --format documentation
3
+ --color
data/.rspec_status ADDED
@@ -0,0 +1,161 @@
1
+ example_id | status | run_time |
2
+ -------------------------------------------------------------------------------------------------- | ------ | --------------- |
3
+ ./spec/langsmithrb_rails/config_spec.rb[1:1:1] | failed | 0.00773 seconds |
4
+ ./spec/langsmithrb_rails/config_spec.rb[1:2:1] | failed | 0.00029 seconds |
5
+ ./spec/langsmithrb_rails/config_spec.rb[1:2:2] | failed | 0.0002 seconds |
6
+ ./spec/langsmithrb_rails/config_spec.rb[1:2:3] | failed | 0.00016 seconds |
7
+ ./spec/langsmithrb_rails/generators/buffer_generator_spec.rb[1:1:1] | passed | 0.00178 seconds |
8
+ ./spec/langsmithrb_rails/generators/buffer_generator_spec.rb[1:2:1] | passed | 0.00623 seconds |
9
+ ./spec/langsmithrb_rails/generators/buffer_generator_spec.rb[1:3:1] | passed | 0.00054 seconds |
10
+ ./spec/langsmithrb_rails/generators/buffer_generator_spec.rb[1:4:1] | passed | 0.00068 seconds |
11
+ ./spec/langsmithrb_rails/generators/buffer_generator_spec.rb[1:5:1:1:1] | passed | 0.00057 seconds |
12
+ ./spec/langsmithrb_rails/generators/buffer_generator_spec.rb[1:5:1:2:1] | passed | 0.00069 seconds |
13
+ ./spec/langsmithrb_rails/generators/buffer_generator_spec.rb[1:5:2:1] | passed | 0.00068 seconds |
14
+ ./spec/langsmithrb_rails/generators/buffer_generator_spec.rb[1:6:1] | passed | 0.00037 seconds |
15
+ ./spec/langsmithrb_rails/generators/buffer_generator_spec.rb[1:7:1] | passed | 0.0023 seconds |
16
+ ./spec/langsmithrb_rails/generators/ci_generator_spec.rb[1:1:1] | passed | 0.00075 seconds |
17
+ ./spec/langsmithrb_rails/generators/ci_generator_spec.rb[1:2:1] | passed | 0.00043 seconds |
18
+ ./spec/langsmithrb_rails/generators/ci_generator_spec.rb[1:3:1] | passed | 0.00053 seconds |
19
+ ./spec/langsmithrb_rails/generators/demo_generator_spec.rb[1:1:1] | passed | 0.00051 seconds |
20
+ ./spec/langsmithrb_rails/generators/demo_generator_spec.rb[1:2:1] | passed | 0.00078 seconds |
21
+ ./spec/langsmithrb_rails/generators/demo_generator_spec.rb[1:3:1] | passed | 0.00051 seconds |
22
+ ./spec/langsmithrb_rails/generators/demo_generator_spec.rb[1:4:1] | passed | 0.00106 seconds |
23
+ ./spec/langsmithrb_rails/generators/demo_generator_spec.rb[1:5:1] | passed | 0.00135 seconds |
24
+ ./spec/langsmithrb_rails/generators/demo_generator_spec.rb[1:6:1] | passed | 0.00532 seconds |
25
+ ./spec/langsmithrb_rails/generators/demo_generator_spec.rb[1:7:1] | passed | 0.00074 seconds |
26
+ ./spec/langsmithrb_rails/generators/demo_generator_spec.rb[1:8:1] | passed | 0.00218 seconds |
27
+ ./spec/langsmithrb_rails/generators/demo_generator_spec.rb[1:9:1] | passed | 0.06224 seconds |
28
+ ./spec/langsmithrb_rails/generators/evals_generator_spec.rb[1:1:1] | passed | 0.00531 seconds |
29
+ ./spec/langsmithrb_rails/generators/evals_generator_spec.rb[1:2:1] | passed | 0.00354 seconds |
30
+ ./spec/langsmithrb_rails/generators/evals_generator_spec.rb[1:3:1] | passed | 0.00707 seconds |
31
+ ./spec/langsmithrb_rails/generators/evals_generator_spec.rb[1:4:1] | passed | 0.00068 seconds |
32
+ ./spec/langsmithrb_rails/generators/evals_generator_spec.rb[1:5:1] | passed | 0.00037 seconds |
33
+ ./spec/langsmithrb_rails/generators/evals_generator_spec.rb[1:6:1] | passed | 0.00064 seconds |
34
+ ./spec/langsmithrb_rails/generators/langsmith_generator_spec.rb[1:1:1] | passed | 0.00036 seconds |
35
+ ./spec/langsmithrb_rails/generators/langsmith_generator_spec.rb[1:2:1:1] | passed | 0.0007 seconds |
36
+ ./spec/langsmithrb_rails/generators/langsmith_generator_spec.rb[1:2:2:1] | passed | 0.00262 seconds |
37
+ ./spec/langsmithrb_rails/generators/langsmith_generator_spec.rb[1:2:3:1] | passed | 0.00075 seconds |
38
+ ./spec/langsmithrb_rails/generators/langsmith_generator_spec.rb[1:3:1:1] | passed | 0.0007 seconds |
39
+ ./spec/langsmithrb_rails/generators/langsmith_generator_spec.rb[1:3:2:1] | passed | 0.00043 seconds |
40
+ ./spec/langsmithrb_rails/generators/langsmith_generator_spec.rb[1:3:3:1] | passed | 0.00065 seconds |
41
+ ./spec/langsmithrb_rails/generators/langsmith_generator_spec.rb[1:4:1] | passed | 0.00145 seconds |
42
+ ./spec/langsmithrb_rails/generators/langsmithrb_rails/templates/langsmith_initializer_spec.rb[1:1] | passed | 0.00294 seconds |
43
+ ./spec/langsmithrb_rails/generators/langsmithrb_rails/templates/langsmith_initializer_spec.rb[1:2] | passed | 0.00487 seconds |
44
+ ./spec/langsmithrb_rails/generators/langsmithrb_rails/templates/langsmith_initializer_spec.rb[1:3] | passed | 0.0002 seconds |
45
+ ./spec/langsmithrb_rails/generators/privacy_generator_spec.rb[1:1:1] | passed | 0.00067 seconds |
46
+ ./spec/langsmithrb_rails/generators/privacy_generator_spec.rb[1:2:1] | passed | 0.00037 seconds |
47
+ ./spec/langsmithrb_rails/generators/privacy_generator_spec.rb[1:3:1] | passed | 0.00052 seconds |
48
+ ./spec/langsmithrb_rails/generators/privacy_generator_spec.rb[1:4:1] | passed | 0.00054 seconds |
49
+ ./spec/langsmithrb_rails/generators/tracing_generator_spec.rb[1:1:1] | passed | 0.0004 seconds |
50
+ ./spec/langsmithrb_rails/generators/tracing_generator_spec.rb[1:2:1] | passed | 0.00038 seconds |
51
+ ./spec/langsmithrb_rails/generators/tracing_generator_spec.rb[1:3:1] | passed | 0.00037 seconds |
52
+ ./spec/langsmithrb_rails/generators/tracing_generator_spec.rb[1:4:1:1:1] | passed | 0.00055 seconds |
53
+ ./spec/langsmithrb_rails/generators/tracing_generator_spec.rb[1:4:1:2:1] | passed | 0.00049 seconds |
54
+ ./spec/langsmithrb_rails/generators/tracing_generator_spec.rb[1:4:1:3:1] | passed | 0.00069 seconds |
55
+ ./spec/langsmithrb_rails/generators/tracing_generator_spec.rb[1:4:2:1] | passed | 0.00174 seconds |
56
+ ./spec/langsmithrb_rails/generators/tracing_generator_spec.rb[1:5:1] | passed | 0.00053 seconds |
57
+ ./spec/langsmithrb_rails/generators/tracing_generator_spec.rb[1:6:1] | passed | 0.00078 seconds |
58
+ ./spec/langsmithrb_rails/langsmith_spec.rb[1:1:1] | passed | 0.00027 seconds |
59
+ ./spec/langsmithrb_rails/langsmith_spec.rb[1:1:2] | passed | 0.00022 seconds |
60
+ ./spec/langsmithrb_rails/langsmith_spec.rb[1:1:3] | passed | 0.00036 seconds |
61
+ ./spec/langsmithrb_rails/langsmith_spec.rb[1:1:4] | passed | 0.00031 seconds |
62
+ ./spec/langsmithrb_rails/langsmith_spec.rb[1:1:5] | passed | 0.00026 seconds |
63
+ ./spec/langsmithrb_rails/langsmith_spec.rb[1:2:1] | passed | 0.0008 seconds |
64
+ ./spec/langsmithrb_rails/langsmith_spec.rb[1:2:2] | passed | 0.00023 seconds |
65
+ ./spec/langsmithrb_rails/langsmith_spec.rb[1:2:3] | passed | 0.0002 seconds |
66
+ ./spec/langsmithrb_rails/langsmith_spec.rb[1:3:1] | passed | 0.00055 seconds |
67
+ ./spec/langsmithrb_rails/langsmithrb_spec.rb[1:1:1] | passed | 0.00019 seconds |
68
+ ./spec/langsmithrb_rails/langsmithrb_spec.rb[1:1:2] | passed | 0.00018 seconds |
69
+ ./spec/langsmithrb_rails/langsmithrb_spec.rb[1:1:3] | passed | 0.00018 seconds |
70
+ ./spec/langsmithrb_rails/langsmithrb_spec.rb[1:2:1] | passed | 0.00019 seconds |
71
+ ./spec/langsmithrb_rails/langsmithrb_spec.rb[1:2:2] | passed | 0.0002 seconds |
72
+ ./spec/langsmithrb_rails/langsmithrb_spec.rb[1:2:3] | passed | 0.00019 seconds |
73
+ ./spec/langsmithrb_rails/langsmithrb_spec.rb[1:3:1] | passed | 0.00016 seconds |
74
+ ./spec/langsmithrb_rails/railtie_spec.rb[1:1:1:1] | passed | 0.00019 seconds |
75
+ ./spec/langsmithrb_rails/railtie_spec.rb[1:1:2:1] | passed | 0.00013 seconds |
76
+ ./spec/langsmithrb_rails/railtie_spec.rb[1:2:1] | passed | 0.00056 seconds |
77
+ ./spec/langsmithrb_rails/railtie_spec.rb[1:3:1] | passed | 0.00289 seconds |
78
+ ./spec/langsmithrb_rails/version_spec.rb[1:1:1] | passed | 0.00107 seconds |
79
+ ./spec/langsmithrb_rails_spec.rb[1:1:1] | passed | 0.00106 seconds |
80
+ ./spec/langsmithrb_rails_spec.rb[1:1:2] | passed | 0.00025 seconds |
81
+ ./spec/langsmithrb_rails_spec.rb[1:2:1] | passed | 0.00018 seconds |
82
+ ./spec/langsmithrb_rails_spec.rb[1:2:2] | passed | 0.00014 seconds |
83
+ ./spec/lib/langsmithrb_rails/config_spec.rb[1:1:1] | passed | 0.00014 seconds |
84
+ ./spec/lib/langsmithrb_rails/config_spec.rb[1:2:1] | failed | 0.01119 seconds |
85
+ ./spec/lib/langsmithrb_rails/config_spec.rb[1:2:2:1] | failed | 0.00032 seconds |
86
+ ./spec/lib/langsmithrb_rails/config_spec.rb[1:3:1] | passed | 0.0002 seconds |
87
+ ./spec/lib/langsmithrb_rails/config_spec.rb[1:3:2] | passed | 0.00014 seconds |
88
+ ./spec/lib/langsmithrb_rails/config_spec.rb[1:3:3:1] | failed | 0.00014 seconds |
89
+ ./spec/lib/langsmithrb_rails/config_spec.rb[1:3:4:1] | failed | 0.00013 seconds |
90
+ ./spec/lib/langsmithrb_rails/config_spec.rb[1:4:1] | passed | 0.0002 seconds |
91
+ ./spec/lib/langsmithrb_rails/config_spec.rb[1:4:2] | passed | 0.00015 seconds |
92
+ ./spec/lib/langsmithrb_rails/config_spec.rb[1:4:3] | passed | 0.00015 seconds |
93
+ ./spec/lib/langsmithrb_rails/config_spec.rb[1:4:4] | passed | 0.00177 seconds |
94
+ ./spec/lib/langsmithrb_rails/config_spec.rb[1:5:1] | failed | 0.00037 seconds |
95
+ ./spec/lib/langsmithrb_rails/config_spec.rb[1:5:2] | passed | 0.00024 seconds |
96
+ ./spec/lib/langsmithrb_rails/config_spec.rb[1:6:1] | passed | 0.00031 seconds |
97
+ ./spec/lib/langsmithrb_rails/config_spec.rb[1:7:1] | passed | 0.00047 seconds |
98
+ ./spec/lib/langsmithrb_rails/config_spec.rb[1:7:2] | passed | 0.00019 seconds |
99
+ ./spec/lib/langsmithrb_rails/config_spec.rb[1:7:3] | passed | 0.00024 seconds |
100
+ ./spec/lib/langsmithrb_rails/config_spec.rb[1:8:1] | passed | 0.00014 seconds |
101
+ ./spec/lib/langsmithrb_rails/config_spec.rb[1:9:1] | passed | 0.00015 seconds |
102
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[1:1:1:1] | passed | 0.00024 seconds |
103
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[1:1:2:1] | passed | 0.00022 seconds |
104
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[1:1:2:2] | passed | 0.00019 seconds |
105
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[1:1:3:1] | passed | 0.00018 seconds |
106
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[1:2:1] | passed | 0.00052 seconds |
107
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[1:3:1] | passed | 0.00052 seconds |
108
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[2:1:1] | passed | 0.00022 seconds |
109
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[2:2:1] | passed | 0.00047 seconds |
110
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[2:2:2:1] | passed | 0.00039 seconds |
111
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[2:3:1] | passed | 0.00059 seconds |
112
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[3:1:1:1] | passed | 0.00049 seconds |
113
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[3:1:1:2] | passed | 0.00758 seconds |
114
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[3:1:1:3:1] | passed | 0.00083 seconds |
115
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[3:1:2:1] | passed | 0.00025 seconds |
116
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[3:1:2:2] | passed | 0.00078 seconds |
117
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[3:1:3:1] | passed | 0.00043 seconds |
118
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[3:1:3:2] | passed | 0.00035 seconds |
119
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[3:1:3:3] | passed | 0.00125 seconds |
120
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[3:1:4:1] | passed | 0.00084 seconds |
121
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[3:1:5:1] | passed | 0.00037 seconds |
122
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[4:1:1:1] | passed | 0.00058 seconds |
123
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[4:1:2:1] | passed | 0.00033 seconds |
124
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[4:1:3:1] | passed | 0.0005 seconds |
125
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[4:1:4:1] | passed | 0.00037 seconds |
126
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[4:1:5:1] | failed | 0.00047 seconds |
127
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[4:1:6:1] | passed | 0.00023 seconds |
128
+ ./spec/lib/langsmithrb_rails/evaluation_spec.rb[4:1:7:1] | passed | 0.00023 seconds |
129
+ ./spec/lib/langsmithrb_rails/otel_spec.rb[1:1:1:1] | failed | 0.00062 seconds |
130
+ ./spec/lib/langsmithrb_rails/otel_spec.rb[1:1:2:1] | passed | 0.00021 seconds |
131
+ ./spec/lib/langsmithrb_rails/otel_spec.rb[1:2:1:1] | failed | 0.0002 seconds |
132
+ ./spec/lib/langsmithrb_rails/otel_spec.rb[1:2:2:1] | passed | 0.00023 seconds |
133
+ ./spec/lib/langsmithrb_rails/otel_spec.rb[1:2:3:1] | passed | 0.00024 seconds |
134
+ ./spec/lib/langsmithrb_rails/otel_spec.rb[1:3:1:1] | failed | 0.0003 seconds |
135
+ ./spec/lib/langsmithrb_rails/otel_spec.rb[2:1:1:1] | passed | 0.0004 seconds |
136
+ ./spec/lib/langsmithrb_rails/otel_spec.rb[2:1:2:1] | passed | 0.00027 seconds |
137
+ ./spec/lib/langsmithrb_rails/otel_spec.rb[2:1:3:1] | passed | 0.00038 seconds |
138
+ ./spec/lib/langsmithrb_rails/otel_spec.rb[2:2:1] | passed | 0.00018 seconds |
139
+ ./spec/lib/langsmithrb_rails/run_trees_spec.rb[1:1:1] | passed | 0.00096 seconds |
140
+ ./spec/lib/langsmithrb_rails/run_trees_spec.rb[1:2:1] | failed | 0.00092 seconds |
141
+ ./spec/lib/langsmithrb_rails/run_trees_spec.rb[1:3:1] | passed | 0.00046 seconds |
142
+ ./spec/lib/langsmithrb_rails/run_trees_spec.rb[1:3:2:1] | passed | 0.00049 seconds |
143
+ ./spec/lib/langsmithrb_rails/run_trees_spec.rb[1:3:3:1] | passed | 0.00058 seconds |
144
+ ./spec/lib/langsmithrb_rails/run_trees_spec.rb[2:1:1] | passed | 0.00036 seconds |
145
+ ./spec/lib/langsmithrb_rails/run_trees_spec.rb[2:1:2:1] | passed | 0.00037 seconds |
146
+ ./spec/lib/langsmithrb_rails/wrappers_spec.rb[1:1:1:1] | passed | 0.0003 seconds |
147
+ ./spec/lib/langsmithrb_rails/wrappers_spec.rb[1:1:2:1] | passed | 0.00039 seconds |
148
+ ./spec/lib/langsmithrb_rails/wrappers_spec.rb[1:1:3:1] | passed | 0.00029 seconds |
149
+ ./spec/lib/langsmithrb_rails/wrappers_spec.rb[1:1:4:1] | passed | 0.0004 seconds |
150
+ ./spec/lib/langsmithrb_rails/wrappers_spec.rb[1:2:1] | passed | 0.00028 seconds |
151
+ ./spec/lib/langsmithrb_rails_spec.rb[1:1:1] | passed | 0.00021 seconds |
152
+ ./spec/lib/langsmithrb_rails_spec.rb[1:1:2] | passed | 0.00016 seconds |
153
+ ./spec/lib/langsmithrb_rails_spec.rb[1:2:1] | passed | 0.00028 seconds |
154
+ ./spec/lib/langsmithrb_rails_spec.rb[1:3:1] | passed | 0.00013 seconds |
155
+ ./spec/lib/langsmithrb_rails_spec.rb[1:4:1] | passed | 0.00017 seconds |
156
+ ./spec/lib/langsmithrb_rails_spec.rb[1:5:1] | passed | 0.00017 seconds |
157
+ ./spec/lib/langsmithrb_rails_spec.rb[1:6:1] | passed | 0.00029 seconds |
158
+ ./spec/lib/langsmithrb_rails_spec.rb[1:7:1] | failed | 0.00017 seconds |
159
+ ./spec/lib/langsmithrb_rails_spec.rb[1:8:1] | passed | 0.00016 seconds |
160
+ ./spec/lib/langsmithrb_rails_spec.rb[1:9:1] | passed | 0.00016 seconds |
161
+ ./spec/lib/langsmithrb_rails_spec.rb[1:10:1] | passed | 0.00112 seconds |
data/CHANGELOG.md ADDED
@@ -0,0 +1,38 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased]
4
+
5
+ ## [0.3.0] - 2025-08-16
6
+
7
+ ### Added
8
+ - OpenTelemetry integration for distributed tracing
9
+ - Advanced run trees for hierarchical tracing
10
+ - Enhanced evaluation framework with string and LLM-based evaluators
11
+ - LLM provider wrappers for OpenAI, Anthropic, and other providers
12
+ - Expanded API coverage to match langsmith-sdk capabilities
13
+
14
+ ### Changed
15
+ - Improved configuration options for OpenTelemetry
16
+ - Enhanced documentation with more examples and use cases
17
+
18
+ ## [0.1.0] - 2025-08-12
19
+
20
+ - Initial release with LangSmith integration for Rails applications
21
+
22
+ ### Added
23
+ - Tracing Generator: Adds middleware, service concerns, and job concerns for request tracing
24
+ - Buffer Generator: Creates migration, model, job, and rake tasks for local buffering of traces
25
+ - Evals Generator: Adds evaluation framework with datasets, checks, and targets
26
+ - CI Generator: GitHub Actions workflow for evaluation in CI
27
+ - Privacy Generator: Custom redaction for PII with configuration
28
+ - Demo Generator: Sample chat application with LangSmith tracing
29
+ - Comprehensive test suite for all generators
30
+ - Detailed documentation for all features in README.md
31
+ - Integration with the langsmithrb gem (v0.1.0) for LangSmith tracing
32
+ - Added Rails generator for easy setup
33
+ - Added automatic tracing of LLM operations in Rails applications
34
+ - Simplified configuration via environment variables
35
+
36
+ ### Changed
37
+ - Improved configuration loading from YAML with environment-specific settings
38
+ - Enhanced PII redaction with extensible patterns, allowlists, and custom hooks
data/Gemfile ADDED
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in langsmithrb_rails.gemspec
6
+ gemspec
7
+
8
+ group :development, :test do
9
+ gem "rspec", "~> 3.0"
10
+ gem "rspec-rails", "~> 6.0"
11
+ gem "generator_spec", "~> 0.9"
12
+ gem "yard", "~> 0.9"
13
+ gem "rubocop", "~> 1.50"
14
+ gem "rubocop-rspec", "~> 2.22"
15
+ gem "rubocop-rails", "~> 2.19"
16
+ gem "simplecov", "~> 0.22.0", require: false
17
+ end
18
+
19
+ gem "rake", "~> 13.0"
20
+ gem "irb"
data/Gemfile.lock ADDED
@@ -0,0 +1,321 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ langsmithrb_rails (0.3.0)
5
+ langsmithrb (~> 0.1.0)
6
+ rails (>= 6.0.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actioncable (8.0.2)
12
+ actionpack (= 8.0.2)
13
+ activesupport (= 8.0.2)
14
+ nio4r (~> 2.0)
15
+ websocket-driver (>= 0.6.1)
16
+ zeitwerk (~> 2.6)
17
+ actionmailbox (8.0.2)
18
+ actionpack (= 8.0.2)
19
+ activejob (= 8.0.2)
20
+ activerecord (= 8.0.2)
21
+ activestorage (= 8.0.2)
22
+ activesupport (= 8.0.2)
23
+ mail (>= 2.8.0)
24
+ actionmailer (8.0.2)
25
+ actionpack (= 8.0.2)
26
+ actionview (= 8.0.2)
27
+ activejob (= 8.0.2)
28
+ activesupport (= 8.0.2)
29
+ mail (>= 2.8.0)
30
+ rails-dom-testing (~> 2.2)
31
+ actionpack (8.0.2)
32
+ actionview (= 8.0.2)
33
+ activesupport (= 8.0.2)
34
+ nokogiri (>= 1.8.5)
35
+ rack (>= 2.2.4)
36
+ rack-session (>= 1.0.1)
37
+ rack-test (>= 0.6.3)
38
+ rails-dom-testing (~> 2.2)
39
+ rails-html-sanitizer (~> 1.6)
40
+ useragent (~> 0.16)
41
+ actiontext (8.0.2)
42
+ actionpack (= 8.0.2)
43
+ activerecord (= 8.0.2)
44
+ activestorage (= 8.0.2)
45
+ activesupport (= 8.0.2)
46
+ globalid (>= 0.6.0)
47
+ nokogiri (>= 1.8.5)
48
+ actionview (8.0.2)
49
+ activesupport (= 8.0.2)
50
+ builder (~> 3.1)
51
+ erubi (~> 1.11)
52
+ rails-dom-testing (~> 2.2)
53
+ rails-html-sanitizer (~> 1.6)
54
+ activejob (8.0.2)
55
+ activesupport (= 8.0.2)
56
+ globalid (>= 0.3.6)
57
+ activemodel (8.0.2)
58
+ activesupport (= 8.0.2)
59
+ activerecord (8.0.2)
60
+ activemodel (= 8.0.2)
61
+ activesupport (= 8.0.2)
62
+ timeout (>= 0.4.0)
63
+ activestorage (8.0.2)
64
+ actionpack (= 8.0.2)
65
+ activejob (= 8.0.2)
66
+ activerecord (= 8.0.2)
67
+ activesupport (= 8.0.2)
68
+ marcel (~> 1.0)
69
+ activesupport (8.0.2)
70
+ base64
71
+ benchmark (>= 0.3)
72
+ bigdecimal
73
+ concurrent-ruby (~> 1.0, >= 1.3.1)
74
+ connection_pool (>= 2.2.5)
75
+ drb
76
+ i18n (>= 1.6, < 2)
77
+ logger (>= 1.4.2)
78
+ minitest (>= 5.1)
79
+ securerandom (>= 0.3)
80
+ tzinfo (~> 2.0, >= 2.0.5)
81
+ uri (>= 0.13.1)
82
+ ast (2.4.3)
83
+ base64 (0.3.0)
84
+ benchmark (0.4.1)
85
+ bigdecimal (3.2.2)
86
+ builder (3.3.0)
87
+ concurrent-ruby (1.3.5)
88
+ connection_pool (2.5.3)
89
+ crass (1.0.6)
90
+ date (3.4.1)
91
+ diff-lcs (1.6.2)
92
+ docile (1.4.1)
93
+ drb (2.2.3)
94
+ erb (5.0.2)
95
+ erubi (1.13.1)
96
+ faraday (2.13.4)
97
+ faraday-net_http (>= 2.0, < 3.5)
98
+ json
99
+ logger
100
+ faraday-net_http (3.4.1)
101
+ net-http (>= 0.5.0)
102
+ generator_spec (0.10.0)
103
+ activesupport (>= 3.0.0)
104
+ railties (>= 3.0.0)
105
+ globalid (1.2.1)
106
+ activesupport (>= 6.1)
107
+ i18n (1.14.7)
108
+ concurrent-ruby (~> 1.0)
109
+ io-console (0.8.1)
110
+ irb (1.15.2)
111
+ pp (>= 0.6.0)
112
+ rdoc (>= 4.0.0)
113
+ reline (>= 0.4.2)
114
+ json (2.13.2)
115
+ langsmithrb (0.1.0)
116
+ faraday (~> 2.7)
117
+ json (~> 2.6)
118
+ zeitwerk (~> 2.5)
119
+ language_server-protocol (3.17.0.5)
120
+ lint_roller (1.1.0)
121
+ logger (1.7.0)
122
+ loofah (2.24.1)
123
+ crass (~> 1.0.2)
124
+ nokogiri (>= 1.12.0)
125
+ mail (2.8.1)
126
+ mini_mime (>= 0.1.1)
127
+ net-imap
128
+ net-pop
129
+ net-smtp
130
+ marcel (1.0.4)
131
+ mini_mime (1.1.5)
132
+ minitest (5.25.5)
133
+ net-http (0.6.0)
134
+ uri
135
+ net-imap (0.5.9)
136
+ date
137
+ net-protocol
138
+ net-pop (0.1.2)
139
+ net-protocol
140
+ net-protocol (0.2.2)
141
+ timeout
142
+ net-smtp (0.5.1)
143
+ net-protocol
144
+ nio4r (2.7.4)
145
+ nokogiri (1.18.9-aarch64-linux-gnu)
146
+ racc (~> 1.4)
147
+ nokogiri (1.18.9-aarch64-linux-musl)
148
+ racc (~> 1.4)
149
+ nokogiri (1.18.9-arm-linux-gnu)
150
+ racc (~> 1.4)
151
+ nokogiri (1.18.9-arm-linux-musl)
152
+ racc (~> 1.4)
153
+ nokogiri (1.18.9-arm64-darwin)
154
+ racc (~> 1.4)
155
+ nokogiri (1.18.9-x86_64-darwin)
156
+ racc (~> 1.4)
157
+ nokogiri (1.18.9-x86_64-linux-gnu)
158
+ racc (~> 1.4)
159
+ nokogiri (1.18.9-x86_64-linux-musl)
160
+ racc (~> 1.4)
161
+ parallel (1.27.0)
162
+ parser (3.3.9.0)
163
+ ast (~> 2.4.1)
164
+ racc
165
+ pp (0.6.2)
166
+ prettyprint
167
+ prettyprint (0.2.0)
168
+ prism (1.4.0)
169
+ psych (5.2.6)
170
+ date
171
+ stringio
172
+ racc (1.8.1)
173
+ rack (3.2.0)
174
+ rack-session (2.1.1)
175
+ base64 (>= 0.1.0)
176
+ rack (>= 3.0.0)
177
+ rack-test (2.2.0)
178
+ rack (>= 1.3)
179
+ rackup (2.2.1)
180
+ rack (>= 3)
181
+ rails (8.0.2)
182
+ actioncable (= 8.0.2)
183
+ actionmailbox (= 8.0.2)
184
+ actionmailer (= 8.0.2)
185
+ actionpack (= 8.0.2)
186
+ actiontext (= 8.0.2)
187
+ actionview (= 8.0.2)
188
+ activejob (= 8.0.2)
189
+ activemodel (= 8.0.2)
190
+ activerecord (= 8.0.2)
191
+ activestorage (= 8.0.2)
192
+ activesupport (= 8.0.2)
193
+ bundler (>= 1.15.0)
194
+ railties (= 8.0.2)
195
+ rails-dom-testing (2.3.0)
196
+ activesupport (>= 5.0.0)
197
+ minitest
198
+ nokogiri (>= 1.6)
199
+ rails-html-sanitizer (1.6.2)
200
+ loofah (~> 2.21)
201
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
202
+ railties (8.0.2)
203
+ actionpack (= 8.0.2)
204
+ activesupport (= 8.0.2)
205
+ irb (~> 1.13)
206
+ rackup (>= 1.0.0)
207
+ rake (>= 12.2)
208
+ thor (~> 1.0, >= 1.2.2)
209
+ zeitwerk (~> 2.6)
210
+ rainbow (3.1.1)
211
+ rake (13.3.0)
212
+ rdoc (6.14.2)
213
+ erb
214
+ psych (>= 4.0.0)
215
+ regexp_parser (2.11.1)
216
+ reline (0.6.2)
217
+ io-console (~> 0.5)
218
+ rspec (3.13.1)
219
+ rspec-core (~> 3.13.0)
220
+ rspec-expectations (~> 3.13.0)
221
+ rspec-mocks (~> 3.13.0)
222
+ rspec-core (3.13.5)
223
+ rspec-support (~> 3.13.0)
224
+ rspec-expectations (3.13.5)
225
+ diff-lcs (>= 1.2.0, < 2.0)
226
+ rspec-support (~> 3.13.0)
227
+ rspec-mocks (3.13.5)
228
+ diff-lcs (>= 1.2.0, < 2.0)
229
+ rspec-support (~> 3.13.0)
230
+ rspec-rails (6.1.5)
231
+ actionpack (>= 6.1)
232
+ activesupport (>= 6.1)
233
+ railties (>= 6.1)
234
+ rspec-core (~> 3.13)
235
+ rspec-expectations (~> 3.13)
236
+ rspec-mocks (~> 3.13)
237
+ rspec-support (~> 3.13)
238
+ rspec-support (3.13.4)
239
+ rubocop (1.79.2)
240
+ json (~> 2.3)
241
+ language_server-protocol (~> 3.17.0.2)
242
+ lint_roller (~> 1.1.0)
243
+ parallel (~> 1.10)
244
+ parser (>= 3.3.0.2)
245
+ rainbow (>= 2.2.2, < 4.0)
246
+ regexp_parser (>= 2.9.3, < 3.0)
247
+ rubocop-ast (>= 1.46.0, < 2.0)
248
+ ruby-progressbar (~> 1.7)
249
+ unicode-display_width (>= 2.4.0, < 4.0)
250
+ rubocop-ast (1.46.0)
251
+ parser (>= 3.3.7.2)
252
+ prism (~> 1.4)
253
+ rubocop-capybara (2.22.1)
254
+ lint_roller (~> 1.1)
255
+ rubocop (~> 1.72, >= 1.72.1)
256
+ rubocop-factory_bot (2.27.1)
257
+ lint_roller (~> 1.1)
258
+ rubocop (~> 1.72, >= 1.72.1)
259
+ rubocop-rails (2.33.1)
260
+ activesupport (>= 4.2.0)
261
+ lint_roller (~> 1.1)
262
+ rack (>= 1.1)
263
+ rubocop (>= 1.75.0, < 2.0)
264
+ rubocop-ast (>= 1.44.0, < 2.0)
265
+ rubocop-rspec (2.31.0)
266
+ rubocop (~> 1.40)
267
+ rubocop-capybara (~> 2.17)
268
+ rubocop-factory_bot (~> 2.22)
269
+ rubocop-rspec_rails (~> 2.28)
270
+ rubocop-rspec_rails (2.29.1)
271
+ rubocop (~> 1.61)
272
+ ruby-progressbar (1.13.0)
273
+ securerandom (0.4.1)
274
+ simplecov (0.22.0)
275
+ docile (~> 1.1)
276
+ simplecov-html (~> 0.11)
277
+ simplecov_json_formatter (~> 0.1)
278
+ simplecov-html (0.13.2)
279
+ simplecov_json_formatter (0.1.4)
280
+ stringio (3.1.7)
281
+ thor (1.4.0)
282
+ timeout (0.4.3)
283
+ tzinfo (2.0.6)
284
+ concurrent-ruby (~> 1.0)
285
+ unicode-display_width (3.1.4)
286
+ unicode-emoji (~> 4.0, >= 4.0.4)
287
+ unicode-emoji (4.0.4)
288
+ uri (1.0.3)
289
+ useragent (0.16.11)
290
+ websocket-driver (0.8.0)
291
+ base64
292
+ websocket-extensions (>= 0.1.0)
293
+ websocket-extensions (0.1.5)
294
+ yard (0.9.37)
295
+ zeitwerk (2.7.3)
296
+
297
+ PLATFORMS
298
+ aarch64-linux-gnu
299
+ aarch64-linux-musl
300
+ arm-linux-gnu
301
+ arm-linux-musl
302
+ arm64-darwin
303
+ x86_64-darwin
304
+ x86_64-linux-gnu
305
+ x86_64-linux-musl
306
+
307
+ DEPENDENCIES
308
+ generator_spec (~> 0.9)
309
+ irb
310
+ langsmithrb_rails!
311
+ rake (~> 13.0)
312
+ rspec (~> 3.0)
313
+ rspec-rails (~> 6.0)
314
+ rubocop (~> 1.50)
315
+ rubocop-rails (~> 2.19)
316
+ rubocop-rspec (~> 2.22)
317
+ simplecov (~> 0.22.0)
318
+ yard (~> 0.9)
319
+
320
+ BUNDLED WITH
321
+ 2.7.1
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Chris
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.