Skip to content

An AI-powered search engine with a generative UI

chore: Remove Spinner

Yoshiki Miurab2a9acf4dc38
diff --git a/app/actions.tsx b/app/actions.tsx
index a4be77ac..67a2e3c2 100644
--- a/app/actions.tsx
+++ b/app/actions.tsx
@@ -134,7 +134,6 @@ async function submit(
let toolOutputs: ToolResultPart[] = []
let errorOccurred = false
const streamText = createStreamableValue<string>()
- uiStream.update(<Spinner />)
// If useSpecificAPI is enabled, only function calls will be made
// If not using a tool, this model generates the answer
diff --git a/lib/agents/researcher.tsx b/lib/agents/researcher.tsx
index c1dbc074..d10a96b8 100644
--- a/lib/agents/researcher.tsx
+++ b/lib/agents/researcher.tsx
@@ -44,14 +44,7 @@ export async function researcher(
tools: getTools({
uiStream,
fullResponse
- }),
- onFinish: event => {
- // If the response is generated, update the generated answer section
- // There is a bug where a new instance of the answer section is displayed once when the next section is added
- if (event.text.length > 0) {
- uiStream.update(<AnswerSectionGenerated result={event.text} />)
- }
- }
+ })
}).catch(err => {
hasError = true
fullResponse = 'Error: ' + err.message
@@ -63,9 +56,6 @@ export async function researcher(
return { result, fullResponse, hasError, toolResponses: [] }
}
- // Remove the spinner
- uiStream.update(null)
-
// Process the response
const toolCalls: ToolCallPart[] = []
const toolResponses: ToolResultPart[] = []
@@ -73,12 +63,6 @@ export async function researcher(
switch (delta.type) {
case 'text-delta':
if (delta.textDelta) {
- // If the first text delta is available, add a UI section
- if (fullResponse.length === 0 && delta.textDelta.length > 0) {
- // Update the UI
- uiStream.update(answerSection)
- }
-
fullResponse += delta.textDelta
streamableText.update(fullResponse)
}