Skip to content

Commit bdf2d19

Browse files
committed
fix build
1 parent 3391c02 commit bdf2d19

File tree

11 files changed

+38
-36
lines changed

11 files changed

+38
-36
lines changed

nextjs-starter/app/demo.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { b } from "../baml_client";
2+
3+
async function main() {
4+
const result = await b.ClassifyMessage([
5+
6+
])
7+
8+
result
9+
}

nextjs-starter/app/examples/book-analyzer/Charts.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client";
22

3-
import { BookAnalysis } from "@/baml_client";
3+
import type { partial_types } from "@/baml_client/partial_types";
44
import {
55
BarChart
66
} from "@/components/charts/bar_chart";
@@ -11,7 +11,7 @@ import {
1111
import {
1212
BarList
1313
} from "@/components/charts/bar_list";
14-
import { b, RecursivePartialNull } from "@/baml_client/async_client";
14+
import { b } from "@/baml_client/async_client";
1515
import { Card, CardContent, CardTitle } from "@/components/ui/card";
1616
import { useEffect, useMemo, useState } from "react";
1717
import { PopularityLineChart as InternalPopularityLineChart } from "./PopularityChart";
@@ -20,7 +20,7 @@ export const PopularityLineChart = ({
2020
popularityData,
2121
bookColors,
2222
}: {
23-
popularityData: RecursivePartialNull<BookAnalysis>['popularityOverTime'];
23+
popularityData: partial_types.BookAnalysis['popularityOverTime'];
2424
bookColors: Record<string, string>;
2525
}) => {
2626
// Transform into {date: year, [book]: score}[]

nextjs-starter/app/examples/book-analyzer/RankingChart.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@
33
import { Bar, BarChart, XAxis, YAxis, Cell } from "recharts"
44
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
55
import { ChartContainer, ChartTooltip, ChartTooltipContent } from "@/components/ui/chart"
6-
7-
interface RankingItem {
8-
bookName?: string | null
9-
score?: number | null
10-
}
6+
import type { partial_types } from "@/baml_client/partial_types"
117

128
interface RankingChartProps {
13-
rankingData: (RankingItem | undefined)[] | null | undefined
9+
rankingData: partial_types.BookAnalysis['popularityRankings'] | null | undefined
1410
bookColors: Record<string, string>
1511
}
1612

nextjs-starter/app/examples/book-analyzer/Shared.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ export const Content: React.FC<{
136136
{books.map((book, index) => (
137137
<div key={index} className="relative">
138138
<button
139+
type="button"
139140
className="text-blue-900 dark:text-blue-100 p-2 rounded-md flex items-center gap-2 hover:bg-blue-100 transition-colors"
140141
onClick={() => setActiveColorPicker(activeColorPicker === book ? null : book)}
141142
>

nextjs-starter/app/examples/book-analyzer/WordCount.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@
33
import { Bar, BarChart, XAxis, YAxis, Cell } from "recharts"
44
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
55
import { ChartContainer, ChartTooltip, ChartTooltipContent } from "@/components/ui/chart"
6-
7-
interface WordCountItem {
8-
bookName?: string | null
9-
count?: number | null
10-
}
6+
import type { partial_types } from "@/baml_client/partial_types"
117

128
interface WordCountChartProps {
13-
wordCountData: (WordCountItem | undefined)[] | null | undefined
9+
wordCountData: partial_types.BookAnalysis['wordCounts'] | null | undefined
1410
bookColors: Record<string, string>
1511
}
1612

nextjs-starter/app/examples/get-recipe/Recipe.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
"use client";
22

3-
import { Ingredient, PartIngredient, PartSteps, Recipe } from "@/baml_client";
3+
import type { Ingredient, partial_types, PartIngredient, PartSteps, Recipe, RecursivePartialNull } from "@/baml_client";
44
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
55
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
6-
import { RecursivePartialNull } from "@/baml_client/async_client";
76
import { Slider } from "@/components/ui/slider";
8-
import { ReactNode, useEffect, useState } from "react";
7+
import { type ReactNode, useEffect, useState } from "react";
98
import { CheckCircle, Loader2 } from "lucide-react";
109
import { ScrollArea } from "@/components/ui/scroll-area";
1110

@@ -15,7 +14,7 @@ export const RecipeRender = ({
1514
state,
1615
}: {
1716
name: string;
18-
recipe: RecursivePartialNull<Recipe>;
17+
recipe: partial_types.Recipe;
1918
state: "idle" | "instructions" | "ingredients" | "done";
2019
}) => {
2120
const [servings, setServings] = useState(recipe.number_of_servings);
@@ -101,7 +100,7 @@ const IngredientListRender = ({
101100
ratio,
102101
inProgress
103102
}: {
104-
ingredients: RecursivePartialNull<Recipe>["ingredients"];
103+
ingredients: partial_types.Recipe["ingredients"];
105104
ratio: number;
106105
inProgress?: boolean;
107106
}) => {
@@ -112,7 +111,7 @@ const IngredientListRender = ({
112111
if ("title" in ingredients[0]!) {
113112
return (
114113
<div className="space-y-6">
115-
{(ingredients as RecursivePartialNull<PartIngredient>[]).map(
114+
{(ingredients as partial_types.PartIngredient[]).map(
116115
(part, index) =>
117116
part && (
118117
<div key={index}>
@@ -142,7 +141,7 @@ const IngredientListRender = ({
142141

143142
return (
144143
<div className="grid grid-cols-1 sm:grid-cols-2 gap-2">
145-
{(ingredients as Ingredient[]).map((ingredient, index) => (
144+
{(ingredients as partial_types.Ingredient[]).map((ingredient, index) => (
146145
<IngredientRender key={index} ingredient={ingredient} ratio={ratio} />
147146
))}
148147
</div>
@@ -230,7 +229,7 @@ const IngredientRender = ({
230229
ratio,
231230
isLast
232231
}: {
233-
ingredient: RecursivePartialNull<Ingredient>;
232+
ingredient: partial_types.Ingredient;
234233
ratio: number;
235234
isLast?: boolean;
236235
}) => {
@@ -250,7 +249,7 @@ const IngredientRender = ({
250249
const InstructionListRender = ({
251250
instructions,
252251
}: {
253-
instructions: RecursivePartialNull<Recipe>["instructions"];
252+
instructions: partial_types.Recipe["instructions"];
254253
}) => {
255254
if (!instructions || instructions.length === 0) {
256255
return <p className="text-gray-500">No instructions found.</p>;
@@ -284,7 +283,7 @@ const InstructionListRender = ({
284283
const InstructionRender = ({
285284
instruction,
286285
}: {
287-
instruction: RecursivePartialNull<PartSteps>["steps"];
286+
instruction: partial_types.PartSteps["steps"];
288287
}) => {
289288
return (
290289
<ol className="list-decimal list-inside space-y-2">

nextjs-starter/app/examples/get-recipe/Shared.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
1414
import { ScrollArea } from "@/components/ui/scroll-area"
1515
import { Badge } from "@/components/ui/badge"
1616
import JsonView from 'react18-json-view'
17+
import { partial_types } from "@/baml_client"
1718

1819
export const Content: React.FC<{
1920
query: string
@@ -104,7 +105,7 @@ export const Content: React.FC<{
104105
exit={{ opacity: 0, y: -20 }}
105106
transition={{ duration: 0.5 }}
106107
>
107-
<RecipeRender name={name} recipe={data} state={state} />
108+
<RecipeRender name={name} recipe={data as partial_types.Recipe} state={state} />
108109
</motion.div>
109110
)}
110111
</AnimatePresence>

nextjs-starter/app/examples/guide/Recipe.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ import { CheckCircle, Loader2, ChevronDown, ChevronRight } from "lucide-react";
99
import { ScrollArea } from "@/components/ui/scroll-area";
1010
import { searchProsource, type SearchResult, type Classification, type NonNullableQuery } from "@/app/actions/prosource";
1111
import { Badge } from "@/components/ui/badge";
12-
12+
import type { partial_types } from "@/baml_client/partial_types";
1313
export const GuideRender = ({
1414
name,
1515
guide,
1616
state,
1717
}: {
1818
name: string;
19-
guide: RecursivePartialNull<Guide>;
19+
guide: partial_types.Guide;
2020
state: "idle" | "loading" | "success";
2121
}) => {
2222
const filterTopics = (category: "packaging" | "processing") =>

nextjs-starter/app/examples/guide/Shared.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
1414
import { ScrollArea } from "@/components/ui/scroll-area"
1515
import { Badge } from "@/components/ui/badge"
1616
import JsonView from 'react18-json-view'
17+
import { partial_types } from "@/baml_client/partial_types"
1718

1819
export const Content: React.FC<{
1920
query: string
@@ -101,7 +102,7 @@ export const Content: React.FC<{
101102
exit={{ opacity: 0, y: -20 }}
102103
transition={{ duration: 0.5 }}
103104
>
104-
<GuideRender name={name} guide={data} state={state} />
105+
<GuideRender name={name} guide={data as partial_types.Guide} state={state} />
105106
</motion.div>
106107
)}
107108
</AnimatePresence>

nextjs-starter/app/examples/rag/Content.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ import examples from "./examples"
1919
import Link from "next/link"
2020
import { PropsWithChildren, useEffect, useState } from "react"
2121
import ErrorPreview from "../stream-object/ErrorPreview"
22-
import { RecursivePartialNull } from "@/baml_client/async_client"
2322
import { motion } from "framer-motion"
2423
import JsonView from "react18-json-view"
2524
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
2625
import { ScrollArea } from "@/components/ui/scroll-area"
2726
import { Badge } from "@/components/ui/badge"
2827
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"
28+
import type { partial_types } from "@/baml_client/partial_types"
2929

3030
export const Content: React.FC<{
3131
question: string
@@ -152,7 +152,7 @@ export const AnswerContent: React.FC<{
152152
)
153153
}
154154

155-
const RenderAnswer: React.FC<{ data: RecursivePartialNull<Answer> }> = ({
155+
const RenderAnswer: React.FC<{ data: partial_types.Answer }> = ({
156156
data: { answer, answersInText },
157157
}) => {
158158
if (!answersInText)
@@ -328,7 +328,7 @@ const DebugPanel: React.FC<{
328328
)
329329
}
330330

331-
const ShowCitation: React.FC<{ citation: RecursivePartialNull<Citation> }> = ({
331+
const ShowCitation: React.FC<{ citation: partial_types.Citation }> = ({
332332
citation,
333333
}) => {
334334
const context =

nextjs-starter/app/examples/stream-object/PartialResume.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,16 @@ import {
1717
ChevronDown,
1818
ChevronUp,
1919
} from "lucide-react";
20-
import { RecursivePartialNull } from "@/baml_client/async_client";
21-
import { Resume } from "@/baml_client/types";
2220
import { ErrorWrapper } from "../_components/ErrorWrapper";
21+
import type { partial_types } from "@/baml_client/partial_types";
2322

2423
const PartialResume = ({
2524
resume,
2625
}: {
27-
resume: RecursivePartialNull<Resume>;
26+
resume: partial_types.Resume;
2827
}) => {
2928
const [isWhyHireOpen, setIsWhyHireOpen] = useState(false);
30-
const prevResumeRef = useRef<RecursivePartialNull<Resume>>({});
29+
const prevResumeRef = useRef<partial_types.Resume>({});
3130

3231
useEffect(() => {
3332
prevResumeRef.current = resume;

0 commit comments

Comments
 (0)