galileo-core 3.87.2__py3-none-any.whl → 3.88.0__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.2"
1
+ __version__ = "3.88.0"
@@ -3,9 +3,42 @@ from typing import Dict, List, Sequence, cast
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
+ from galileo_core.schemas.shared.records import RecordType
10
+
11
+
12
+ def records_to_base_steps(records: Sequence[RecordType]) -> List[BaseStep]:
13
+ """
14
+ Convert RecordType objects to BaseStep objects by validating from dicts.
15
+
16
+ This avoids re-validation issues that occur when passing model instances
17
+ directly to create_tree_for_trace/create_tree_for_session. By converting
18
+ to dicts first, Pydantic validates fresh data instead of re-validating
19
+ existing model instances.
20
+
21
+ Args:
22
+ records: Sequence of RecordType objects (TraceRecord, SpanRecord, SessionRecord, etc.)
23
+
24
+ Returns:
25
+ List of BaseStep objects suitable for passing to create_tree_for_trace/create_tree_for_session
26
+ """
27
+ result: List[BaseStep] = []
28
+ for record in records:
29
+ record_dict = record.model_dump()
30
+ record_type = record_dict.get("type")
31
+
32
+ if record_type == StepType.trace:
33
+ # Validate as Trace directly so create_tree_for_trace can use it
34
+ result.append(Trace.model_validate(record_dict))
35
+ elif record_type == StepType.session:
36
+ # Validate as BaseSession - create_tree_for_session will convert to Session
37
+ result.append(BaseSession.model_validate(record_dict))
38
+ else:
39
+ # For spans, validate through SpanAdapter to get correct span type
40
+ result.append(SpanAdapter.validate_python(record_dict))
41
+ return result
9
42
 
10
43
 
11
44
  def create_tree_for_trace(records: Sequence[BaseStep]) -> Sequence[Trace]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: galileo-core
3
- Version: 3.87.2
3
+ Version: 3.88.0
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=sDI65hMIKLXfTatnE7SJ_PbY5MErjhQqcmSDGSFYHfY,23
1
+ galileo_core/__init__.py,sha256=F8ra0owkga0tPRG5jB7lK5XkSV5lY8Fd_Z-wmAIHr4E,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
@@ -76,7 +76,7 @@ galileo_core/schemas/logging/session.py,sha256=R7J5B33ffdQrNpzj7HEBLjQ3rKqNRuHOY
76
76
  galileo_core/schemas/logging/span.py,sha256=smaGm3kvghRi3seaFdMKcgdvRF0ZLerptBIZAh-I6i4,12722
77
77
  galileo_core/schemas/logging/step.py,sha256=rRwRSeFbUFbnWg6mOfclo3s6VTtPayLE2-7qBMwqKFQ,8702
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=QZT2b77ASckcH3DOAF7_hMEDpoh4Rq1A0XvpQcF58qE,4622
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.2.dist-info/LICENSE,sha256=4D_6tarPnIYkAqF-0LzrodE9wFtSulO3V4RZf__MriE,10946
127
- galileo_core-3.87.2.dist-info/METADATA,sha256=B8w8DK81hJoZ5DJp_y16vpE3zkNweCTylWICF3pH52U,2731
128
- galileo_core-3.87.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
129
- galileo_core-3.87.2.dist-info/entry_points.txt,sha256=epOvdlN6_7ua8stNHURhJhXDIIrheccwYv0Z-QFmHJU,61
130
- galileo_core-3.87.2.dist-info/RECORD,,
126
+ galileo_core-3.88.0.dist-info/LICENSE,sha256=4D_6tarPnIYkAqF-0LzrodE9wFtSulO3V4RZf__MriE,10946
127
+ galileo_core-3.88.0.dist-info/METADATA,sha256=ferBML3uAZ_CaVUheREXRi5FvmqXWgzYi4hh_ULbdpQ,2731
128
+ galileo_core-3.88.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
129
+ galileo_core-3.88.0.dist-info/entry_points.txt,sha256=epOvdlN6_7ua8stNHURhJhXDIIrheccwYv0Z-QFmHJU,61
130
+ galileo_core-3.88.0.dist-info/RECORD,,