agent-framework-devui 0.0.1a0__py3-none-any.whl → 1.0.0b251007__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.
Potentially problematic release.
This version of agent-framework-devui might be problematic. Click here for more details.
- agent_framework_devui/__init__.py +151 -0
- agent_framework_devui/_cli.py +143 -0
- agent_framework_devui/_discovery.py +822 -0
- agent_framework_devui/_executor.py +777 -0
- agent_framework_devui/_mapper.py +558 -0
- agent_framework_devui/_server.py +577 -0
- agent_framework_devui/_session.py +191 -0
- agent_framework_devui/_tracing.py +168 -0
- agent_framework_devui/_utils.py +421 -0
- agent_framework_devui/models/__init__.py +72 -0
- agent_framework_devui/models/_discovery_models.py +58 -0
- agent_framework_devui/models/_openai_custom.py +209 -0
- agent_framework_devui/ui/agentframework.svg +33 -0
- agent_framework_devui/ui/assets/index-D0SfShuZ.js +445 -0
- agent_framework_devui/ui/assets/index-WsCIE0bH.css +1 -0
- agent_framework_devui/ui/index.html +14 -0
- agent_framework_devui/ui/vite.svg +1 -0
- agent_framework_devui-1.0.0b251007.dist-info/METADATA +172 -0
- agent_framework_devui-1.0.0b251007.dist-info/RECORD +22 -0
- {agent_framework_devui-0.0.1a0.dist-info → agent_framework_devui-1.0.0b251007.dist-info}/WHEEL +1 -2
- agent_framework_devui-1.0.0b251007.dist-info/entry_points.txt +3 -0
- agent_framework_devui-1.0.0b251007.dist-info/licenses/LICENSE +21 -0
- agent_framework_devui-0.0.1a0.dist-info/METADATA +0 -18
- agent_framework_devui-0.0.1a0.dist-info/RECORD +0 -5
- agent_framework_devui-0.0.1a0.dist-info/licenses/LICENSE +0 -9
- agent_framework_devui-0.0.1a0.dist-info/top_level.txt +0 -1
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# Copyright (c) Microsoft. All rights reserved.
|
|
2
|
+
|
|
3
|
+
"""Custom OpenAI-compatible event types for Agent Framework extensions.
|
|
4
|
+
|
|
5
|
+
These are custom event types that extend beyond the standard OpenAI Responses API
|
|
6
|
+
to support Agent Framework specific features like workflows, traces, and function results.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
from typing import Any, Literal
|
|
12
|
+
|
|
13
|
+
from pydantic import BaseModel, ConfigDict
|
|
14
|
+
|
|
15
|
+
# Custom Agent Framework OpenAI event types for structured data
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ResponseWorkflowEventDelta(BaseModel):
|
|
19
|
+
"""Structured workflow event with completion tracking."""
|
|
20
|
+
|
|
21
|
+
type: Literal["response.workflow_event.delta"] = "response.workflow_event.delta"
|
|
22
|
+
delta: dict[str, Any]
|
|
23
|
+
executor_id: str | None = None
|
|
24
|
+
is_complete: bool = False # Track if this is the final part
|
|
25
|
+
item_id: str
|
|
26
|
+
output_index: int = 0
|
|
27
|
+
sequence_number: int
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class ResponseWorkflowEventComplete(BaseModel):
|
|
31
|
+
"""Complete workflow event data."""
|
|
32
|
+
|
|
33
|
+
type: Literal["response.workflow_event.complete"] = "response.workflow_event.complete"
|
|
34
|
+
data: dict[str, Any] # Complete event data, not delta
|
|
35
|
+
executor_id: str | None = None
|
|
36
|
+
item_id: str
|
|
37
|
+
output_index: int = 0
|
|
38
|
+
sequence_number: int
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class ResponseFunctionResultDelta(BaseModel):
|
|
42
|
+
"""Structured function result with completion tracking."""
|
|
43
|
+
|
|
44
|
+
type: Literal["response.function_result.delta"] = "response.function_result.delta"
|
|
45
|
+
delta: dict[str, Any]
|
|
46
|
+
call_id: str
|
|
47
|
+
is_complete: bool = False
|
|
48
|
+
item_id: str
|
|
49
|
+
output_index: int = 0
|
|
50
|
+
sequence_number: int
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class ResponseFunctionResultComplete(BaseModel):
|
|
54
|
+
"""Complete function result data."""
|
|
55
|
+
|
|
56
|
+
type: Literal["response.function_result.complete"] = "response.function_result.complete"
|
|
57
|
+
data: dict[str, Any] # Complete function result data, not delta
|
|
58
|
+
call_id: str
|
|
59
|
+
item_id: str
|
|
60
|
+
output_index: int = 0
|
|
61
|
+
sequence_number: int
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class ResponseTraceEventDelta(BaseModel):
|
|
65
|
+
"""Structured trace event with completion tracking."""
|
|
66
|
+
|
|
67
|
+
type: Literal["response.trace.delta"] = "response.trace.delta"
|
|
68
|
+
delta: dict[str, Any]
|
|
69
|
+
span_id: str | None = None
|
|
70
|
+
is_complete: bool = False
|
|
71
|
+
item_id: str
|
|
72
|
+
output_index: int = 0
|
|
73
|
+
sequence_number: int
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class ResponseTraceEventComplete(BaseModel):
|
|
77
|
+
"""Complete trace event data."""
|
|
78
|
+
|
|
79
|
+
type: Literal["response.trace.complete"] = "response.trace.complete"
|
|
80
|
+
data: dict[str, Any] # Complete trace data, not delta
|
|
81
|
+
span_id: str | None = None
|
|
82
|
+
item_id: str
|
|
83
|
+
output_index: int = 0
|
|
84
|
+
sequence_number: int
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class ResponseUsageEventDelta(BaseModel):
|
|
88
|
+
"""Structured usage event with completion tracking."""
|
|
89
|
+
|
|
90
|
+
type: Literal["response.usage.delta"] = "response.usage.delta"
|
|
91
|
+
delta: dict[str, Any]
|
|
92
|
+
is_complete: bool = False
|
|
93
|
+
item_id: str
|
|
94
|
+
output_index: int = 0
|
|
95
|
+
sequence_number: int
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
class ResponseUsageEventComplete(BaseModel):
|
|
99
|
+
"""Complete usage event data."""
|
|
100
|
+
|
|
101
|
+
type: Literal["response.usage.complete"] = "response.usage.complete"
|
|
102
|
+
data: dict[str, Any] # Complete usage data, not delta
|
|
103
|
+
item_id: str
|
|
104
|
+
output_index: int = 0
|
|
105
|
+
sequence_number: int
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
# Agent Framework extension fields
|
|
109
|
+
class AgentFrameworkExtraBody(BaseModel):
|
|
110
|
+
"""Agent Framework specific routing fields for OpenAI requests."""
|
|
111
|
+
|
|
112
|
+
entity_id: str
|
|
113
|
+
thread_id: str | None = None
|
|
114
|
+
input_data: dict[str, Any] | None = None
|
|
115
|
+
|
|
116
|
+
model_config = ConfigDict(extra="allow")
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
# Agent Framework Request Model - Extending real OpenAI types
|
|
120
|
+
class AgentFrameworkRequest(BaseModel):
|
|
121
|
+
"""OpenAI ResponseCreateParams with Agent Framework extensions.
|
|
122
|
+
|
|
123
|
+
This properly extends the real OpenAI API request format while adding
|
|
124
|
+
our custom routing fields in extra_body.
|
|
125
|
+
"""
|
|
126
|
+
|
|
127
|
+
# All OpenAI fields from ResponseCreateParams
|
|
128
|
+
model: str
|
|
129
|
+
input: str | list[Any] # ResponseInputParam
|
|
130
|
+
stream: bool | None = False
|
|
131
|
+
|
|
132
|
+
# Common OpenAI optional fields
|
|
133
|
+
instructions: str | None = None
|
|
134
|
+
metadata: dict[str, Any] | None = None
|
|
135
|
+
temperature: float | None = None
|
|
136
|
+
max_output_tokens: int | None = None
|
|
137
|
+
tools: list[dict[str, Any]] | None = None
|
|
138
|
+
|
|
139
|
+
# Agent Framework extension - strongly typed
|
|
140
|
+
extra_body: AgentFrameworkExtraBody | None = None
|
|
141
|
+
|
|
142
|
+
entity_id: str | None = None # Allow entity_id as top-level field
|
|
143
|
+
|
|
144
|
+
model_config = ConfigDict(extra="allow")
|
|
145
|
+
|
|
146
|
+
def get_entity_id(self) -> str | None:
|
|
147
|
+
"""Get entity_id from either top-level field or extra_body."""
|
|
148
|
+
# Priority 1: Top-level entity_id field
|
|
149
|
+
if self.entity_id:
|
|
150
|
+
return self.entity_id
|
|
151
|
+
|
|
152
|
+
# Priority 2: entity_id in extra_body
|
|
153
|
+
if self.extra_body and hasattr(self.extra_body, "entity_id"):
|
|
154
|
+
return self.extra_body.entity_id
|
|
155
|
+
|
|
156
|
+
return None
|
|
157
|
+
|
|
158
|
+
def to_openai_params(self) -> dict[str, Any]:
|
|
159
|
+
"""Convert to dict for OpenAI client compatibility."""
|
|
160
|
+
data = self.model_dump(exclude={"extra_body", "entity_id"}, exclude_none=True)
|
|
161
|
+
if self.extra_body:
|
|
162
|
+
# Don't merge extra_body into main params to keep them separate
|
|
163
|
+
data["extra_body"] = self.extra_body
|
|
164
|
+
return data
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
# Error handling
|
|
168
|
+
class ResponseTraceEvent(BaseModel):
|
|
169
|
+
"""Trace event for execution tracing."""
|
|
170
|
+
|
|
171
|
+
type: Literal["trace_event"] = "trace_event"
|
|
172
|
+
data: dict[str, Any]
|
|
173
|
+
timestamp: str
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
class OpenAIError(BaseModel):
|
|
177
|
+
"""OpenAI standard error response model."""
|
|
178
|
+
|
|
179
|
+
error: dict[str, Any]
|
|
180
|
+
|
|
181
|
+
@classmethod
|
|
182
|
+
def create(cls, message: str, type: str = "invalid_request_error", code: str | None = None) -> OpenAIError:
|
|
183
|
+
"""Create a standard OpenAI error response."""
|
|
184
|
+
error_data = {"message": message, "type": type, "code": code}
|
|
185
|
+
return cls(error=error_data)
|
|
186
|
+
|
|
187
|
+
def to_dict(self) -> dict[str, Any]:
|
|
188
|
+
"""Return the error payload as a plain mapping."""
|
|
189
|
+
return {"error": dict(self.error)}
|
|
190
|
+
|
|
191
|
+
def to_json(self) -> str:
|
|
192
|
+
"""Return the error payload serialized to JSON."""
|
|
193
|
+
return self.model_dump_json()
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
# Export all custom types
|
|
197
|
+
__all__ = [
|
|
198
|
+
"AgentFrameworkRequest",
|
|
199
|
+
"OpenAIError",
|
|
200
|
+
"ResponseFunctionResultComplete",
|
|
201
|
+
"ResponseFunctionResultDelta",
|
|
202
|
+
"ResponseTraceEvent",
|
|
203
|
+
"ResponseTraceEventComplete",
|
|
204
|
+
"ResponseTraceEventDelta",
|
|
205
|
+
"ResponseUsageEventComplete",
|
|
206
|
+
"ResponseUsageEventDelta",
|
|
207
|
+
"ResponseWorkflowEventComplete",
|
|
208
|
+
"ResponseWorkflowEventDelta",
|
|
209
|
+
]
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<svg width="805" height="805" viewBox="0 0 805 805" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g filter="url(#filter0_iii_510_1294)">
|
|
3
|
+
<path d="M402.488 119.713C439.197 119.713 468.955 149.472 468.955 186.18C468.955 192.086 471.708 197.849 476.915 200.635L546.702 237.977C555.862 242.879 566.95 240.96 576.092 236.023C585.476 230.955 596.218 228.078 607.632 228.078C644.341 228.078 674.098 257.836 674.099 294.545C674.099 316.95 663.013 336.765 646.028 348.806C637.861 354.595 631.412 363.24 631.412 373.251V430.818C631.412 440.83 637.861 449.475 646.028 455.264C663.013 467.305 674.099 487.121 674.099 509.526C674.099 546.235 644.341 575.994 607.632 575.994C598.598 575.994 589.985 574.191 582.133 570.926C573.644 567.397 563.91 566.393 555.804 570.731L469.581 616.867C469.193 617.074 468.955 617.479 468.955 617.919C468.955 654.628 439.197 684.386 402.488 684.386C365.779 684.386 336.021 654.628 336.021 617.919C336.021 616.802 335.423 615.765 334.439 615.238L249.895 570C241.61 565.567 231.646 566.713 223.034 570.472C214.898 574.024 205.914 575.994 196.47 575.994C159.761 575.994 130.002 546.235 130.002 509.526C130.002 486.66 141.549 466.49 159.13 454.531C167.604 448.766 174.349 439.975 174.349 429.726V372.538C174.349 362.289 167.604 353.498 159.13 347.734C141.549 335.774 130.002 315.604 130.002 292.738C130.002 256.029 159.761 226.271 196.47 226.271C208.223 226.271 219.263 229.322 228.843 234.674C238.065 239.827 249.351 241.894 258.666 236.91L328.655 199.459C333.448 196.895 336.021 191.616 336.021 186.18C336.021 149.471 365.779 119.713 402.488 119.713ZM475.716 394.444C471.337 396.787 468.955 401.586 468.955 406.552C468.955 429.68 457.142 450.048 439.221 461.954C430.571 467.7 423.653 476.574 423.653 486.959V537.511C423.653 547.896 430.746 556.851 439.379 562.622C449 569.053 461.434 572.052 471.637 566.592L527.264 536.826C536.887 531.677 541.164 520.44 541.164 509.526C541.164 485.968 553.42 465.272 571.904 453.468C580.846 447.757 588.054 438.749 588.054 428.139V371.427C588.054 363.494 582.671 356.676 575.716 352.862C569.342 349.366 561.663 348.454 555.253 351.884L475.716 394.444ZM247.992 349.841C241.997 346.633 234.806 347.465 228.873 350.785C222.524 354.337 217.706 360.639 217.706 367.915V429.162C217.706 439.537 224.611 448.404 233.248 454.152C251.144 466.062 262.937 486.417 262.937 509.526C262.937 519.654 267.026 529.991 275.955 534.769L334.852 566.284C344.582 571.49 356.362 568.81 365.528 562.667C373.735 557.166 380.296 548.643 380.296 538.764V486.305C380.296 476.067 373.564 467.282 365.103 461.516C347.548 449.552 336.021 429.398 336.021 406.552C336.021 400.967 333.389 395.536 328.465 392.902L247.992 349.841ZM270.019 280.008C265.421 282.469 262.936 287.522 262.937 292.738C262.937 293.308 262.929 293.876 262.915 294.443C262.615 306.354 266.961 318.871 277.466 324.492L334.017 354.751C344.13 360.163 356.442 357.269 366.027 350.969C376.495 344.088 389.024 340.085 402.488 340.085C416.203 340.085 428.947 344.239 439.532 351.357C449.163 357.834 461.63 360.861 471.864 355.385L526.625 326.083C537.106 320.474 541.458 307.999 541.182 296.115C541.17 295.593 541.164 295.069 541.164 294.545C541.164 288.551 538.376 282.696 533.091 279.868L463.562 242.664C454.384 237.753 443.274 239.688 434.123 244.65C424.716 249.75 413.941 252.647 402.488 252.647C390.83 252.647 379.873 249.646 370.348 244.373C361.148 239.281 349.917 237.256 340.646 242.217L270.019 280.008Z" fill="url(#paint0_linear_510_1294)"/>
|
|
4
|
+
</g>
|
|
5
|
+
<defs>
|
|
6
|
+
<filter id="filter0_iii_510_1294" x="103.759" y="93.4694" width="578.735" height="599.314" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
7
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
8
|
+
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
|
9
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
10
|
+
<feOffset dx="8.39647" dy="8.39647"/>
|
|
11
|
+
<feGaussianBlur stdDeviation="20.9912"/>
|
|
12
|
+
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
|
|
13
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0.835294 0 0 0 0 0.623529 0 0 0 0 1 0 0 0 1 0"/>
|
|
14
|
+
<feBlend mode="normal" in2="shape" result="effect1_innerShadow_510_1294"/>
|
|
15
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
16
|
+
<feOffset dx="-26.2432" dy="-26.2432"/>
|
|
17
|
+
<feGaussianBlur stdDeviation="20.9912"/>
|
|
18
|
+
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
|
|
19
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0.368627 0 0 0 0 0.262745 0 0 0 0 0.564706 0 0 0 0.3 0"/>
|
|
20
|
+
<feBlend mode="plus-darker" in2="effect1_innerShadow_510_1294" result="effect2_innerShadow_510_1294"/>
|
|
21
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
22
|
+
<feOffset dx="-26.2432" dy="-26.2432"/>
|
|
23
|
+
<feGaussianBlur stdDeviation="50"/>
|
|
24
|
+
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
|
|
25
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0.368627 0 0 0 0 0.262745 0 0 0 0 0.564706 0 0 0 0.1 0"/>
|
|
26
|
+
<feBlend mode="plus-darker" in2="effect2_innerShadow_510_1294" result="effect3_innerShadow_510_1294"/>
|
|
27
|
+
</filter>
|
|
28
|
+
<linearGradient id="paint0_linear_510_1294" x1="255.628" y1="-34.3245" x2="618.483" y2="632.032" gradientUnits="userSpaceOnUse">
|
|
29
|
+
<stop stop-color="#D59FFF"/>
|
|
30
|
+
<stop offset="1" stop-color="#8562C5"/>
|
|
31
|
+
</linearGradient>
|
|
32
|
+
</defs>
|
|
33
|
+
</svg>
|