Skip to content

Commit dcdd374

Browse files
committed
Chapter 0: Basic chat starting point (tool-free)
- Remove all AI tools (weather, create/update document, suggestions) - Remove all agent definitions (tutor, quiz master, planner, analyst) - Remove custom artifacts (flashcard, study-plan) - Simplify prompts to basic chat without tool routing - Keep UI components with placeholder types for rendering - Exclude tempfiles from TypeScript compilation
1 parent 55d445d commit dcdd374

File tree

20 files changed

+33
-1444
lines changed

20 files changed

+33
-1444
lines changed

app/(chat)/api/chat/route.ts

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
createUIMessageStream,
55
JsonToSseTransformStream,
66
smoothStream,
7-
stepCountIs,
87
streamText,
98
} from "ai";
109
import { unstable_cache as cache } from "next/cache";
@@ -22,20 +21,10 @@ import { fetchModels } from "tokenlens/fetch";
2221
import { getUsage } from "tokenlens/helpers";
2322
import { auth, type UserType } from "@/app/(auth)/auth";
2423
import type { VisibilityType } from "@/components/visibility-selector";
25-
import {
26-
createAnalystAgent,
27-
createPlannerAgent,
28-
createQuizMasterAgent,
29-
createTutorAgent,
30-
} from "@/lib/ai/agents";
3124
import { entitlementsByUserType } from "@/lib/ai/entitlements";
3225
import type { ChatModel } from "@/lib/ai/models";
3326
import { type RequestHints, systemPrompt } from "@/lib/ai/prompts";
3427
import { myProvider } from "@/lib/ai/providers";
35-
import { createDocument } from "@/lib/ai/tools/create-document";
36-
import { getWeather } from "@/lib/ai/tools/get-weather";
37-
import { requestSuggestions } from "@/lib/ai/tools/request-suggestions";
38-
import { updateDocument } from "@/lib/ai/tools/update-document";
3928
import { isProductionEnvironment } from "@/lib/constants";
4029
import {
4130
createStreamId,
@@ -186,36 +175,7 @@ export async function POST(request: Request) {
186175
model: myProvider.languageModel(selectedChatModel),
187176
system: systemPrompt({ selectedChatModel, requestHints }),
188177
messages: convertToModelMessages(uiMessages),
189-
stopWhen: stepCountIs(5),
190-
experimental_activeTools:
191-
selectedChatModel === "chat-model-reasoning"
192-
? []
193-
: [
194-
"getWeather",
195-
"createDocument",
196-
"updateDocument",
197-
"requestSuggestions",
198-
// Study buddy agents
199-
"tutor",
200-
"quizMaster",
201-
"planner",
202-
"analyst",
203-
],
204178
experimental_transform: smoothStream({ chunking: "word" }),
205-
tools: {
206-
getWeather,
207-
createDocument: createDocument({ session, dataStream }),
208-
updateDocument: updateDocument({ session, dataStream }),
209-
requestSuggestions: requestSuggestions({
210-
session,
211-
dataStream,
212-
}),
213-
// Study buddy agents
214-
tutor: createTutorAgent({ session, dataStream }),
215-
quizMaster: createQuizMasterAgent({ session, dataStream }),
216-
planner: createPlannerAgent({ session, dataStream }),
217-
analyst: createAnalystAgent({ session, dataStream }),
218-
},
219179
experimental_telemetry: {
220180
isEnabled: isProductionEnvironment,
221181
functionId: "stream-text",

artifacts/flashcard/client.tsx

Lines changed: 0 additions & 223 deletions
This file was deleted.

artifacts/flashcard/server.ts

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)