diff --git a/packages/frontend/src/pages/Playground.spec.ts b/packages/frontend/src/pages/Playground.spec.ts index 31e009173..1f7601676 100644 --- a/packages/frontend/src/pages/Playground.spec.ts +++ b/packages/frontend/src/pages/Playground.spec.ts @@ -108,6 +108,47 @@ test('should display playground and model names in header', async () => { }); }); +test('should display playground and parameters', async () => { + vi.mocked(studioClient.getCatalog).mockResolvedValue({ + models: [ + { + id: 'model-1', + name: 'Model 1', + }, + ] as ModelInfo[], + recipes: [], + categories: [], + }); + const customConversations = writable([ + { + id: 'playground-1', + name: 'Playground 1', + modelId: 'model-1', + messages: [], + }, + ]); + vi.mocked(conversationsStore).conversations = customConversations; + vi.mocked(inferenceServersStore).inferenceServers = readable([ + { + models: ['model-1'], + } as unknown as InferenceServer, + ]); + render(Playground, { + playgroundId: 'playground-1', + }); + + await waitFor(async () => { + const parameters = await screen.findByLabelText('parameters'); + expect(parameters.children.length).toBe(3); + const temperatureTooltip = await within(parameters.children[0] as HTMLElement).findByLabelText('tooltip'); + expect(temperatureTooltip).toBeInTheDocument(); + const maxTokensTooltip = await within(parameters.children[1] as HTMLElement).findByLabelText('tooltip'); + expect(maxTokensTooltip).toBeInTheDocument(); + const topPTooltip = await within(parameters.children[2] as HTMLElement).findByLabelText('tooltip'); + expect(topPTooltip).toBeInTheDocument(); + }); +}); + test('send prompt should be enabled initially', async () => { vi.mocked(studioClient.getCatalog).mockResolvedValue({ models: [ diff --git a/packages/frontend/src/pages/Playground.svelte b/packages/frontend/src/pages/Playground.svelte index b312372d5..dc5f512df 100644 --- a/packages/frontend/src/pages/Playground.svelte +++ b/packages/frontend/src/pages/Playground.svelte @@ -13,6 +13,8 @@ import Fa from 'svelte-fa'; import ChatMessage from '../lib/conversation/ChatMessage.svelte'; import SystemPromptBanner from '/@/lib/conversation/SystemPromptBanner.svelte'; import { inferenceServers } from '/@/stores/inferenceServers'; +import { faCircleInfo } from '@fortawesome/free-solid-svg-icons'; +import Tooltip from '/@/lib/Tooltip.svelte'; export let playgroundId: string; let prompt: string; @@ -148,10 +150,31 @@ function getSendPromptTitle(sendEnabled: boolean, status?: string, health?: stri
Next prompt will use these settings
Model Parameters
-
- - - +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +