agent-framework-devui 1.0.0b251007__tar.gz → 1.0.0b251016__tar.gz

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.

Files changed (134) hide show
  1. agent_framework_devui-1.0.0b251016/PKG-INFO +286 -0
  2. agent_framework_devui-1.0.0b251016/README.md +253 -0
  3. agent_framework_devui-1.0.0b251016/agent_framework_devui/_conversations.py +473 -0
  4. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/agent_framework_devui/_discovery.py +295 -325
  5. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/agent_framework_devui/_executor.py +99 -241
  6. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/agent_framework_devui/_mapper.py +281 -78
  7. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/agent_framework_devui/_server.py +232 -239
  8. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/agent_framework_devui/_utils.py +127 -0
  9. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/agent_framework_devui/models/__init__.py +15 -10
  10. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/agent_framework_devui/models/_discovery_models.py +1 -2
  11. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/agent_framework_devui/models/_openai_custom.py +45 -90
  12. agent_framework_devui-1.0.0b251016/agent_framework_devui/ui/assets/index-CE4pGoXh.css +1 -0
  13. agent_framework_devui-1.0.0b251016/agent_framework_devui/ui/assets/index-DmL7WSFa.js +577 -0
  14. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/agent_framework_devui/ui/index.html +2 -2
  15. agent_framework_devui-1.0.0b251016/dev.md +164 -0
  16. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/package.json +2 -1
  17. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/App.tsx +166 -252
  18. agent_framework_devui-1.0.0b251016/frontend/src/components/features/agent/agent-view.tsx +1450 -0
  19. agent_framework_devui-1.0.0b251016/frontend/src/components/features/agent/index.ts +7 -0
  20. agent_framework_devui-1.0.0b251016/frontend/src/components/features/agent/message-renderers/OpenAIContentRenderer.tsx +262 -0
  21. agent_framework_devui-1.0.0b251016/frontend/src/components/features/agent/message-renderers/OpenAIMessageRenderer.tsx +77 -0
  22. agent_framework_devui-1.0.0b251016/frontend/src/components/features/agent/message-renderers/index.ts +7 -0
  23. {agent_framework_devui-1.0.0b251007/frontend/src/components → agent_framework_devui-1.0.0b251016/frontend/src/components/features}/gallery/gallery-view.tsx +77 -177
  24. agent_framework_devui-1.0.0b251016/frontend/src/components/features/gallery/setup-instructions-modal.tsx +207 -0
  25. agent_framework_devui-1.0.0b251016/frontend/src/components/features/workflow/index.ts +9 -0
  26. {agent_framework_devui-1.0.0b251007/frontend/src/components → agent_framework_devui-1.0.0b251016/frontend/src/components/features}/workflow/workflow-flow.tsx +5 -5
  27. {agent_framework_devui-1.0.0b251007/frontend/src/components → agent_framework_devui-1.0.0b251016/frontend/src/components/features}/workflow/workflow-input-form.tsx +17 -10
  28. {agent_framework_devui-1.0.0b251007/frontend/src/components → agent_framework_devui-1.0.0b251016/frontend/src/components/features}/workflow/workflow-view.tsx +381 -72
  29. {agent_framework_devui-1.0.0b251007/frontend/src/components/shared → agent_framework_devui-1.0.0b251016/frontend/src/components/layout}/app-header.tsx +2 -5
  30. {agent_framework_devui-1.0.0b251007/frontend/src/components/shared → agent_framework_devui-1.0.0b251016/frontend/src/components/layout}/debug-panel.tsx +393 -170
  31. agent_framework_devui-1.0.0b251016/frontend/src/components/layout/deployment-modal.tsx +519 -0
  32. {agent_framework_devui-1.0.0b251007/frontend/src/components/shared → agent_framework_devui-1.0.0b251016/frontend/src/components/layout}/entity-selector.tsx +20 -95
  33. agent_framework_devui-1.0.0b251016/frontend/src/components/layout/index.ts +10 -0
  34. {agent_framework_devui-1.0.0b251007/frontend/src/components/shared → agent_framework_devui-1.0.0b251016/frontend/src/components/layout}/settings-modal.tsx +34 -34
  35. agent_framework_devui-1.0.0b251016/frontend/src/components/ui/alert.tsx +48 -0
  36. agent_framework_devui-1.0.0b251016/frontend/src/components/ui/markdown-renderer.tsx +565 -0
  37. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/data/gallery/sample-entities.ts +4 -34
  38. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/services/api.ts +111 -111
  39. agent_framework_devui-1.0.0b251016/frontend/src/stores/devuiStore.ts +309 -0
  40. agent_framework_devui-1.0.0b251016/frontend/src/stores/index.ts +5 -0
  41. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/types/agent-framework.ts +24 -3
  42. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/types/index.ts +22 -16
  43. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/types/openai.ts +171 -33
  44. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/types/workflow.ts +8 -0
  45. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/utils/simple-layout.ts +1 -1
  46. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/utils/workflow-utils.ts +19 -2
  47. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/vite.config.ts +0 -10
  48. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/yarn.lock +6 -1
  49. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/pyproject.toml +1 -1
  50. agent_framework_devui-1.0.0b251016/samples/README.md +38 -0
  51. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/tests/capture_messages.py +14 -71
  52. agent_framework_devui-1.0.0b251016/tests/test_conversations.py +335 -0
  53. agent_framework_devui-1.0.0b251016/tests/test_discovery.py +367 -0
  54. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/tests/test_execution.py +78 -17
  55. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/tests/test_mapper.py +34 -8
  56. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/tests/test_server.py +18 -14
  57. agent_framework_devui-1.0.0b251007/PKG-INFO +0 -172
  58. agent_framework_devui-1.0.0b251007/README.md +0 -139
  59. agent_framework_devui-1.0.0b251007/agent_framework_devui/ui/assets/index-D0SfShuZ.js +0 -445
  60. agent_framework_devui-1.0.0b251007/agent_framework_devui/ui/assets/index-WsCIE0bH.css +0 -1
  61. agent_framework_devui-1.0.0b251007/dev.md +0 -132
  62. agent_framework_devui-1.0.0b251007/frontend/src/components/agent/agent-view.tsx +0 -1192
  63. agent_framework_devui-1.0.0b251007/frontend/src/components/message_renderer/ContentRenderer.tsx +0 -331
  64. agent_framework_devui-1.0.0b251007/frontend/src/components/message_renderer/MessageRenderer.tsx +0 -38
  65. agent_framework_devui-1.0.0b251007/frontend/src/components/message_renderer/StreamingRenderer.tsx +0 -114
  66. agent_framework_devui-1.0.0b251007/frontend/src/components/message_renderer/index.ts +0 -8
  67. agent_framework_devui-1.0.0b251007/frontend/src/components/message_renderer/types.ts +0 -48
  68. agent_framework_devui-1.0.0b251007/samples/fanout_workflow/__init__.py +0 -3
  69. agent_framework_devui-1.0.0b251007/samples/fanout_workflow/workflow.py +0 -700
  70. agent_framework_devui-1.0.0b251007/samples/foundry_agent/__init__.py +0 -7
  71. agent_framework_devui-1.0.0b251007/samples/foundry_agent/agent.py +0 -81
  72. agent_framework_devui-1.0.0b251007/samples/in_memory_mode.py +0 -71
  73. agent_framework_devui-1.0.0b251007/samples/spam_workflow/__init__.py +0 -7
  74. agent_framework_devui-1.0.0b251007/samples/spam_workflow/workflow.py +0 -333
  75. agent_framework_devui-1.0.0b251007/samples/weather_agent/__init__.py +0 -7
  76. agent_framework_devui-1.0.0b251007/samples/weather_agent/agent.py +0 -69
  77. agent_framework_devui-1.0.0b251007/samples/weather_agent_azure/__init__.py +0 -7
  78. agent_framework_devui-1.0.0b251007/samples/weather_agent_azure/agent.py +0 -133
  79. agent_framework_devui-1.0.0b251007/samples/workflow_agents/__init__.py +0 -7
  80. agent_framework_devui-1.0.0b251007/samples/workflow_agents/workflow.py +0 -167
  81. agent_framework_devui-1.0.0b251007/tests/test_discovery.py +0 -99
  82. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/.gitignore +0 -0
  83. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/LICENSE +0 -0
  84. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/agent_framework_devui/__init__.py +0 -0
  85. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/agent_framework_devui/_cli.py +0 -0
  86. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/agent_framework_devui/_session.py +0 -0
  87. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/agent_framework_devui/_tracing.py +0 -0
  88. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/agent_framework_devui/ui/agentframework.svg +0 -0
  89. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/agent_framework_devui/ui/vite.svg +0 -0
  90. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/docs/devuiscreen.png +0 -0
  91. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/.gitignore +0 -0
  92. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/README.md +0 -0
  93. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/components.json +0 -0
  94. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/eslint.config.js +0 -0
  95. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/index.html +0 -0
  96. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/public/agentframework.svg +0 -0
  97. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/public/vite.svg +0 -0
  98. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/App.css +0 -0
  99. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/assets/react.svg +0 -0
  100. {agent_framework_devui-1.0.0b251007/frontend/src/components/shared → agent_framework_devui-1.0.0b251016/frontend/src/components/features/agent}/agent-details-modal.tsx +0 -0
  101. {agent_framework_devui-1.0.0b251007/frontend/src/components → agent_framework_devui-1.0.0b251016/frontend/src/components/features}/gallery/index.ts +0 -0
  102. {agent_framework_devui-1.0.0b251007/frontend/src/components → agent_framework_devui-1.0.0b251016/frontend/src/components/features}/workflow/executor-node.tsx +0 -0
  103. {agent_framework_devui-1.0.0b251007/frontend/src/components/shared → agent_framework_devui-1.0.0b251016/frontend/src/components/features/workflow}/workflow-details-modal.tsx +0 -0
  104. {agent_framework_devui-1.0.0b251007/frontend/src/components/shared → agent_framework_devui-1.0.0b251016/frontend/src/components/layout}/about-modal.tsx +0 -0
  105. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/components/mode-toggle.tsx +0 -0
  106. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/components/theme-provider.tsx +0 -0
  107. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/components/ui/attachment-gallery.tsx +0 -0
  108. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/components/ui/badge.tsx +0 -0
  109. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/components/ui/button.tsx +0 -0
  110. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/components/ui/card.tsx +0 -0
  111. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/components/ui/checkbox.tsx +0 -0
  112. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/components/ui/dialog.tsx +0 -0
  113. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/components/ui/dropdown-menu.tsx +0 -0
  114. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/components/ui/file-upload.tsx +0 -0
  115. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/components/ui/input.tsx +0 -0
  116. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/components/ui/label.tsx +0 -0
  117. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/components/ui/loading-spinner.tsx +0 -0
  118. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/components/ui/loading-state.tsx +0 -0
  119. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/components/ui/scroll-area.tsx +0 -0
  120. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/components/ui/select.tsx +0 -0
  121. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/components/ui/tabs.tsx +0 -0
  122. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/components/ui/textarea.tsx +0 -0
  123. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/components/ui/toast.tsx +0 -0
  124. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/data/gallery/index.ts +0 -0
  125. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/hooks/useWorkflowEventCorrelation.ts +0 -0
  126. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/index.css +0 -0
  127. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/lib/utils.ts +0 -0
  128. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/main.tsx +0 -0
  129. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/src/vite-env.d.ts +0 -0
  130. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/tsconfig.app.json +0 -0
  131. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/tsconfig.json +0 -0
  132. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/frontend/tsconfig.node.json +0 -0
  133. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/samples/__init__.py +0 -0
  134. {agent_framework_devui-1.0.0b251007 → agent_framework_devui-1.0.0b251016}/tests/test_schema_generation.py +0 -0
