File size: 3,568 Bytes
867b17d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
import type { ModelMessage } from 'ai';

export const TEST_PROMPTS: Record<string, ModelMessage> = {
  USER_SKY: {
    role: 'user',
    content: [{ type: 'text', text: 'Why is the sky blue?' }],
  },
  USER_GRASS: {
    role: 'user',
    content: [{ type: 'text', text: 'Why is grass green?' }],
  },
  USER_THANKS: {
    role: 'user',
    content: [{ type: 'text', text: 'Thanks!' }],
  },
  USER_NEXTJS: {
    role: 'user',
    content: [
      { type: 'text', text: 'What are the advantages of using Next.js?' },
    ],
  },
  USER_IMAGE_ATTACHMENT: {
    role: 'user',
    content: [
      {
        type: 'file',
        mediaType: '...',
        data: '...',
      },
      {
        type: 'text',
        text: 'Who painted this?',
      },
    ],
  },
  USER_TEXT_ARTIFACT: {
    role: 'user',
    content: [
      {
        type: 'text',
        text: 'Help me write an essay about Silicon Valley',
      },
    ],
  },
  CREATE_DOCUMENT_TEXT_CALL: {
    role: 'user',
    content: [
      {
        type: 'text',
        text: 'Essay about Silicon Valley',
      },
    ],
  },
  CREATE_DOCUMENT_TEXT_RESULT: {
    role: 'tool',
    content: [
      {
        type: 'tool-result',
        toolCallId: 'call_123',
        toolName: 'createDocument',
        output: {
          type: 'json',
          value: {
            id: '3ca386a4-40c6-4630-8ed1-84cbd46cc7eb',
            title: 'Essay about Silicon Valley',
            kind: 'text',
            content: 'A document was created and is now visible to the user.',
          },
        },
      },
    ],
  },
  GET_WEATHER_CALL: {
    role: 'user',
    content: [
      {
        type: 'text',
        text: "What's the weather in sf?",
      },
    ],
  },
  GET_WEATHER_RESULT: {
    role: 'tool',
    content: [
      {
        type: 'tool-result',
        toolCallId: 'call_456',
        toolName: 'getWeather',
        output: {
          type: 'json',
          value: {
            latitude: 37.763283,
            longitude: -122.41286,
            generationtime_ms: 0.06449222564697266,
            utc_offset_seconds: -25200,
            timezone: 'America/Los_Angeles',
            timezone_abbreviation: 'GMT-7',
            elevation: 18,
            current_units: {
              time: 'iso8601',
              interval: 'seconds',
              temperature_2m: '°C',
            },
            current: {
              time: '2025-03-10T14:00',
              interval: 900,
              temperature_2m: 17,
            },
            daily_units: {
              time: 'iso8601',
              sunrise: 'iso8601',
              sunset: 'iso8601',
            },
            daily: {
              time: [
                '2025-03-10',
                '2025-03-11',
                '2025-03-12',
                '2025-03-13',
                '2025-03-14',
                '2025-03-15',
                '2025-03-16',
              ],
              sunrise: [
                '2025-03-10T07:27',
                '2025-03-11T07:25',
                '2025-03-12T07:24',
                '2025-03-13T07:22',
                '2025-03-14T07:21',
                '2025-03-15T07:19',
                '2025-03-16T07:18',
              ],
              sunset: [
                '2025-03-10T19:12',
                '2025-03-11T19:13',
                '2025-03-12T19:14',
                '2025-03-13T19:15',
                '2025-03-14T19:16',
                '2025-03-15T19:17',
                '2025-03-16T19:17',
              ],
            },
          },
        },
      },
    ],
  },
};