Skip to content

Commit

Permalink
Merge pull request #40 from MarcusElwin/fix/intent-post-v3
Browse files Browse the repository at this point in the history
fix: fixes to latest post again
  • Loading branch information
MarcusElwin committed Jun 15, 2024
2 parents 8699aa8 + 6a1edc5 commit 3c8d29a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ds-with-mac/content/posts/intent-detection/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ The intent we can deduce based on the query above is the following:

To model this we want to use <cite>`zod`[^3]</cite>. Luckily for us, many LLM(s) are good at `functionCalling` and extracting `structuredOutput` based on a provided schema.

[^3]: This is somewhat similar to `Pydantic` in Python.

A `zod` object for our task could look like the below:
{{< highlight typescript "linenos=inline, style=monokailight" >}}
import { z } from 'zod';
Expand All @@ -194,8 +196,6 @@ const zDetectFoodIntentResponse = z.object({
)
});

[^3]: This is somewhat similar to `Pydantic` in Python.

/* Infer type */
type FoodIntentDetectionResponse = z.infer<typeof zDetectFoodIntentResponse>;
{{< / highlight >}}
Expand Down

0 comments on commit 3c8d29a

Please sign in to comment.