140 | {message.parts?.map((part, i) => {
141 | switch (part.type) {
142 | case "text":
143 | return (
144 |
150 |
156 | {part.text}
157 |
158 |
159 | );
160 | // TODO: add your other tools here
161 | case "tool-getWeather":
162 | const { state } = part;
163 |
164 | return (
165 |
171 |
172 |
175 |
176 |
177 | {state === "input-streaming" ? "Calling" : "Called"}{" "}
178 |
179 | {getToolName(part)}
180 |
181 |
182 |
183 |
184 | {state === "input-streaming" ? (
185 | isLatestMessage && status !== "ready" ? (
186 |
187 | ) : (
188 |
189 | )
190 | ) : state === "output-available" ? (
191 |
192 | ) : null}
193 |
194 |
195 |
196 | );
197 | case "reasoning":
198 | return (
199 |
209 | );
210 | default:
211 | return null;
212 | }
213 | })}
214 |