langsmith-sdk 0.4.0 → 0.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60f8521d25bfd486266a608d4ef371ca88966598d65efb62f1ee0d16934e7589
4
- data.tar.gz: 8fcba710ec2d8d5eb8a017baba74b419cddf1ab927343bd3a17afc2430fe8d95
3
+ metadata.gz: 718638cd6397843231c2253c0052e1367103c28e58e52d2a6ec8097ef21ba70d
4
+ data.tar.gz: '08b28bb6955f53fc30020ee7836e386c2c35f4379ba0b7ede5b16b2a9bff1fe5'
5
5
  SHA512:
6
- metadata.gz: 13851df9e6cabd412d88cd45919ba0d8168bc54d9f3168de09c4c9373cf385fd44d96d7b26d949969eb0e5bcae99036a5604e9e7283ede390b31dd875f9d7f2c
7
- data.tar.gz: 4a46c7321921dfcbcb2d7a7828e13d51d9f4c66984903562f265acca9dfde452f97a4ab375d0a5c0587fb4a6fda536655777494cfae1e13b2697f2d048e398ad
6
+ metadata.gz: 5283208ecd982335e8cfe26bb5fa9423b230b3f504975ea186d747e3df9e1c79b41032a40b062bc62cf45e4cbc2514bb541cb0ee4163cb06bea157841abdede0
7
+ data.tar.gz: d4556e99474b6180861876f8c0b36b76bc661a61da94d1eda2cc109607969df9deb6ae8f2222f324aa85a8ee19b39150cf60110fe6e3fba4f3546a1c767d2fe4
data/CHANGELOG.md CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.1] - 2026-11-10
11
+
12
+ ### Changed
13
+
14
+ - Update gem metadata and changelog links after moving the repository to the AirOps GitHub organization.
15
+
16
+ ### Fixed
17
+
18
+ - Mirror user-supplied `metadata` (from `Langsmith.trace(metadata:)` / `Run#add_metadata`) into `extra.metadata` during serialization. The LangSmith UI Metadata panel and Threads detection read run metadata from `extra.metadata` (Python-SDK convention); previously, user metadata was only emitted at top-level `metadata`, so it didn't appear in the UI and thread-grouping keys (`session_id` / `thread_id` / `conversation_id`) weren't detected. Top-level `metadata` is still emitted for backwards compatibility, and keys set by `set_model` / `set_token_usage` / `set_streaming_metrics` continue to win on conflict.
19
+
10
20
  ## [0.4.0] - 2026-02-17
11
21
 
12
22
  ### Added
@@ -101,12 +111,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
101
111
  - `prompt` - Prompt template rendering
102
112
  - `parser` - Output parsing operations
103
113
 
104
- [Unreleased]: https://github.com/felipekb/langsmith-ruby-sdk/compare/v0.4.0...HEAD
105
- [0.4.0]: https://github.com/felipekb/langsmith-ruby-sdk/compare/v0.3.2...v0.4.0
106
- [0.3.2]: https://github.com/felipekb/langsmith-ruby-sdk/compare/v0.3.1...v0.3.2
107
- [0.3.1]: https://github.com/felipekb/langsmith-ruby-sdk/compare/v0.3.0...v0.3.1
108
- [0.3.0]: https://github.com/felipekb/langsmith-ruby-sdk/compare/v0.2.0...v0.3.0
109
- [0.2.0]: https://github.com/felipekb/langsmith-ruby-sdk/compare/v0.1.1...v0.2.0
110
- [0.1.1]: https://github.com/felipekb/langsmith-ruby-sdk/compare/v0.1.0...v0.1.1
111
- [0.1.0]: https://github.com/felipekb/langsmith-ruby-sdk/releases/tag/v0.1.0
114
+ [Unreleased]: https://github.com/airopshq/langsmith-ruby-sdk/compare/v0.4.1...HEAD
115
+ [0.4.1]: https://github.com/airopshq/langsmith-ruby-sdk/compare/v0.4.0...v0.4.1
116
+ [0.4.0]: https://github.com/airopshq/langsmith-ruby-sdk/compare/v0.3.2...v0.4.0
117
+ [0.3.2]: https://github.com/airopshq/langsmith-ruby-sdk/compare/v0.3.1...v0.3.2
118
+ [0.3.1]: https://github.com/airopshq/langsmith-ruby-sdk/compare/v0.3.0...v0.3.1
119
+ [0.3.0]: https://github.com/airopshq/langsmith-ruby-sdk/compare/v0.2.0...v0.3.0
120
+ [0.2.0]: https://github.com/airopshq/langsmith-ruby-sdk/compare/v0.1.1...v0.2.0
121
+ [0.1.1]: https://github.com/airopshq/langsmith-ruby-sdk/compare/v0.1.0...v0.1.1
122
+ [0.1.0]: https://github.com/airopshq/langsmith-ruby-sdk/releases/tag/v0.1.0
112
123
 
