Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions components/suggested-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@ function PureSuggestedActions({
}: SuggestedActionsProps) {
const suggestedActions = [
{
title: 'What are the advantages',
label: 'of using Next.js?',
action: 'What are the advantages of using Next.js?',
title: 'Explain the evolution',
label: 'of contemporary art',
action: 'Explain the evolution of contemporary art',
},
{
title: 'Write code to',
label: `demonstrate djikstra's algorithm`,
action: `Write code to demonstrate djikstra's algorithm`,
title: 'What are the latest trends',
label: 'in sustainable fashion?',
action: 'What are the latest trends in sustainable fashion?',
},
{
title: 'Help me write an essay',
label: `about silicon valley`,
action: `Help me write an essay about silicon valley`,
title: 'Help me understand',
label: 'quantum computing technology',
action: 'Help me understand quantum computing technology',
},
{
title: 'What is the weather',
label: 'in San Francisco?',
action: 'What is the weather in San Francisco?',
title: 'Recommend a skincare routine',
label: 'for sensitive skin',
action: 'Recommend a skincare routine for sensitive skin',
},
];

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/chat.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test.describe('Chat activity', () => {

const assistantMessage = await chatPage.getRecentAssistantMessage();
expect(assistantMessage.content).toContain(
'With Next.js, you can ship fast!',
'Contemporary art has evolved through various movements!',
);
});

Expand Down
2 changes: 1 addition & 1 deletion tests/pages/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class ChatPage {

async sendUserMessageFromSuggestion() {
await this.page
.getByRole('button', { name: 'What are the advantages of' })
.getByRole('button', { name: 'Explain the evolution of' })
.click();
}

Expand Down
6 changes: 6 additions & 0 deletions tests/prompts/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ export const TEST_PROMPTS: Record<string, ModelMessage> = {
{ type: 'text', text: 'What are the advantages of using Next.js?' },
],
},
USER_ART: {
role: 'user',
content: [
{ type: 'text', text: 'Explain the evolution of contemporary art' },
],
},
USER_IMAGE_ATTACHMENT: {
role: 'user',
content: [
Expand Down
10 changes: 10 additions & 0 deletions tests/prompts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@ export const getResponseChunksByPrompt = (
return [
...textToDeltas('With Next.js, you can ship fast!'),

{
type: 'finish',
finishReason: 'stop',
usage: { inputTokens: 3, outputTokens: 10, totalTokens: 13 },
},
];
} else if (compareMessages(recentMessage, TEST_PROMPTS.USER_ART)) {
return [
...textToDeltas('Contemporary art has evolved through various movements!'),

{
type: 'finish',
finishReason: 'stop',
Expand Down
Loading