Skip to content

Commit 38b2e26

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/v1.5-upgrade
2 parents 981e1ce + eae9f11 commit 38b2e26

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

apps/dojo/src/components/sidebar/sidebar.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import React, { useState, useEffect } from "react";
44
import { EyeIcon as Eye, CodeIcon as Code, BookOpenTextIcon as Book } from "@phosphor-icons/react";
55
import { cn } from "@/lib/utils";
6-
import { useRouter, usePathname } from "next/navigation";
6+
import { useRouter, usePathname, useSearchParams } from "next/navigation";
77
import { DemoList } from "@/components/demo-list/demo-list";
88
import { ThemeToggle } from "@/components/ui/theme-toggle";
99
import { ChevronDown } from "lucide-react";
@@ -31,6 +31,7 @@ interface SidebarProps {
3131
export function Sidebar({ isMobile, onMobileClose }: SidebarProps) {
3232
const router = useRouter();
3333
const pathname = usePathname();
34+
const searchParams = useSearchParams();
3435
const { theme, setTheme } = useTheme();
3536
const isDarkTheme = theme === "dark"
3637
const { view, frameworkPickerHidden, viewPickerHidden, featurePickerHidden, setView} = useURLParams();
@@ -56,7 +57,10 @@ export function Sidebar({ isMobile, onMobileClose }: SidebarProps) {
5657
// Handle selecting a demo
5758
const handleDemoSelect = (demoId: string) => {
5859
if (currentIntegration) {
59-
router.push(`/${currentIntegration.id}/feature/${demoId}`);
60+
const queryString = searchParams.toString();
61+
const newPath = `/${currentIntegration.id}/feature/${demoId}`;
62+
const url = queryString ? `${newPath}?${queryString}` : newPath;
63+
router.push(url);
6064
// Close mobile sidebar when demo is selected
6165
if (isMobile && onMobileClose) {
6266
onMobileClose();
@@ -66,7 +70,10 @@ export function Sidebar({ isMobile, onMobileClose }: SidebarProps) {
6670

6771
// Handle integration selection
6872
const handleIntegrationSelect = (integrationId: string) => {
69-
router.push(`/${integrationId}`);
73+
const queryString = searchParams.toString();
74+
const newPath = `/${integrationId}`;
75+
const url = queryString ? `${newPath}?${queryString}` : newPath;
76+
router.push(url);
7077
};
7178

7279
const tabClass = `cursor-pointer flex-1 h-8 px-2 text-sm text-primary shadow-none bg-none border-none font-medium gap-1 rounded-lg data-[state=active]:bg-white data-[state=active]:text-primary data-[state=active]:shadow-none`

integrations/langgraph/python/ag_ui_langgraph/agent.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ async def _handle_stream_events(self, input: RunAgentInput) -> AsyncGenerator[st
235235
CustomEvent(
236236
type=EventType.CUSTOM,
237237
name=LangGraphEventTypes.OnInterrupt.value,
238-
value=json.dumps(interrupt.value, default=json_safe_stringify) if not isinstance(interrupt.value, str) else interrupt.value,
238+
value=dump_json_safe(interrupt.value),
239239
raw_event=interrupt,
240240
)
241241
)
@@ -311,7 +311,7 @@ async def prepare_stream(self, input: RunAgentInput, agent_state: State, config:
311311
CustomEvent(
312312
type=EventType.CUSTOM,
313313
name=LangGraphEventTypes.OnInterrupt.value,
314-
value=json.dumps(interrupt.value) if not isinstance(interrupt.value, str) else interrupt.value,
314+
value=dump_json_safe(interrupt.value),
315315
raw_event=interrupt,
316316
)
317317
)
@@ -696,7 +696,7 @@ async def _handle_single_event(self, event: Any, state: State) -> AsyncGenerator
696696
ToolCallArgsEvent(
697697
type=EventType.TOOL_CALL_ARGS,
698698
tool_call_id=tool_call_output.tool_call_id,
699-
delta=json.dumps(event["data"]["input"]),
699+
delta=dump_json_safe(event["data"]["input"]),
700700
raw_event=event
701701
)
702702
)
@@ -713,7 +713,7 @@ async def _handle_single_event(self, event: Any, state: State) -> AsyncGenerator
713713
type=EventType.TOOL_CALL_RESULT,
714714
tool_call_id=tool_call_output.tool_call_id,
715715
message_id=str(uuid.uuid4()),
716-
content=tool_call_output.content,
716+
content=dump_json_safe(tool_call_output.content),
717717
role="tool"
718718
)
719719
)
@@ -872,3 +872,7 @@ def get_stream_kwargs(
872872
kwargs.update(fork)
873873

874874
return kwargs
875+
876+
877+
def dump_json_safe(value):
878+
return json.dumps(value, default=json_safe_stringify) if not isinstance(value, str) else value

integrations/langgraph/python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "ag-ui-langgraph"
3-
version = "0.0.17"
3+
version = "0.0.19"
44
description = "Implementation of the AG-UI protocol for LangGraph."
55
authors = ["Ran Shem Tov <[email protected]>"]
66
readme = "README.md"

0 commit comments

Comments
 (0)