galileo-core 3.87.0__py3-none-any.whl → 3.87.1__py3-none-any.whl

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.
galileo_core/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "3.87.0"
1
+ __version__ = "3.87.1"
@@ -182,7 +182,7 @@ class BaseStep(BaseModel):
182
182
  description="Galileo ID of the trace containing the span (or the same value as id for a trace)",
183
183
  )
184
184
 
185
- model_config = ConfigDict(validate_assignment=True)
185
+ model_config = ConfigDict(validate_assignment=True, from_attributes=True)
186
186
 
187
187
  def __init__(self, **data: Any):
188
188
  for k, v in list(data.items()):
@@ -1,9 +1,9 @@
1
1
  from operator import attrgetter
2
- from typing import Dict, List, Sequence, cast
2
+ from typing import Dict, List, Sequence
3
3
  from uuid import UUID
4
4
 
5
5
  from galileo_core.schemas.logging.session import BaseSession, Session
6
- from galileo_core.schemas.logging.span import Span
6
+ from galileo_core.schemas.logging.span import Span, SpanAdapter
7
7
  from galileo_core.schemas.logging.step import BaseStep, StepType
8
8
  from galileo_core.schemas.logging.trace import Trace
9
9
 
@@ -15,10 +15,13 @@ def create_tree_for_trace(records: Sequence[BaseStep]) -> Sequence[Trace]:
15
15
  for record in records:
16
16
  if record.id is None:
17
17
  raise ValueError("Node ID cannot be None")
18
- if record.type is StepType.trace:
19
- trace_id_to_trace[record.id] = Trace.model_validate(record)
20
- elif record.type is not StepType.session:
21
- span_id_to_span[record.id] = cast(Span, record)
18
+ # Handle both enum and string values for type
19
+ record_type = record.type if isinstance(record.type, StepType) else StepType(record.type)
20
+ if record_type == StepType.trace:
21
+ trace_id_to_trace[record.id] = Trace.model_validate(record, from_attributes=True)
22
+ elif record_type != StepType.session:
23
+ # Use SpanAdapter with discriminator to pick the correct span class
24
+ span_id_to_span[record.id] = SpanAdapter.validate_python(record, from_attributes=True)
22
25
  if (
23
26
  hasattr(record, "parent_id") and record.parent_id is not None
24
27
  ): # Only add value to the parent-child relationship if there is a parent
@@ -51,8 +54,10 @@ def create_tree_for_session(records: Sequence[BaseStep]) -> List[Session]:
51
54
  for record in records:
52
55
  if record.id is None:
53
56
  raise ValueError("Node ID cannot be None")
54
- if record.type is StepType.session:
55
- session = BaseSession.model_validate(record)
57
+ # Handle both enum and string values for type
58
+ record_type = record.type if isinstance(record.type, StepType) else StepType(record.type)
59
+ if record_type == StepType.session:
60
+ session = BaseSession.model_validate(record, from_attributes=True)
56
61
  session_id_to_session[record.id] = Session(**session.model_dump(), traces=[])
57
62
  else:
