agent-chat-fastapi-langgraph-assistant-ui 0.1.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.
- agent_chat_fastapi_langgraph_assistant_ui-0.1.0.dist-info/METADATA +68 -0
- agent_chat_fastapi_langgraph_assistant_ui-0.1.0.dist-info/RECORD +41 -0
- agent_chat_fastapi_langgraph_assistant_ui-0.1.0.dist-info/WHEEL +4 -0
- agent_chat_fastapi_langgraph_assistant_ui-0.1.0.dist-info/entry_points.txt +2 -0
- agent_chat_minimal/__init__.py +5 -0
- agent_chat_minimal/demo_agent/__init__.py +0 -0
- agent_chat_minimal/demo_agent/get_graph.py +41 -0
- agent_chat_minimal/demo_agent/tools/__init__.py +0 -0
- agent_chat_minimal/demo_agent/tools/graph_tool.py +76 -0
- agent_chat_minimal/server.py +137 -0
- agent_chat_minimal/web/404/index.html +1 -0
- agent_chat_minimal/web/404.html +1 -0
- agent_chat_minimal/web/__next.__PAGE__.txt +10 -0
- agent_chat_minimal/web/__next._full.txt +18 -0
- agent_chat_minimal/web/__next._head.txt +5 -0
- agent_chat_minimal/web/__next._index.txt +5 -0
- agent_chat_minimal/web/__next._tree.txt +3 -0
- agent_chat_minimal/web/_next/static/chunks/01753452ac5baafa.js +1 -0
- agent_chat_minimal/web/_next/static/chunks/30d8e87dcbdddc4d.js +1 -0
- agent_chat_minimal/web/_next/static/chunks/339892169798c284.js +1 -0
- agent_chat_minimal/web/_next/static/chunks/4a95dc46ade64fde.js +1 -0
- agent_chat_minimal/web/_next/static/chunks/8c25bd17dcc24038.css +1 -0
- agent_chat_minimal/web/_next/static/chunks/a09b0e81b13178b3.css +1 -0
- agent_chat_minimal/web/_next/static/chunks/a6dad97d9634a72d.js +1 -0
- agent_chat_minimal/web/_next/static/chunks/a6dad97d9634a72d.js.map +1 -0
- agent_chat_minimal/web/_next/static/chunks/c1f433e6da65e45d.js +5 -0
- agent_chat_minimal/web/_next/static/chunks/e54de45640ef90a8.js +66 -0
- agent_chat_minimal/web/_next/static/chunks/turbopack-6a8c15a03bc4b465.js +4 -0
- agent_chat_minimal/web/_next/static/u6DgPIAX8tUdhBwB6-mHz/_buildManifest.js +11 -0
- agent_chat_minimal/web/_next/static/u6DgPIAX8tUdhBwB6-mHz/_clientMiddlewareManifest.json +1 -0
- agent_chat_minimal/web/_next/static/u6DgPIAX8tUdhBwB6-mHz/_ssgManifest.js +1 -0
- agent_chat_minimal/web/_not-found/__next._full.txt +13 -0
- agent_chat_minimal/web/_not-found/__next._head.txt +5 -0
- agent_chat_minimal/web/_not-found/__next._index.txt +5 -0
- agent_chat_minimal/web/_not-found/__next._not-found.__PAGE__.txt +5 -0
- agent_chat_minimal/web/_not-found/__next._not-found.txt +4 -0
- agent_chat_minimal/web/_not-found/__next._tree.txt +2 -0
- agent_chat_minimal/web/_not-found/index.html +1 -0
- agent_chat_minimal/web/_not-found/index.txt +13 -0
- agent_chat_minimal/web/index.html +1 -0
- agent_chat_minimal/web/index.txt +18 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: agent-chat-fastapi-langgraph-assistant-ui
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Portable FastAPI and LangGraph chat with a bundled static UI
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Requires-Dist: assistant-stream-ce>=0.0.2
|
|
7
|
+
Requires-Dist: fastapi>=0.127.0
|
|
8
|
+
Requires-Dist: langchain-openai>=0.2.0
|
|
9
|
+
Requires-Dist: langchain>=1.2.0
|
|
10
|
+
Requires-Dist: langgraph>=1.0.5
|
|
11
|
+
Requires-Dist: typing-extensions>=4.8.0
|
|
12
|
+
Requires-Dist: uvicorn>=0.34.0
|
|
13
|
+
Provides-Extra: test
|
|
14
|
+
Requires-Dist: httpx>=0.27.0; extra == 'test'
|
|
15
|
+
Requires-Dist: pytest>=8.0.0; extra == 'test'
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# Agent Chat Minimal
|
|
19
|
+
|
|
20
|
+
This local Python distribution bundles the fixed weather/graph demo agent,
|
|
21
|
+
FastAPI server, and a prebuilt static minimal chat UI. Node is needed only to
|
|
22
|
+
build the web payload, not to install or run the resulting wheel.
|
|
23
|
+
|
|
24
|
+
From the repository root, build the UI and wheel with:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
packages/agent-chat-minimal/scripts/build_wheel.sh
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The script runs the frozen pnpm install and static export, stages `out/` as
|
|
31
|
+
package data, and writes the wheel under `packages/agent-chat-minimal/dist/`.
|
|
32
|
+
Generated `web/` content and `dist/` are intentionally gitignored.
|
|
33
|
+
|
|
34
|
+
Install from PyPI (Python 3.11+, no Node required) and serve with:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install agent-chat-fastapi-langgraph-assistant-ui
|
|
38
|
+
minimal-chat-serve --port 8011
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Or install and serve the locally built wheel with:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
python -m pip install packages/agent-chat-minimal/dist/*.whl
|
|
45
|
+
minimal-chat-serve --port 8011
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Open <http://localhost:8011/>. Set `OPENAI_API_KEY` to enable `/assistant`;
|
|
49
|
+
without it, the UI and `/health` still work and `/assistant` returns 503.
|
|
50
|
+
`MINIMAL_WEB_DIR` may override the bundled web directory.
|
|
51
|
+
|
|
52
|
+
Run the offline serving tests and clean-venv smoke check from the repository
|
|
53
|
+
root:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
python3 -m venv /tmp/agent-chat-minimal-tests
|
|
57
|
+
/tmp/agent-chat-minimal-tests/bin/pip install \
|
|
58
|
+
"packages/agent-chat-minimal[test]"
|
|
59
|
+
/tmp/agent-chat-minimal-tests/bin/pytest packages/agent-chat-minimal
|
|
60
|
+
packages/agent-chat-minimal/scripts/smoke_test_wheel.sh
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Build the Python-only runtime image after building the wheel:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
docker build -t agent-chat-minimal packages/agent-chat-minimal
|
|
67
|
+
docker run --rm -p 8011:8011 agent-chat-minimal
|
|
68
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
agent_chat_minimal/__init__.py,sha256=rK36czGMcQlAh9ftjLDco8ADe_I6By3JXKkl_8GXA0k,109
|
|
2
|
+
agent_chat_minimal/server.py,sha256=hgmR5GfokLRPqdHbfcxeb3A7uh-Uyc_t9buqbGR4Z_A,4874
|
|
3
|
+
agent_chat_minimal/demo_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
agent_chat_minimal/demo_agent/get_graph.py,sha256=XUPRLGtDsv8D7mDAltjovwoIWNxCXNQJM-rmw2JTcKA,1380
|
|
5
|
+
agent_chat_minimal/demo_agent/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
agent_chat_minimal/demo_agent/tools/graph_tool.py,sha256=_dg85MVAhwcO1rxTsA0wn6XU_WPgLxSCvjYwG8qefYc,1875
|
|
7
|
+
agent_chat_minimal/web/404.html,sha256=KYTOeYnxiXnUK24AtQDlR1w8BRfOMXBBhW1wmN6ISj0,8731
|
|
8
|
+
agent_chat_minimal/web/__next.__PAGE__.txt,sha256=6MnbaQXpyshODvFuJwuiKj_ISXTKkV0S0SKcMxyGLuc,1122
|
|
9
|
+
agent_chat_minimal/web/__next._full.txt,sha256=-fDTyguom-UJ1OP8DK_VbHR6LC00q5JoOssoqQLKOyQ,4520
|
|
10
|
+
agent_chat_minimal/web/__next._head.txt,sha256=sBtd_ojoMwXzMHgCrFwYuyhASJJVDHLHLatz35OuH4o,870
|
|
11
|
+
agent_chat_minimal/web/__next._index.txt,sha256=7K-j1s2K9RPuoEKZSqdLuuJfoFdOB3nM10k64Xr-ITc,2111
|
|
12
|
+
agent_chat_minimal/web/__next._tree.txt,sha256=dUqgQ7WrdeKxk-HWVUTfVVPXnrUvEN1BQpWPWrM8txE,406
|
|
13
|
+
agent_chat_minimal/web/index.html,sha256=nSeejqyJelmUQmsPh0wvfKkNoBBma2xZO-PjMkxiXwE,14699
|
|
14
|
+
agent_chat_minimal/web/index.txt,sha256=-fDTyguom-UJ1OP8DK_VbHR6LC00q5JoOssoqQLKOyQ,4520
|
|
15
|
+
agent_chat_minimal/web/404/index.html,sha256=KYTOeYnxiXnUK24AtQDlR1w8BRfOMXBBhW1wmN6ISj0,8731
|
|
16
|
+
agent_chat_minimal/web/_next/static/chunks/01753452ac5baafa.js,sha256=B4FmzCvzkIOi3FsadXBnCPB-M99WGuxgat5IojUOceY,281
|
|
17
|
+
agent_chat_minimal/web/_next/static/chunks/30d8e87dcbdddc4d.js,sha256=kh_9dEjB5imz5YmdSmTqz8gaRKzmhwOFyOkAUyU39as,224516
|
|
18
|
+
agent_chat_minimal/web/_next/static/chunks/339892169798c284.js,sha256=WqiPiqO8_aijDsy0K9IbmzcpuYvjdqs9F_7eSPdYQ0I,18202
|
|
19
|
+
agent_chat_minimal/web/_next/static/chunks/4a95dc46ade64fde.js,sha256=U9AuCVy9HxYMHRILFPIEmTlcG6fHCObAFcxyCuPxzqU,30709
|
|
20
|
+
agent_chat_minimal/web/_next/static/chunks/8c25bd17dcc24038.css,sha256=sMGSIg5q23c09F1I4nK-pni2GmhItEkJhmF_iRUpq-U,966
|
|
21
|
+
agent_chat_minimal/web/_next/static/chunks/a09b0e81b13178b3.css,sha256=5vLPKTW_TF1Ehb1v4pbr0b5QJ9rcGV2XhcElSVck8TY,44339
|
|
22
|
+
agent_chat_minimal/web/_next/static/chunks/a6dad97d9634a72d.js,sha256=CXPB1kyIrcjjyVBBDLWLKI9yEY1ZZbeASUON648vloM,112594
|
|
23
|
+
agent_chat_minimal/web/_next/static/chunks/a6dad97d9634a72d.js.map,sha256=gDlv-wShJxRcq8KXqWzoFO80ZHidTF6205iCaatlHwU,115811
|
|
24
|
+
agent_chat_minimal/web/_next/static/chunks/c1f433e6da65e45d.js,sha256=uZLZTTZlQY_ovE8KNvNwrfC_pKf3Tln0eAeIoem-omM,156099
|
|
25
|
+
agent_chat_minimal/web/_next/static/chunks/e54de45640ef90a8.js,sha256=6ex2UGx6LU7Ne_G6WtvghSjJBWegNsFZj0yxzsnMrXo,933497
|
|
26
|
+
agent_chat_minimal/web/_next/static/chunks/turbopack-6a8c15a03bc4b465.js,sha256=Wydg6oo2nB-7CBD8TazqpDwMcXuwHdCQZvZgBuHCz7U,10213
|
|
27
|
+
agent_chat_minimal/web/_next/static/u6DgPIAX8tUdhBwB6-mHz/_buildManifest.js,sha256=lHbgr9P52mimTm7FhjEZH9PqymLJ9aN351F_6aieWeo,219
|
|
28
|
+
agent_chat_minimal/web/_next/static/u6DgPIAX8tUdhBwB6-mHz/_clientMiddlewareManifest.json,sha256=T1PNoYwrqgwDVLtfmj7L5e0Sq02OEbqHPC8RFhICuUU,2
|
|
29
|
+
agent_chat_minimal/web/_next/static/u6DgPIAX8tUdhBwB6-mHz/_ssgManifest.js,sha256=Z49s4suAsf5y_GfnQSvm4qtq2ggxEbZPfEDTXjy6XgA,80
|
|
30
|
+
agent_chat_minimal/web/_not-found/__next._full.txt,sha256=A6PYhINUMFB0xVLks1Uj5IOrQVEaFW0OIA6MWhmXoJY,5553
|
|
31
|
+
agent_chat_minimal/web/_not-found/__next._head.txt,sha256=h3nfkO0b36jeWrzag95jBN2RRF7AcuWPpkhZHUKkye4,921
|
|
32
|
+
agent_chat_minimal/web/_not-found/__next._index.txt,sha256=oSmebVwH8c46PMGApk9Onmn9ibNGpHW3_8CGMET1yTs,2291
|
|
33
|
+
agent_chat_minimal/web/_not-found/__next._not-found.__PAGE__.txt,sha256=e_SEMx3TpRJaQe5qkjJIHs0DkaaPQIGAWNmFfLcmxpA,1449
|
|
34
|
+
agent_chat_minimal/web/_not-found/__next._not-found.txt,sha256=O-4O8I2HK1XBufwh2lIIvZU6ct2JFRfhKZrD522-MS4,432
|
|
35
|
+
agent_chat_minimal/web/_not-found/__next._tree.txt,sha256=0rM49avtmiI4K491AAHw70aOlin4F2wy27VUwqbWcG4,483
|
|
36
|
+
agent_chat_minimal/web/_not-found/index.html,sha256=KYTOeYnxiXnUK24AtQDlR1w8BRfOMXBBhW1wmN6ISj0,8731
|
|
37
|
+
agent_chat_minimal/web/_not-found/index.txt,sha256=A6PYhINUMFB0xVLks1Uj5IOrQVEaFW0OIA6MWhmXoJY,5553
|
|
38
|
+
agent_chat_fastapi_langgraph_assistant_ui-0.1.0.dist-info/METADATA,sha256=pj4CUM0cNGAMr28wmsA8y8_kOdvJj9O36u4I4a0GHhA,2237
|
|
39
|
+
agent_chat_fastapi_langgraph_assistant_ui-0.1.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
40
|
+
agent_chat_fastapi_langgraph_assistant_ui-0.1.0.dist-info/entry_points.txt,sha256=QsDYwQTnyTxmoA6ZXu2m419rn2aAV679-GHKYHNGFO8,70
|
|
41
|
+
agent_chat_fastapi_langgraph_assistant_ui-0.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
from typing import Annotated, TypedDict
|
|
2
|
+
|
|
3
|
+
from langchain_core.messages import BaseMessage
|
|
4
|
+
from langchain_core.tools import tool
|
|
5
|
+
from langchain_openai import ChatOpenAI
|
|
6
|
+
from langgraph.graph import StateGraph
|
|
7
|
+
from langgraph.graph.message import add_messages
|
|
8
|
+
from langgraph.prebuilt import ToolNode, tools_condition
|
|
9
|
+
|
|
10
|
+
from .tools.graph_tool import render_graph
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class AgentState(TypedDict):
|
|
14
|
+
messages: Annotated[list[BaseMessage], add_messages]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@tool
|
|
18
|
+
def get_weather(city: str):
|
|
19
|
+
"""Use this to look up the weather for a specific city."""
|
|
20
|
+
if "london" in city.lower():
|
|
21
|
+
return "It's 15°C and cloudy in London."
|
|
22
|
+
return f"The weather in {city} is sunny and 25°C."
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def make_agent_with_weather_tool(model="gpt-4o-mini") -> StateGraph:
|
|
26
|
+
tools = [get_weather, render_graph]
|
|
27
|
+
tool_node = ToolNode(tools)
|
|
28
|
+
chat_model = ChatOpenAI(model="gpt-4o-mini", streaming=True).bind_tools(tools)
|
|
29
|
+
|
|
30
|
+
def call_model(state: AgentState):
|
|
31
|
+
response = chat_model.invoke(state["messages"])
|
|
32
|
+
state["messages"].append(response)
|
|
33
|
+
return {"messages": [response]}
|
|
34
|
+
|
|
35
|
+
workflow = StateGraph(AgentState)
|
|
36
|
+
workflow.add_node("agent", call_model)
|
|
37
|
+
workflow.add_node("tools", tool_node)
|
|
38
|
+
workflow.set_entry_point("agent")
|
|
39
|
+
workflow.add_conditional_edges("agent", tools_condition)
|
|
40
|
+
workflow.add_edge("tools", "agent")
|
|
41
|
+
return workflow.compile()
|
|
File without changes
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
from typing import List, Optional
|
|
2
|
+
|
|
3
|
+
from langchain_core.tools import tool
|
|
4
|
+
from typing_extensions import TypedDict
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class GraphNode(TypedDict, total=False):
|
|
8
|
+
id: str
|
|
9
|
+
label: Optional[str]
|
|
10
|
+
weight: int
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class GraphEdge(TypedDict, total=False):
|
|
14
|
+
source: str
|
|
15
|
+
target: str
|
|
16
|
+
label: Optional[str]
|
|
17
|
+
weight: int
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class GraphPayload(TypedDict, total=False):
|
|
21
|
+
directed: bool
|
|
22
|
+
nodes: List[GraphNode]
|
|
23
|
+
edges: List[GraphEdge]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _clamp_0_100(x, default: int) -> int:
|
|
27
|
+
try:
|
|
28
|
+
value = int(x)
|
|
29
|
+
except Exception:
|
|
30
|
+
return default
|
|
31
|
+
return max(0, min(100, value))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@tool("render_graph")
|
|
35
|
+
def render_graph(
|
|
36
|
+
nodes: List[GraphNode],
|
|
37
|
+
edges: List[GraphEdge],
|
|
38
|
+
directed: bool = False,
|
|
39
|
+
) -> dict:
|
|
40
|
+
"""
|
|
41
|
+
Render an interactive graph in the UI.
|
|
42
|
+
|
|
43
|
+
nodes: [{id, label?, weight? (0..100)}]
|
|
44
|
+
edges: [{source, target, label?, weight? (0..100)}]
|
|
45
|
+
directed: if true, show arrows (directed edges)
|
|
46
|
+
"""
|
|
47
|
+
clean_nodes = []
|
|
48
|
+
seen = set()
|
|
49
|
+
for node in nodes or []:
|
|
50
|
+
node_id = node.get("id")
|
|
51
|
+
if not node_id or node_id in seen:
|
|
52
|
+
continue
|
|
53
|
+
seen.add(node_id)
|
|
54
|
+
clean_nodes.append(
|
|
55
|
+
{
|
|
56
|
+
"id": str(node_id),
|
|
57
|
+
"label": node.get("label"),
|
|
58
|
+
"weight": _clamp_0_100(node.get("weight"), default=50),
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
clean_edges = []
|
|
63
|
+
for edge in edges or []:
|
|
64
|
+
source, target = edge.get("source"), edge.get("target")
|
|
65
|
+
if not source or not target:
|
|
66
|
+
continue
|
|
67
|
+
clean_edges.append(
|
|
68
|
+
{
|
|
69
|
+
"source": str(source),
|
|
70
|
+
"target": str(target),
|
|
71
|
+
"label": edge.get("label"),
|
|
72
|
+
"weight": _clamp_0_100(edge.get("weight"), default=50),
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
return {"directed": bool(directed), "nodes": clean_nodes, "edges": clean_edges}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import logging
|
|
3
|
+
import os
|
|
4
|
+
import uuid
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
import uvicorn
|
|
8
|
+
from assistant_stream_ce import RunController, create_run
|
|
9
|
+
from assistant_stream_ce.assistant_stream_models import ChatRequest
|
|
10
|
+
from assistant_stream_ce.modules.langgraph import append_langgraph_event
|
|
11
|
+
from assistant_stream_ce.serialization import DataStreamResponse
|
|
12
|
+
from fastapi import FastAPI, HTTPException
|
|
13
|
+
from fastapi.middleware.cors import CORSMiddleware
|
|
14
|
+
from fastapi.staticfiles import StaticFiles
|
|
15
|
+
from langchain_core.messages import HumanMessage
|
|
16
|
+
from starlette.exceptions import HTTPException as StarletteHTTPException
|
|
17
|
+
|
|
18
|
+
from .demo_agent.get_graph import make_agent_with_weather_tool
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
logger = logging.getLogger(__name__)
|
|
22
|
+
DEFAULT_WEB_DIR = Path(__file__).parent / "web"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class SPAStaticFiles(StaticFiles):
|
|
26
|
+
async def get_response(self, path, scope):
|
|
27
|
+
reserved_paths = ("assistant", "health", "docs", "openapi.json")
|
|
28
|
+
if path in reserved_paths or path.startswith(
|
|
29
|
+
tuple(f"{prefix}/" for prefix in reserved_paths)
|
|
30
|
+
):
|
|
31
|
+
raise StarletteHTTPException(status_code=404)
|
|
32
|
+
|
|
33
|
+
try:
|
|
34
|
+
response = await super().get_response(path, scope)
|
|
35
|
+
except StarletteHTTPException as exc:
|
|
36
|
+
if exc.status_code != 404:
|
|
37
|
+
raise
|
|
38
|
+
return await super().get_response("index.html", scope)
|
|
39
|
+
|
|
40
|
+
if response.status_code == 404:
|
|
41
|
+
return await super().get_response("index.html", scope)
|
|
42
|
+
return response
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def create_app(web_dir: Path | None = None) -> FastAPI:
|
|
46
|
+
openai_api_key = os.getenv("OPENAI_API_KEY")
|
|
47
|
+
if not openai_api_key:
|
|
48
|
+
logger.warning(
|
|
49
|
+
"OPENAI_API_KEY is not set; the /assistant endpoint will return 503."
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
graph = make_agent_with_weather_tool("gpt-4o-mini") if openai_api_key else None
|
|
53
|
+
app = FastAPI()
|
|
54
|
+
app.add_middleware(
|
|
55
|
+
CORSMiddleware,
|
|
56
|
+
# The bundled UI is same-origin; permissive CORS supports split-port development.
|
|
57
|
+
allow_origins=["*"],
|
|
58
|
+
allow_credentials=True,
|
|
59
|
+
allow_methods=["*"],
|
|
60
|
+
allow_headers=["*"],
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
@app.get("/health")
|
|
64
|
+
async def health():
|
|
65
|
+
return {"status": "ok"}
|
|
66
|
+
|
|
67
|
+
@app.post("/assistant")
|
|
68
|
+
async def chat_endpoint(request: ChatRequest):
|
|
69
|
+
if not openai_api_key:
|
|
70
|
+
raise HTTPException(
|
|
71
|
+
status_code=503,
|
|
72
|
+
detail={
|
|
73
|
+
"error": "OPENAI_API_KEY not configured",
|
|
74
|
+
"message": "Please set the OPENAI_API_KEY environment variable to use the chat functionality.",
|
|
75
|
+
"instructions": "Add OPENAI_API_KEY=your-key to your .env file and restart the server.",
|
|
76
|
+
},
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
assert graph is not None
|
|
80
|
+
|
|
81
|
+
async def run_callback(controller: RunController):
|
|
82
|
+
if controller.state is None:
|
|
83
|
+
controller.state = {"messages": []}
|
|
84
|
+
|
|
85
|
+
for command in request.commands:
|
|
86
|
+
if command.type == "add-message":
|
|
87
|
+
text = " ".join(
|
|
88
|
+
part.text
|
|
89
|
+
for part in command.message.parts
|
|
90
|
+
if part.type == "text"
|
|
91
|
+
)
|
|
92
|
+
if text:
|
|
93
|
+
message_id = getattr(command.message, "id", str(uuid.uuid4()))
|
|
94
|
+
message = HumanMessage(content=text, id=message_id)
|
|
95
|
+
controller.state["messages"].append(message.model_dump())
|
|
96
|
+
|
|
97
|
+
input_message = {"messages": list(controller.state["messages"])}
|
|
98
|
+
async for namespace, event_type, chunk in graph.astream(
|
|
99
|
+
input_message,
|
|
100
|
+
stream_mode=["messages"],
|
|
101
|
+
subgraphs=True,
|
|
102
|
+
):
|
|
103
|
+
append_langgraph_event(
|
|
104
|
+
controller.state, namespace, event_type, chunk
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
stream = create_run(run_callback, state=request.state)
|
|
108
|
+
return DataStreamResponse(stream)
|
|
109
|
+
|
|
110
|
+
resolved_web_dir = Path(
|
|
111
|
+
web_dir or os.getenv("MINIMAL_WEB_DIR", DEFAULT_WEB_DIR)
|
|
112
|
+
).resolve()
|
|
113
|
+
if resolved_web_dir.is_dir() and (resolved_web_dir / "index.html").is_file():
|
|
114
|
+
app.mount(
|
|
115
|
+
"/",
|
|
116
|
+
SPAStaticFiles(directory=resolved_web_dir, html=True),
|
|
117
|
+
name="web",
|
|
118
|
+
)
|
|
119
|
+
else:
|
|
120
|
+
logger.warning(
|
|
121
|
+
"Minimal UI build not found at %s; starting in API-only mode. "
|
|
122
|
+
"Set MINIMAL_WEB_DIR to a frontend-minimal/out directory.",
|
|
123
|
+
resolved_web_dir,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
return app
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
app = create_app()
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def main(argv=None):
|
|
133
|
+
parser = argparse.ArgumentParser(description="Serve the minimal chat application")
|
|
134
|
+
parser.add_argument("--host", default="0.0.0.0")
|
|
135
|
+
parser.add_argument("--port", type=int, default=8011)
|
|
136
|
+
args = parser.parse_args(argv)
|
|
137
|
+
uvicorn.run(create_app(), host=args.host, port=args.port)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!DOCTYPE html><!--u6DgPIAX8tUdhBwB6_mHz--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/a09b0e81b13178b3.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/339892169798c284.js"/><script src="/_next/static/chunks/30d8e87dcbdddc4d.js" async=""></script><script src="/_next/static/chunks/c1f433e6da65e45d.js" async=""></script><script src="/_next/static/chunks/turbopack-6a8c15a03bc4b465.js" async=""></script><script src="/_next/static/chunks/01753452ac5baafa.js" async=""></script><script src="/_next/static/chunks/4a95dc46ade64fde.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>assistant-ui with Assistant Transport</title><meta name="description" content="An example of using assistant-ui with the assistant-transport runtime"/><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body class="font-sans antialiased"><div hidden=""><!--$--><!--/$--></div><div class="flex h-screen flex-col"><header class="border-b bg-background px-4 py-2"><h1 class="font-semibold text-lg">Assistant Transport Example</h1></header><main class="flex-1 overflow-hidden"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--></main></div><script src="/_next/static/chunks/339892169798c284.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[58625,[\"/_next/static/chunks/01753452ac5baafa.js\",\"/_next/static/chunks/4a95dc46ade64fde.js\"],\"default\"]\n3:I[24554,[\"/_next/static/chunks/01753452ac5baafa.js\",\"/_next/static/chunks/4a95dc46ade64fde.js\"],\"default\"]\n4:I[91802,[\"/_next/static/chunks/01753452ac5baafa.js\",\"/_next/static/chunks/4a95dc46ade64fde.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[91802,[\"/_next/static/chunks/01753452ac5baafa.js\",\"/_next/static/chunks/4a95dc46ade64fde.js\"],\"ViewportBoundary\"]\n9:I[91802,[\"/_next/static/chunks/01753452ac5baafa.js\",\"/_next/static/chunks/4a95dc46ade64fde.js\"],\"MetadataBoundary\"]\nb:I[33834,[\"/_next/static/chunks/01753452ac5baafa.js\",\"/_next/static/chunks/4a95dc46ade64fde.js\"],\"default\"]\n:HL[\"/_next/static/chunks/a09b0e81b13178b3.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"u6DgPIAX8tUdhBwB6-mHz\",\"c\":[\"\",\"_not-found\",\"\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/a09b0e81b13178b3.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/01753452ac5baafa.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/4a95dc46ade64fde.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"font-sans antialiased\",\"children\":[\"$\",\"div\",null,{\"className\":\"flex h-screen flex-col\",\"children\":[[\"$\",\"header\",null,{\"className\":\"border-b bg-background px-4 py-2\",\"children\":[\"$\",\"h1\",null,{\"className\":\"font-semibold text-lg\",\"children\":\"Assistant Transport Example\"}]}],[\"$\",\"main\",null,{\"className\":\"flex-1 overflow-hidden\",\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:1:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:1:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\na:[[\"$\",\"title\",\"0\",{\"children\":\"assistant-ui with Assistant Transport\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"An example of using assistant-ui with the assistant-transport runtime\"}]]\n"])</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!DOCTYPE html><!--u6DgPIAX8tUdhBwB6_mHz--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/a09b0e81b13178b3.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/339892169798c284.js"/><script src="/_next/static/chunks/30d8e87dcbdddc4d.js" async=""></script><script src="/_next/static/chunks/c1f433e6da65e45d.js" async=""></script><script src="/_next/static/chunks/turbopack-6a8c15a03bc4b465.js" async=""></script><script src="/_next/static/chunks/01753452ac5baafa.js" async=""></script><script src="/_next/static/chunks/4a95dc46ade64fde.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>assistant-ui with Assistant Transport</title><meta name="description" content="An example of using assistant-ui with the assistant-transport runtime"/><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body class="font-sans antialiased"><div hidden=""><!--$--><!--/$--></div><div class="flex h-screen flex-col"><header class="border-b bg-background px-4 py-2"><h1 class="font-semibold text-lg">Assistant Transport Example</h1></header><main class="flex-1 overflow-hidden"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--></main></div><script src="/_next/static/chunks/339892169798c284.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[58625,[\"/_next/static/chunks/01753452ac5baafa.js\",\"/_next/static/chunks/4a95dc46ade64fde.js\"],\"default\"]\n3:I[24554,[\"/_next/static/chunks/01753452ac5baafa.js\",\"/_next/static/chunks/4a95dc46ade64fde.js\"],\"default\"]\n4:I[91802,[\"/_next/static/chunks/01753452ac5baafa.js\",\"/_next/static/chunks/4a95dc46ade64fde.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[91802,[\"/_next/static/chunks/01753452ac5baafa.js\",\"/_next/static/chunks/4a95dc46ade64fde.js\"],\"ViewportBoundary\"]\n9:I[91802,[\"/_next/static/chunks/01753452ac5baafa.js\",\"/_next/static/chunks/4a95dc46ade64fde.js\"],\"MetadataBoundary\"]\nb:I[33834,[\"/_next/static/chunks/01753452ac5baafa.js\",\"/_next/static/chunks/4a95dc46ade64fde.js\"],\"default\"]\n:HL[\"/_next/static/chunks/a09b0e81b13178b3.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"u6DgPIAX8tUdhBwB6-mHz\",\"c\":[\"\",\"_not-found\",\"\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/a09b0e81b13178b3.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/01753452ac5baafa.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/4a95dc46ade64fde.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"font-sans antialiased\",\"children\":[\"$\",\"div\",null,{\"className\":\"flex h-screen flex-col\",\"children\":[[\"$\",\"header\",null,{\"className\":\"border-b bg-background px-4 py-2\",\"children\":[\"$\",\"h1\",null,{\"className\":\"font-semibold text-lg\",\"children\":\"Assistant Transport Example\"}]}],[\"$\",\"main\",null,{\"className\":\"flex-1 overflow-hidden\",\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:1:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:1:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:1:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\na:[[\"$\",\"title\",\"0\",{\"children\":\"assistant-ui with Assistant Transport\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"An example of using assistant-ui with the assistant-transport runtime\"}]]\n"])</script></body></html>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
1:"$Sreact.fragment"
|
|
2
|
+
2:I[55106,["/_next/static/chunks/01753452ac5baafa.js","/_next/static/chunks/4a95dc46ade64fde.js"],"ClientPageRoot"]
|
|
3
|
+
3:I[31713,["/_next/static/chunks/01753452ac5baafa.js","/_next/static/chunks/e54de45640ef90a8.js"],"default"]
|
|
4
|
+
6:I[91802,["/_next/static/chunks/01753452ac5baafa.js","/_next/static/chunks/4a95dc46ade64fde.js"],"OutletBoundary"]
|
|
5
|
+
7:"$Sreact.suspense"
|
|
6
|
+
:HL["/_next/static/chunks/8c25bd17dcc24038.css","style"]
|
|
7
|
+
0:{"buildId":"u6DgPIAX8tUdhBwB6-mHz","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/8c25bd17dcc24038.css","precedence":"next"}],["$","script","script-0",{"src":"/_next/static/chunks/01753452ac5baafa.js","async":true}],["$","script","script-1",{"src":"/_next/static/chunks/e54de45640ef90a8.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false}
|
|
8
|
+
4:{}
|
|
9
|
+
5:"$0:rsc:props:children:0:props:serverProvidedParams:params"
|
|
10
|
+
8:null
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
1:"$Sreact.fragment"
|
|
2
|
+
2:I[58625,["/_next/static/chunks/01753452ac5baafa.js","/_next/static/chunks/4a95dc46ade64fde.js"],"default"]
|
|
3
|
+
3:I[24554,["/_next/static/chunks/01753452ac5baafa.js","/_next/static/chunks/4a95dc46ade64fde.js"],"default"]
|
|
4
|
+
4:I[55106,["/_next/static/chunks/01753452ac5baafa.js","/_next/static/chunks/4a95dc46ade64fde.js"],"ClientPageRoot"]
|
|
5
|
+
5:I[31713,["/_next/static/chunks/01753452ac5baafa.js","/_next/static/chunks/e54de45640ef90a8.js"],"default"]
|
|
6
|
+
8:I[91802,["/_next/static/chunks/01753452ac5baafa.js","/_next/static/chunks/4a95dc46ade64fde.js"],"OutletBoundary"]
|
|
7
|
+
9:"$Sreact.suspense"
|
|
8
|
+
b:I[91802,["/_next/static/chunks/01753452ac5baafa.js","/_next/static/chunks/4a95dc46ade64fde.js"],"ViewportBoundary"]
|
|
9
|
+
d:I[91802,["/_next/static/chunks/01753452ac5baafa.js","/_next/static/chunks/4a95dc46ade64fde.js"],"MetadataBoundary"]
|
|
10
|
+
f:I[33834,["/_next/static/chunks/01753452ac5baafa.js","/_next/static/chunks/4a95dc46ade64fde.js"],"default"]
|
|
11
|
+
:HL["/_next/static/chunks/a09b0e81b13178b3.css","style"]
|
|
12
|
+
:HL["/_next/static/chunks/8c25bd17dcc24038.css","style"]
|
|
13
|
+
0:{"P":null,"b":"u6DgPIAX8tUdhBwB6-mHz","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/a09b0e81b13178b3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"font-sans antialiased","children":["$","div",null,{"className":"flex h-screen flex-col","children":[["$","header",null,{"className":"border-b bg-background px-4 py-2","children":["$","h1",null,{"className":"font-semibold text-lg","children":"Assistant Transport Example"}]}],["$","main",null,{"className":"flex-1 overflow-hidden","children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@6","$@7"]}}],[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/8c25bd17dcc24038.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/01753452ac5baafa.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/_next/static/chunks/e54de45640ef90a8.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$","$9",null,{"name":"Next.MetadataOutlet","children":"$@a"}]}]]}],{},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lb",null,{"children":"$Lc"}],["$","div",null,{"hidden":true,"children":["$","$Ld",null,{"children":["$","$9",null,{"name":"Next.Metadata","children":"$Le"}]}]}],null]}],false]],"m":"$undefined","G":["$f",[]],"S":true}
|
|
14
|
+
6:{}
|
|
15
|
+
7:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params"
|
|
16
|
+
c:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
|
|
17
|
+
a:null
|
|
18
|
+
e:[["$","title","0",{"children":"assistant-ui with Assistant Transport"}],["$","meta","1",{"name":"description","content":"An example of using assistant-ui with the assistant-transport runtime"}]]
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
1:"$Sreact.fragment"
|
|
2
|
+
2:I[91802,["/_next/static/chunks/01753452ac5baafa.js","/_next/static/chunks/4a95dc46ade64fde.js"],"ViewportBoundary"]
|
|
3
|
+
3:I[91802,["/_next/static/chunks/01753452ac5baafa.js","/_next/static/chunks/4a95dc46ade64fde.js"],"MetadataBoundary"]
|
|
4
|
+
4:"$Sreact.suspense"
|
|
5
|
+
0:{"buildId":"u6DgPIAX8tUdhBwB6-mHz","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"assistant-ui with Assistant Transport"}],["$","meta","1",{"name":"description","content":"An example of using assistant-ui with the assistant-transport runtime"}]]}]}]}],null]}],"loading":null,"isPartial":false}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
1:"$Sreact.fragment"
|
|
2
|
+
2:I[58625,["/_next/static/chunks/01753452ac5baafa.js","/_next/static/chunks/4a95dc46ade64fde.js"],"default"]
|
|
3
|
+
3:I[24554,["/_next/static/chunks/01753452ac5baafa.js","/_next/static/chunks/4a95dc46ade64fde.js"],"default"]
|
|
4
|
+
:HL["/_next/static/chunks/a09b0e81b13178b3.css","style"]
|
|
5
|
+
0:{"buildId":"u6DgPIAX8tUdhBwB6-mHz","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/a09b0e81b13178b3.css","precedence":"next"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"font-sans antialiased","children":["$","div",null,{"className":"flex h-screen flex-col","children":[["$","header",null,{"className":"border-b bg-background px-4 py-2","children":["$","h1",null,{"className":"font-semibold text-lg","children":"Assistant Transport Example"}]}],["$","main",null,{"className":"flex-1 overflow-hidden","children":["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]]}]}]}]]}],"loading":null,"isPartial":false}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
:HL["/_next/static/chunks/a09b0e81b13178b3.css","style"]
|
|
2
|
+
:HL["/_next/static/chunks/8c25bd17dcc24038.css","style"]
|
|
3
|
+
0:{"buildId":"u6DgPIAX8tUdhBwB6-mHz","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":true},"staleTime":300}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,9851,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}}]);
|