data/langsmith.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
 
11
11
  spec.summary = "Ruby SDK for LangSmith tracing and observability"
12
12
  spec.description = "A Ruby client for LangSmith, providing tracing and observability for LLM applications"
13
- spec.homepage = "https://github.com/felipekb/langsmith-ruby-sdk"
13
+ spec.homepage = "https://github.com/airopshq/langsmith-ruby-sdk"
14
14
  spec.license = "MIT"
15
15
  spec.required_ruby_version = ">= 3.1.0"
16
16
 
data/lib/langsmith/run.rb CHANGED
@@ -243,6 +243,9 @@ module Langsmith
243
243
 
244
244
  # Convert to hash for JSON serialization to LangSmith API (full run for POST).
245
245
  # Token usage is stored in extra.metadata.usage_metadata following Python SDK pattern.
246
+ # User-supplied metadata (from `metadata:` / `add_metadata`) is also mirrored
247
+ # into `extra.metadata` so the LangSmith UI Metadata panel and Threads
248
+ # detection (which read from `extra.metadata`) pick it up.
246
249
  #
247
250
  # @return [Hash]
248
251
  def to_h
@@ -261,7 +264,7 @@ module Langsmith
261
264
  session_name:,
262
265
  start_time: start_time.iso8601(3),
263
266
  end_time: end_time&.iso8601(3),
264
- extra: extra.empty? ? nil : extra,
267
+ extra: serialized_extra,
265
268
  events: events.empty? ? nil : events,
266
269
  tags: tags.empty? ? nil : tags,
267
270
  serialized: { name: },
@@ -285,7 +288,7 @@ module Langsmith
285
288
  outputs:,
286
289
  error:,
287
290
  events: events.empty? ? nil : events,
288
- extra: extra.empty? ? nil : extra,
291
+ extra: serialized_extra,
289
292
  tags: tags.empty? ? nil : tags,
290
293
  **(metadata.empty? ? {} : { metadata: })
291
294
  }.compact
@@ -300,6 +303,20 @@ module Langsmith
300
303
 
301
304
  private
302
305
 
306
+ # Builds the `extra` hash for serialization.
307
+ #
308
+ # The LangSmith server (and its UI / Threads detection) reads run metadata
309
+ # from `extra.metadata`. This mirrors user-supplied metadata (from the
310
+ # `metadata:` kwarg or `add_metadata`) into `extra.metadata` so it lands
311
+ # where the server expects, while preserving any keys already written there
312
+ # by `set_model`, `set_token_usage`, or `set_streaming_metrics` (those win
313
+ # on conflict).
314
+ def serialized_extra
315
+ result = extra.dup
316
+ result[:metadata] = metadata.merge(result[:metadata] || {}) unless metadata.empty?
317
+ result.empty? ? nil : result
318
+ end
319
+
303
320
  def validate_run_type(run_type)
304
321
  return run_type if VALID_RUN_TYPES.include?(run_type)
305
322
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Langsmith
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: langsmith-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felipe Cabezudo
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2026-02-17 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: concurrent-ruby
@@ -104,16 +103,15 @@ files:
104
103
  - lib/langsmith/run.rb
105
104
  - lib/langsmith/run_tree.rb
106
105
  - lib/langsmith/version.rb
107
- homepage: https://github.com/felipekb/langsmith-ruby-sdk
106
+ homepage: https://github.com/airopshq/langsmith-ruby-sdk
108
107
  licenses:
109
108
  - MIT
110
109
  metadata:
111
110
  allowed_push_host: https://rubygems.org
112
- homepage_uri: https://github.com/felipekb/langsmith-ruby-sdk
113
- source_code_uri: https://github.com/felipekb/langsmith-ruby-sdk
114
- changelog_uri: https://github.com/felipekb/langsmith-ruby-sdk/blob/main/CHANGELOG.md
111
+ homepage_uri: https://github.com/airopshq/langsmith-ruby-sdk
112
+ source_code_uri: https://github.com/airopshq/langsmith-ruby-sdk
113
+ changelog_uri: https://github.com/airopshq/langsmith-ruby-sdk/blob/main/CHANGELOG.md
115
114
  rubygems_mfa_required: 'true'
116
- post_install_message:
117
115
  rdoc_options: []
118
116
  require_paths:
119
117
  - lib
@@ -128,8 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
126
  - !ruby/object:Gem::Version
129
127
  version: '0'
130
128
  requirements: []
131
- rubygems_version: 3.4.6
132
- signing_key:
129
+ rubygems_version: 4.0.20
133
130
  specification_version: 4
134
131
  summary: Ruby SDK for LangSmith tracing and observability
135
132
  test_files: []