mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-17 11:12:36 +00:00
renaming session-manager to conversations
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
This commit is contained in:
parent
d0c5e07f8a
commit
8632d33a36
4 changed files with 13 additions and 13 deletions
|
|
@ -74,7 +74,7 @@ jest.mock("@/components/chat-playground/chat", () => ({
|
||||||
),
|
),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
jest.mock("@/components/chat-playground/session-manager", () => ({
|
jest.mock("@/components/chat-playground/conversations", () => ({
|
||||||
SessionManager: jest.fn(({ selectedAgentId, onNewSession }) => (
|
SessionManager: jest.fn(({ selectedAgentId, onNewSession }) => (
|
||||||
<div data-testid="session-manager">
|
<div data-testid="session-manager">
|
||||||
{selectedAgentId && (
|
{selectedAgentId && (
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import type { TurnCreateParams } from "llama-stack-client/resources/agents/turn"
|
||||||
import {
|
import {
|
||||||
SessionUtils,
|
SessionUtils,
|
||||||
type ChatSession,
|
type ChatSession,
|
||||||
} from "@/components/chat-playground/session-manager";
|
} from "@/components/chat-playground/conversations";
|
||||||
export default function ChatPlaygroundPage() {
|
export default function ChatPlaygroundPage() {
|
||||||
const [currentSession, setCurrentSession] = useState<ChatSession | null>(
|
const [currentSession, setCurrentSession] = useState<ChatSession | null>(
|
||||||
null
|
null
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { render, screen, waitFor, act } from "@testing-library/react";
|
import { render, screen, waitFor, act } from "@testing-library/react";
|
||||||
import "@testing-library/jest-dom";
|
import "@testing-library/jest-dom";
|
||||||
import { SessionManager, SessionUtils } from "./session-manager";
|
import { Conversations, SessionUtils } from "./conversations";
|
||||||
import type { Message } from "@/components/chat-playground/chat-message";
|
import type { Message } from "@/components/chat-playground/chat-message";
|
||||||
|
|
||||||
interface ChatSession {
|
interface ChatSession {
|
||||||
|
|
@ -36,8 +36,8 @@ jest.mock("@/hooks/use-auth-client", () => ({
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Mock additional SessionUtils methods that are now being used
|
// Mock additional SessionUtils methods that are now being used
|
||||||
jest.mock("./session-manager", () => {
|
jest.mock("./conversations", () => {
|
||||||
const actual = jest.requireActual("./session-manager");
|
const actual = jest.requireActual("./conversations");
|
||||||
return {
|
return {
|
||||||
...actual,
|
...actual,
|
||||||
SessionUtils: {
|
SessionUtils: {
|
||||||
|
|
@ -130,7 +130,7 @@ describe("SessionManager", () => {
|
||||||
test("does not render when no agent is selected", async () => {
|
test("does not render when no agent is selected", async () => {
|
||||||
const { container } = await act(async () => {
|
const { container } = await act(async () => {
|
||||||
return render(
|
return render(
|
||||||
<SessionManager
|
<Conversations
|
||||||
selectedAgentId=""
|
selectedAgentId=""
|
||||||
currentSession={null}
|
currentSession={null}
|
||||||
onSessionChange={mockOnSessionChange}
|
onSessionChange={mockOnSessionChange}
|
||||||
|
|
@ -149,7 +149,7 @@ describe("SessionManager", () => {
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
render(
|
render(
|
||||||
<SessionManager
|
<Conversations
|
||||||
selectedAgentId="agent_123"
|
selectedAgentId="agent_123"
|
||||||
currentSession={null}
|
currentSession={null}
|
||||||
onSessionChange={mockOnSessionChange}
|
onSessionChange={mockOnSessionChange}
|
||||||
|
|
@ -166,7 +166,7 @@ describe("SessionManager", () => {
|
||||||
test("renders session selector when agent sessions are loaded", async () => {
|
test("renders session selector when agent sessions are loaded", async () => {
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
render(
|
render(
|
||||||
<SessionManager
|
<Conversations
|
||||||
selectedAgentId="agent_123"
|
selectedAgentId="agent_123"
|
||||||
currentSession={null}
|
currentSession={null}
|
||||||
onSessionChange={mockOnSessionChange}
|
onSessionChange={mockOnSessionChange}
|
||||||
|
|
@ -183,7 +183,7 @@ describe("SessionManager", () => {
|
||||||
test("renders current session name when session is selected", async () => {
|
test("renders current session name when session is selected", async () => {
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
render(
|
render(
|
||||||
<SessionManager
|
<Conversations
|
||||||
selectedAgentId="agent_123"
|
selectedAgentId="agent_123"
|
||||||
currentSession={mockSession}
|
currentSession={mockSession}
|
||||||
onSessionChange={mockOnSessionChange}
|
onSessionChange={mockOnSessionChange}
|
||||||
|
|
@ -202,7 +202,7 @@ describe("SessionManager", () => {
|
||||||
test("loads sessions from agent API on mount", async () => {
|
test("loads sessions from agent API on mount", async () => {
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
render(
|
render(
|
||||||
<SessionManager
|
<Conversations
|
||||||
selectedAgentId="agent_123"
|
selectedAgentId="agent_123"
|
||||||
currentSession={mockSession}
|
currentSession={mockSession}
|
||||||
onSessionChange={mockOnSessionChange}
|
onSessionChange={mockOnSessionChange}
|
||||||
|
|
@ -226,7 +226,7 @@ describe("SessionManager", () => {
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
render(
|
render(
|
||||||
<SessionManager
|
<Conversations
|
||||||
selectedAgentId="agent_123"
|
selectedAgentId="agent_123"
|
||||||
currentSession={mockSession}
|
currentSession={mockSession}
|
||||||
onSessionChange={mockOnSessionChange}
|
onSessionChange={mockOnSessionChange}
|
||||||
|
|
@ -257,7 +257,7 @@ describe("SessionManager", () => {
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
render(
|
render(
|
||||||
<SessionManager
|
<Conversations
|
||||||
selectedAgentId="agent_123"
|
selectedAgentId="agent_123"
|
||||||
currentSession={mockSession}
|
currentSession={mockSession}
|
||||||
onSessionChange={mockOnSessionChange}
|
onSessionChange={mockOnSessionChange}
|
||||||
|
|
@ -73,7 +73,7 @@ const generateSessionId = (): string => {
|
||||||
return globalThis.crypto.randomUUID();
|
return globalThis.crypto.randomUUID();
|
||||||
};
|
};
|
||||||
|
|
||||||
export function SessionManager({
|
export function Conversations({
|
||||||
currentSession,
|
currentSession,
|
||||||
onSessionChange,
|
onSessionChange,
|
||||||
selectedAgentId,
|
selectedAgentId,
|
||||||
Loading…
Add table
Add a link
Reference in a new issue