@@ -0,0 +1,286 @@
1
+ Metadata-Version: 2.4
2
+ Name: agent-framework-devui
3
+ Version: 1.0.0b251016
4
+ Summary: Debug UI for Microsoft Agent Framework with OpenAI-compatible API server.
5
+ Author-email: Microsoft <af-support@microsoft.com>
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Typing :: Typed
17
+ License-File: LICENSE
18
+ Requires-Dist: agent-framework-core
19
+ Requires-Dist: fastapi>=0.104.0
20
+ Requires-Dist: uvicorn[standard]>=0.24.0
21
+ Requires-Dist: python-dotenv>=1.0.0
22
+ Requires-Dist: pytest>=7.0.0 ; extra == "all"
23
+ Requires-Dist: watchdog>=3.0.0 ; extra == "all"
24
+ Requires-Dist: pytest>=7.0.0 ; extra == "dev"
25
+ Requires-Dist: watchdog>=3.0.0 ; extra == "dev"
26
+ Project-URL: homepage, https://github.com/microsoft/agent-framework
27
+ Project-URL: issues, https://github.com/microsoft/agent-framework/issues
28
+ Project-URL: release_notes, https://github.com/microsoft/agent-framework/releases?q=tag%3Apython-1&expanded=true
29
+ Project-URL: source, https://github.com/microsoft/agent-framework/tree/main/python
30
+ Provides-Extra: all
31
+ Provides-Extra: dev
32
+
33
+ # DevUI - A Sample App for Running Agents and Workflows
34
+
35
+ A lightweight, standalone sample app interface for running entities (agents/workflows) in the Microsoft Agent Framework supporting **directory-based discovery**, **in-memory entity registration**, and **sample entity gallery**.
36
+
37
+ > [!IMPORTANT]
38
+ > DevUI is a **sample app** to help you get started with the Agent Framework. It is **not** intended for production use. For production, or for features beyond what is provided in this sample app, it is recommended that you build your own custom interface and API server using the Agent Framework SDK.
39
+
40
+ ![DevUI Screenshot](./docs/devuiscreen.png)
41
+
42
+ ## Quick Start
43
+
44
+ ```bash
45
+ # Install
46
+ pip install agent-framework-devui --pre
47
+ ```
48
+
49
+ You can also launch it programmatically
50
+
51
+ ```python
52
+ from agent_framework import ChatAgent
53
+ from agent_framework.openai import OpenAIChatClient
54
+ from agent_framework.devui import serve
55
+
56
+ def get_weather(location: str) -> str:
57
+ """Get weather for a location."""
58
+ return f"Weather in {location}: 72°F and sunny"
59
+
60
+ # Create your agent
61
+ agent = ChatAgent(
62
+ name="WeatherAgent",
63
+ chat_client=OpenAIChatClient(),
64
+ tools=[get_weather]
65
+ )
66
+
67
+ # Launch debug UI - that's it!
68
+ serve(entities=[agent], auto_open=True)
69
+ # → Opens browser to http://localhost:8080
70
+ ```
71
+
72
+ In addition, if you have agents/workflows defined in a specific directory structure (see below), you can launch DevUI from the _cli_ to discover and run them.
73
+
74
+ ```bash
75
+
76
+ # Launch web UI + API server
77
+ devui ./agents --port 8080
78
+ # → Web UI: http://localhost:8080
79
+ # → API: http://localhost:8080/v1/*
80
+ ```
81
+
82
+ When DevUI starts with no discovered entities, it displays a **sample entity gallery** with curated examples from the Agent Framework repository. You can download these samples, review them, and run them locally to get started quickly.
83
+
84
+ ## Directory Structure
85
+
86
+ For your agents to be discovered by the DevUI, they must be organized in a directory structure like below. Each agent/workflow must have an `__init__.py` that exports the required variable (`agent` or `workflow`).
87
+
88
+ **Note**: `.env` files are optional but will be automatically loaded if present in the agent/workflow directory or parent entities directory. Use them to store API keys, configuration variables, and other environment-specific settings.
89
+
90
+ ```
91
+ agents/
92
+ ├── weather_agent/
93
+ │ ├── __init__.py # Must export: agent = ChatAgent(...)
94
+ │ ├── agent.py
95
+ │ └── .env # Optional: API keys, config vars
96
+ ├── my_workflow/
97
+ │ ├── __init__.py # Must export: workflow = WorkflowBuilder()...
98
+ │ ├── workflow.py
99
+ │ └── .env # Optional: environment variables
100
+ └── .env # Optional: shared environment variables
101
+ ```
102
+
103
+ ## Viewing Telemetry (Otel Traces) in DevUI
104
+
105
+ Agent Framework emits OpenTelemetry (Otel) traces for various operations. You can view these traces in DevUI by enabling tracing when starting the server.
106
+
107
+ ```bash
108
+ devui ./agents --tracing framework
109
+ ```
110
+
111
+ ## OpenAI-Compatible API
112
+
113
+ For convenience, DevUI provides an OpenAI Responses backend API. This means you can run the backend and also use the OpenAI client sdk to connect to it. Use **agent/workflow name as the model**, and set streaming to `True` as needed.
114
+
115
+ ```bash
116
+ # Simple - use your entity name as the model
117
+ curl -X POST http://localhost:8080/v1/responses \
118
+ -H "Content-Type: application/json" \
119
+ -d @- << 'EOF'
120
+ {
121
+ "model": "weather_agent",
122
+ "input": "Hello world"
123
+ }
124
+ ```
125
+
126
+ Or use the OpenAI Python SDK:
127
+
128
+ ```python
129
+ from openai import OpenAI
130
+
131
+ client = OpenAI(
132
+ base_url="http://localhost:8080/v1",
133
+ api_key="not-needed" # API key not required for local DevUI
134
+ )
135
+
136
+ response = client.responses.create(
137
+ model="weather_agent", # Your agent/workflow name
138
+ input="What's the weather in Seattle?"
139
+ )
140
+
141
+ # Extract text from response
142
+ print(response.output[0].content[0].text)
143
+ # Supports streaming with stream=True
144
+ ```
145
+
146
+ ### Multi-turn Conversations
147
+
148
+ Use the standard OpenAI `conversation` parameter for multi-turn conversations:
149
+
150
+ ```python
151
+ # Create a conversation
152
+ conversation = client.conversations.create(
153
+ metadata={"agent_id": "weather_agent"}
154
+ )
155
+
156
+ # Use it across multiple turns
157
+ response1 = client.responses.create(
158
+ model="weather_agent",
159
+ input="What's the weather in Seattle?",
160
+ conversation=conversation.id
161
+ )
162
+
163
+ response2 = client.responses.create(
164
+ model="weather_agent",
165
+ input="How about tomorrow?",
166
+ conversation=conversation.id # Continues the conversation!
167
+ )
168
+ ```
169
+
170
+ **How it works:** DevUI automatically retrieves the conversation's message history from the stored thread and passes it to the agent. You don't need to manually manage message history - just provide the same `conversation` ID for follow-up requests.
171
+
172
+ ## CLI Options
173
+
174
+ ```bash
175
+ devui [directory] [options]
176
+
177
+ Options:
178
+ --port, -p Port (default: 8080)
179
+ --host Host (default: 127.0.0.1)
180
+ --headless API only, no UI
181
+ --config YAML config file
182
+ --tracing none|framework|workflow|all
183
+ --reload Enable auto-reload
184
+ ```
185
+
186
+ ## Key Endpoints
187
+
188
+ ## API Mapping
189
+
190
+ Given that DevUI offers an OpenAI Responses API, it internally maps messages and events from Agent Framework to OpenAI Responses API events (in `_mapper.py`). For transparency, this mapping is shown below:
191
+
192
+ | Agent Framework Content | OpenAI Event/Type | Status |
193
+ | ------------------------------- | ---------------------------------------- | -------- |
194
+ | `TextContent` | `response.output_text.delta` | Standard |
195
+ | `TextReasoningContent` | `response.reasoning_text.delta` | Standard |
196
+ | `FunctionCallContent` (initial) | `response.output_item.added` | Standard |
197
+ | `FunctionCallContent` (args) | `response.function_call_arguments.delta` | Standard |
198
+ | `FunctionResultContent` | `response.function_result.complete` | DevUI |
199
+ | `FunctionApprovalRequestContent`| `response.function_approval.requested` | DevUI |
200
+ | `FunctionApprovalResponseContent`| `response.function_approval.responded` | DevUI |
201
+ | `ErrorContent` | `error` | Standard |
202
+ | `UsageContent` | Final `Response.usage` field (not streamed) | Standard |
203
+ | `WorkflowEvent` | `response.workflow_event.complete` | DevUI |
204
+ | `DataContent` | `response.trace.complete` | DevUI |
205
+ | `UriContent` | `response.trace.complete` | DevUI |
206
+ | `HostedFileContent` | `response.trace.complete` | DevUI |
207
+ | `HostedVectorStoreContent` | `response.trace.complete` | DevUI |
208
+
209
+ - **Standard** = OpenAI Responses API spec
210
+ - **DevUI** = Custom extensions for Agent Framework features (workflows, traces, function approvals)
211
+
212
+ ### OpenAI Responses API Compliance
213
+
214
+ DevUI follows the OpenAI Responses API specification for maximum compatibility:
215
+
216
+ **Standard OpenAI Types Used:**
217
+ - `ResponseOutputItemAddedEvent` - Output item notifications (function calls and results)
218
+ - `Response.usage` - Token usage (in final response, not streamed)
219
+ - All standard text, reasoning, and function call events
220
+
221
+ **Custom DevUI Extensions:**
222
+ - `response.function_approval.requested` - Function approval requests (for interactive approval workflows)
223
+ - `response.function_approval.responded` - Function approval responses (user approval/rejection)
224
+ - `response.workflow_event.complete` - Agent Framework workflow events
225
+ - `response.trace.complete` - Execution traces and internal content (DataContent, UriContent, hosted files/stores)
226
+
227
+ These custom extensions are clearly namespaced and can be safely ignored by standard OpenAI clients.
228
+
229
+ ### Entity Management
230
+
231
+ - `GET /v1/entities` - List discovered agents/workflows
232
+ - `GET /v1/entities/{entity_id}/info` - Get detailed entity information
233
+ - `POST /v1/entities/{entity_id}/reload` - Hot reload entity (for development)
234
+
235
+ ### Execution (OpenAI Responses API)
236
+
237
+ - `POST /v1/responses` - Execute agent/workflow (streaming or sync)
238
+
239
+ ### Conversations (OpenAI Standard)
240
+
241
+ - `POST /v1/conversations` - Create conversation
242
+ - `GET /v1/conversations/{id}` - Get conversation
243
+ - `POST /v1/conversations/{id}` - Update conversation metadata
244
+ - `DELETE /v1/conversations/{id}` - Delete conversation
245
+ - `GET /v1/conversations?agent_id={id}` - List conversations _(DevUI extension)_
246
+ - `POST /v1/conversations/{id}/items` - Add items to conversation
247
+ - `GET /v1/conversations/{id}/items` - List conversation items
248
+ - `GET /v1/conversations/{id}/items/{item_id}` - Get conversation item
249
+
250
+ ### Health
251
+
252
+ - `GET /health` - Health check
253
+
254
+ ## Security
255
+
256
+ DevUI is designed as a **sample application for local development** and should not be exposed to untrusted networks or used in production environments.
257
+
258
+ **Security features:**
259
+ - Only loads entities from local directories or in-memory registration
260
+ - No remote code execution capabilities
261
+ - Binds to localhost (127.0.0.1) by default
262
+ - All samples must be manually downloaded and reviewed before running
263
+
264
+ **Best practices:**
265
+ - Never expose DevUI to the internet
266
+ - Review all agent/workflow code before running
267
+ - Only load entities from trusted sources
268
+ - Use `.env` files for sensitive credentials (never commit them)
269
+
270
+ ## Implementation
271
+
272
+ - **Discovery**: `agent_framework_devui/_discovery.py`
273
+ - **Execution**: `agent_framework_devui/_executor.py`
274
+ - **Message Mapping**: `agent_framework_devui/_mapper.py`
275
+ - **Conversations**: `agent_framework_devui/_conversations.py`
276
+ - **API Server**: `agent_framework_devui/_server.py`
277
+ - **CLI**: `agent_framework_devui/_cli.py`
278
+
279
+ ## Examples
280
+
281
+ See working implementations in `python/samples/getting_started/devui/`
282
+
283
+ ## License
284
+
285
+ MIT
286
+
@@ -0,0 +1,253 @@
1
+ # DevUI - A Sample App for Running Agents and Workflows
2
+
3
+ A lightweight, standalone sample app interface for running entities (agents/workflows) in the Microsoft Agent Framework supporting **directory-based discovery**, **in-memory entity registration**, and **sample entity gallery**.
4
+
5
+ > [!IMPORTANT]
6
+ > DevUI is a **sample app** to help you get started with the Agent Framework. It is **not** intended for production use. For production, or for features beyond what is provided in this sample app, it is recommended that you build your own custom interface and API server using the Agent Framework SDK.
7
+
8
+ ![DevUI Screenshot](./docs/devuiscreen.png)
9
+
10
+ ## Quick Start
11
+
12
+ ```bash
13
+ # Install
14
+ pip install agent-framework-devui --pre
15
+ ```
16
+
17
+ You can also launch it programmatically
18
+
19
+ ```python
20
+ from agent_framework import ChatAgent
21
+ from agent_framework.openai import OpenAIChatClient
22
+ from agent_framework.devui import serve
23
+
24
+ def get_weather(location: str) -> str:
25
+ """Get weather for a location."""
26
+ return f"Weather in {location}: 72°F and sunny"
27
+
28
+ # Create your agent
29
+ agent = ChatAgent(
30
+ name="WeatherAgent",
31
+ chat_client=OpenAIChatClient(),
32
+ tools=[get_weather]
33
+ )
34
+
35
+ # Launch debug UI - that's it!
36
+ serve(entities=[agent], auto_open=True)
37
+ # → Opens browser to http://localhost:8080
38
+ ```
39
+
40
+ In addition, if you have agents/workflows defined in a specific directory structure (see below), you can launch DevUI from the _cli_ to discover and run them.
41
+
42
+ ```bash
43
+
44
+ # Launch web UI + API server
45
+ devui ./agents --port 8080
46
+ # → Web UI: http://localhost:8080
47
+ # → API: http://localhost:8080/v1/*
48
+ ```
49
+
50
+ When DevUI starts with no discovered entities, it displays a **sample entity gallery** with curated examples from the Agent Framework repository. You can download these samples, review them, and run them locally to get started quickly.
51
+
52
+ ## Directory Structure
53
+
54
+ For your agents to be discovered by the DevUI, they must be organized in a directory structure like below. Each agent/workflow must have an `__init__.py` that exports the required variable (`agent` or `workflow`).
55
+
56
+ **Note**: `.env` files are optional but will be automatically loaded if present in the agent/workflow directory or parent entities directory. Use them to store API keys, configuration variables, and other environment-specific settings.
57
+
58
+ ```
59
+ agents/
60
+ ├── weather_agent/
61
+ │ ├── __init__.py # Must export: agent = ChatAgent(...)
62
+ │ ├── agent.py
63
+ │ └── .env # Optional: API keys, config vars
64
+ ├── my_workflow/
65
+ │ ├── __init__.py # Must export: workflow = WorkflowBuilder()...
66
+ │ ├── workflow.py
67
+ │ └── .env # Optional: environment variables
68
+ └── .env # Optional: shared environment variables
69
+ ```
70
+
71
+ ## Viewing Telemetry (Otel Traces) in DevUI
72
+
73
+ Agent Framework emits OpenTelemetry (Otel) traces for various operations. You can view these traces in DevUI by enabling tracing when starting the server.
74
+
75
+ ```bash
76
+ devui ./agents --tracing framework
77
+ ```
78
+
79
+ ## OpenAI-Compatible API
80
+
81
+ For convenience, DevUI provides an OpenAI Responses backend API. This means you can run the backend and also use the OpenAI client sdk to connect to it. Use **agent/workflow name as the model**, and set streaming to `True` as needed.
82
+
83
+ ```bash
84
+ # Simple - use your entity name as the model
85
+ curl -X POST http://localhost:8080/v1/responses \
86
+ -H "Content-Type: application/json" \
87
+ -d @- << 'EOF'
88
+ {
89
+ "model": "weather_agent",
90
+ "input": "Hello world"
91
+ }
92
+ ```
93
+
94
+ Or use the OpenAI Python SDK:
95
+
96
+ ```python
97
+ from openai import OpenAI
98
+
99
+ client = OpenAI(
100
+ base_url="http://localhost:8080/v1",
101
+ api_key="not-needed" # API key not required for local DevUI
102
+ )
103
+
104
+ response = client.responses.create(
105
+ model="weather_agent", # Your agent/workflow name
106
+ input="What's the weather in Seattle?"
107
+ )
108
+
109
+ # Extract text from response
110
+ print(response.output[0].content[0].text)
111
+ # Supports streaming with stream=True
112
+ ```
113
+
114
+ ### Multi-turn Conversations
115
+
116
+ Use the standard OpenAI `conversation` parameter for multi-turn conversations:
117
+
118
+ ```python
119
+ # Create a conversation
120
+ conversation = client.conversations.create(
121
+ metadata={"agent_id": "weather_agent"}
122
+ )
123
+
124
+ # Use it across multiple turns
125
+ response1 = client.responses.create(
126
+ model="weather_agent",
127
+ input="What's the weather in Seattle?",
128
+ conversation=conversation.id
129
+ )
130
+
131
+ response2 = client.responses.create(
132
+ model="weather_agent",
133
+ input="How about tomorrow?",
134
+ conversation=conversation.id # Continues the conversation!
135
+ )
136
+ ```
137
+
138
+ **How it works:** DevUI automatically retrieves the conversation's message history from the stored thread and passes it to the agent. You don't need to manually manage message history - just provide the same `conversation` ID for follow-up requests.
139
+
140
+ ## CLI Options
141
+
142
+ ```bash
143
+ devui [directory] [options]
144
+
145
+ Options:
146
+ --port, -p Port (default: 8080)
147
+ --host Host (default: 127.0.0.1)
148
+ --headless API only, no UI
149
+ --config YAML config file
150
+ --tracing none|framework|workflow|all
151
+ --reload Enable auto-reload
152
+ ```
153
+
154
+ ## Key Endpoints
155
+
156
+ ## API Mapping
157
+
158
+ Given that DevUI offers an OpenAI Responses API, it internally maps messages and events from Agent Framework to OpenAI Responses API events (in `_mapper.py`). For transparency, this mapping is shown below:
159
+
160
+ | Agent Framework Content | OpenAI Event/Type | Status |
161
+ | ------------------------------- | ---------------------------------------- | -------- |
162
+ | `TextContent` | `response.output_text.delta` | Standard |
163
+ | `TextReasoningContent` | `response.reasoning_text.delta` | Standard |
164
+ | `FunctionCallContent` (initial) | `response.output_item.added` | Standard |
165
+ | `FunctionCallContent` (args) | `response.function_call_arguments.delta` | Standard |
166
+ | `FunctionResultContent` | `response.function_result.complete` | DevUI |
167
+ | `FunctionApprovalRequestContent`| `response.function_approval.requested` | DevUI |
168
+ | `FunctionApprovalResponseContent`| `response.function_approval.responded` | DevUI |
169
+ | `ErrorContent` | `error` | Standard |
170
+ | `UsageContent` | Final `Response.usage` field (not streamed) | Standard |
171
+ | `WorkflowEvent` | `response.workflow_event.complete` | DevUI |
172
+ | `DataContent` | `response.trace.complete` | DevUI |
173
+ | `UriContent` | `response.trace.complete` | DevUI |
174
+ | `HostedFileContent` | `response.trace.complete` | DevUI |
175
+ | `HostedVectorStoreContent` | `response.trace.complete` | DevUI |
176
+
177
+ - **Standard** = OpenAI Responses API spec
178
+ - **DevUI** = Custom extensions for Agent Framework features (workflows, traces, function approvals)
179
+
180
+ ### OpenAI Responses API Compliance
181
+
182
+ DevUI follows the OpenAI Responses API specification for maximum compatibility:
183
+
184
+ **Standard OpenAI Types Used:**
185
+ - `ResponseOutputItemAddedEvent` - Output item notifications (function calls and results)
186
+ - `Response.usage` - Token usage (in final response, not streamed)
187
+ - All standard text, reasoning, and function call events
188
+
189
+ **Custom DevUI Extensions:**
190
+ - `response.function_approval.requested` - Function approval requests (for interactive approval workflows)
191
+ - `response.function_approval.responded` - Function approval responses (user approval/rejection)
192
+ - `response.workflow_event.complete` - Agent Framework workflow events
193
+ - `response.trace.complete` - Execution traces and internal content (DataContent, UriContent, hosted files/stores)
194
+
195
+ These custom extensions are clearly namespaced and can be safely ignored by standard OpenAI clients.
196
+
197
+ ### Entity Management
198
+
199
+ - `GET /v1/entities` - List discovered agents/workflows
200
+ - `GET /v1/entities/{entity_id}/info` - Get detailed entity information
201
+ - `POST /v1/entities/{entity_id}/reload` - Hot reload entity (for development)
202
+
203
+ ### Execution (OpenAI Responses API)
204
+
205
+ - `POST /v1/responses` - Execute agent/workflow (streaming or sync)
206
+
207
+ ### Conversations (OpenAI Standard)
208
+
209
+ - `POST /v1/conversations` - Create conversation
210
+ - `GET /v1/conversations/{id}` - Get conversation
211
+ - `POST /v1/conversations/{id}` - Update conversation metadata
212
+ - `DELETE /v1/conversations/{id}` - Delete conversation
213
+ - `GET /v1/conversations?agent_id={id}` - List conversations _(DevUI extension)_
214
+ - `POST /v1/conversations/{id}/items` - Add items to conversation
215
+ - `GET /v1/conversations/{id}/items` - List conversation items
216
+ - `GET /v1/conversations/{id}/items/{item_id}` - Get conversation item
217
+
218
+ ### Health
219
+
220
+ - `GET /health` - Health check
221
+
222
+ ## Security
223
+
224
+ DevUI is designed as a **sample application for local development** and should not be exposed to untrusted networks or used in production environments.
225
+
226
+ **Security features:**
227
+ - Only loads entities from local directories or in-memory registration
228
+ - No remote code execution capabilities
229
+ - Binds to localhost (127.0.0.1) by default
230
+ - All samples must be manually downloaded and reviewed before running
231
+
232
+ **Best practices:**
233
+ - Never expose DevUI to the internet
234
+ - Review all agent/workflow code before running
235
+ - Only load entities from trusted sources
236
+ - Use `.env` files for sensitive credentials (never commit them)
237
+
238
+ ## Implementation
239
+
240
+ - **Discovery**: `agent_framework_devui/_discovery.py`
241
+ - **Execution**: `agent_framework_devui/_executor.py`
242
+ - **Message Mapping**: `agent_framework_devui/_mapper.py`
243
+ - **Conversations**: `agent_framework_devui/_conversations.py`
244
+ - **API Server**: `agent_framework_devui/_server.py`
245
+ - **CLI**: `agent_framework_devui/_cli.py`
246
+
247
+ ## Examples
248
+
249
+ See working implementations in `python/samples/getting_started/devui/`
250
+
251
+ ## License
252
+
253
+ MIT