58
63
  if (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: galileo-core
3
- Version: 3.87.0
3
+ Version: 3.87.1
4
4
  Summary: Shared schemas and configuration for Galileo's Python packages.
5
5
  License: Apache-2.0
6
6
  Keywords: llm,quality,language_models,galileo
@@ -1,4 +1,4 @@
1
- galileo_core/__init__.py,sha256=pIB81K6JBUOh1LQejzdFh2CN2X2gYoCc6j7X24uW2oQ,23
1
+ galileo_core/__init__.py,sha256=JFk7X0ZpQQNC5vJgOTAgZQ7hqeaSnhrPcjt1w7A0GVg,23
2
2
  galileo_core/constants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  galileo_core/constants/config.py,sha256=MYvixj3X3CoiC38QVMdidApURKFOAaPaYoHhFESOJlU,329
4
4
  galileo_core/constants/dataset_format.py,sha256=H6ZigDd2QMpRcRhLC38e0hRoMh0kKbvdhbmS5yK1gZU,116
@@ -74,9 +74,9 @@ galileo_core/schemas/logging/agent.py,sha256=zexqP7o_wjicj4H1ZhrF9wkaYBxcj-skLv_
74
74
  galileo_core/schemas/logging/llm.py,sha256=BN2oya2sqAWdOxthN2bCWCfDXEsjKBTCXjBYWh4Q758,7521
75
75
  galileo_core/schemas/logging/session.py,sha256=R7J5B33ffdQrNpzj7HEBLjQ3rKqNRuHOYttO_-PK378,751
76
76
  galileo_core/schemas/logging/span.py,sha256=smaGm3kvghRi3seaFdMKcgdvRF0ZLerptBIZAh-I6i4,12722
77
- galileo_core/schemas/logging/step.py,sha256=rRwRSeFbUFbnWg6mOfclo3s6VTtPayLE2-7qBMwqKFQ,8702
77
+ galileo_core/schemas/logging/step.py,sha256=Ar0S61lxGAABvZGHt6AeXlPErydvEMy0pXACXWW5uNA,8724
78
78
  galileo_core/schemas/logging/trace.py,sha256=irLlf6XyPL0k326A3u_dfN7sb6TzEdfR8veCXWB3c3o,925
79
- galileo_core/schemas/logging/tree.py,sha256=eC9LR10zARWYl7DFJzGvQrTTaEnaB02Jyxy0NyctZ9c,3188
79
+ galileo_core/schemas/logging/tree.py,sha256=zOiblz_WZIYV0AK_92HZchAyCjabtSr9zs9iEekOUOQ,3658
80
80
  galileo_core/schemas/logging/union.py,sha256=iSQYPqlJkVBxkmxXaGNe6XPIL6nzP-6Ckb5fiO7zrCQ,396
81
81
  galileo_core/schemas/protect/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
82
82
  galileo_core/schemas/protect/action.py,sha256=PmCdiMOdC72m3C--avb4o_IY7DI8Coj61EV80krv7zA,1720
@@ -123,8 +123,8 @@ galileo_core/utils/dataset.py,sha256=wjm3NdNRuxj5mK7GqQUdA-Map_EB0SpFfM1QKapd6-A
123
123
  galileo_core/utils/json.py,sha256=ug5P-iozgmqXRhLZS3Dm_JPViTICboKukg1mqqBq2i4,327
124
124
  galileo_core/utils/name.py,sha256=kaDeZJ1K3-SSazYrUeSbUsQrnZlnOBYU42t-QvX-coE,204
125
125
  galileo_core/utils/scorer_validation.py,sha256=bjNmDZhNsmmb8qHBfndXVAL60W5nCvoDdKrAoAegxJg,11259
126
- galileo_core-3.87.0.dist-info/LICENSE,sha256=4D_6tarPnIYkAqF-0LzrodE9wFtSulO3V4RZf__MriE,10946
127
- galileo_core-3.87.0.dist-info/METADATA,sha256=dY3A2Pz9RVoUFCpmC7cpg-JNwOOGrExLTuzd0HjEgiQ,2731
128
- galileo_core-3.87.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
129
- galileo_core-3.87.0.dist-info/entry_points.txt,sha256=epOvdlN6_7ua8stNHURhJhXDIIrheccwYv0Z-QFmHJU,61
130
- galileo_core-3.87.0.dist-info/RECORD,,
126
+ galileo_core-3.87.1.dist-info/LICENSE,sha256=4D_6tarPnIYkAqF-0LzrodE9wFtSulO3V4RZf__MriE,10946
127
+ galileo_core-3.87.1.dist-info/METADATA,sha256=C2cs_-9OqLEgie5Cks7m_rHuOTYDRe0TI_3vebMxvCU,2731
128
+ galileo_core-3.87.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
129
+ galileo_core-3.87.1.dist-info/entry_points.txt,sha256=epOvdlN6_7ua8stNHURhJhXDIIrheccwYv0Z-QFmHJU,61
130
+ galileo_core-3.87.1.dist-info/RECORD,,