-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathflow_log_response.py
More file actions
185 lines (147 loc) · 6.24 KB
/
flow_log_response.py
File metadata and controls
185 lines (147 loc) · 6.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# This file was auto-generated by Fern from our API Definition.
from __future__ import annotations
import datetime as dt
import typing
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs
from ..core.unchecked_base_model import UncheckedBaseModel
from .chat_message import ChatMessage
from .log_status import LogStatus
class FlowLogResponse(UncheckedBaseModel):
"""
General request for creating a Log
"""
messages: typing.Optional[typing.List[ChatMessage]] = pydantic.Field(default=None)
"""
List of chat messages that were used as an input to the Flow.
"""
output_message: typing.Optional[ChatMessage] = pydantic.Field(default=None)
"""
The output message returned by this Flow.
"""
start_time: typing.Optional[dt.datetime] = pydantic.Field(default=None)
"""
When the logged event started.
"""
end_time: typing.Optional[dt.datetime] = pydantic.Field(default=None)
"""
When the logged event ended.
"""
output: typing.Optional[str] = pydantic.Field(default=None)
"""
Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later.
"""
created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
"""
User defined timestamp for when the log was created.
"""
error: typing.Optional[str] = pydantic.Field(default=None)
"""
Error message if the log is an error.
"""
provider_latency: typing.Optional[float] = pydantic.Field(default=None)
"""
Duration of the logged event in seconds.
"""
stdout: typing.Optional[str] = pydantic.Field(default=None)
"""
Captured log and debug statements.
"""
provider_request: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
"""
Raw request sent to provider.
"""
provider_response: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
"""
Raw response received the provider.
"""
inputs: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
"""
The inputs passed to the Flow Log.
"""
source: typing.Optional[str] = pydantic.Field(default=None)
"""
Identifies where the model was called from.
"""
metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
"""
Any additional metadata to record.
"""
log_status: typing.Optional[LogStatus] = pydantic.Field(default=None)
"""
Status of the Flow Log. When a Flow Log is updated to `complete`, no more Logs can be added to it. You cannot update a Flow Log's status from `complete` to `incomplete`.
"""
source_datapoint_id: typing.Optional[str] = pydantic.Field(default=None)
"""
Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair.
"""
trace_parent_id: typing.Optional[str] = pydantic.Field(default=None)
"""
The ID of the parent Log to nest this Log under in a Trace.
"""
batches: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
"""
Array of Batch IDs that this Log is part of. Batches are used to group Logs together for offline Evaluations
"""
user: typing.Optional[str] = pydantic.Field(default=None)
"""
End-user ID related to the Log.
"""
environment: typing.Optional[str] = pydantic.Field(default=None)
"""
The name of the Environment the Log is associated to.
"""
save: typing.Optional[bool] = pydantic.Field(default=None)
"""
Whether the request/response payloads will be stored on Humanloop.
"""
log_id: typing.Optional[str] = pydantic.Field(default=None)
"""
This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you.
"""
id: str = pydantic.Field()
"""
Unique identifier for the Log.
"""
evaluator_logs: typing.List["EvaluatorLogResponse"] = pydantic.Field()
"""
List of Evaluator Logs associated with the Log. These contain Evaluator judgments on the Log.
"""
trace_flow_id: typing.Optional[str] = pydantic.Field(default=None)
"""
Identifier for the Flow that the Trace belongs to.
"""
trace_id: typing.Optional[str] = pydantic.Field(default=None)
"""
Identifier for the Trace that the Log belongs to.
"""
trace_children: typing.Optional[typing.List["LogResponse"]] = pydantic.Field(default=None)
"""
Logs nested under this Log in the Trace.
"""
flow: "FlowResponse" = pydantic.Field()
"""
Flow used to generate the Log.
"""
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:
class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
from .agent_linked_file_response import AgentLinkedFileResponse # noqa: E402, F401, I001
from .agent_log_response import AgentLogResponse # noqa: E402, F401, I001
from .agent_response import AgentResponse # noqa: E402, F401, I001
from .evaluator_log_response import EvaluatorLogResponse # noqa: E402, F401, I001
from .evaluator_response import EvaluatorResponse # noqa: E402, F401, I001
from .flow_response import FlowResponse # noqa: E402, F401, I001
from .monitoring_evaluator_response import MonitoringEvaluatorResponse # noqa: E402, F401, I001
from .prompt_log_response import PromptLogResponse # noqa: E402, F401, I001
from .prompt_response import PromptResponse # noqa: E402, F401, I001
from .tool_log_response import ToolLogResponse # noqa: E402, F401, I001
from .tool_response import ToolResponse # noqa: E402, F401, I001
from .version_deployment_response import VersionDeploymentResponse # noqa: E402, F401, I001
from .version_id_response import VersionIdResponse # noqa: E402, F401, I001
from .log_response import LogResponse # noqa: E402, F401, I001
update_forward_refs(FlowLogResponse)