翻篇收录说明
翻篇网页快照

Cookbooks - TypeSafe

https://docs.typesafe.ai/cookbooks

最近抓取:2026-12-04 05:17:01(北京时间)

最近内容变化:2026-12-01 03:25:14(北京时间)

这是最近一次有效抓取的文本快照,不含网页脚本、图片和动态交互内容。实际网页可能已更新。

访问原网页

页面简介

End-to-end recipes that show TypeSafe in real problems, from a few questions to full pipelines.

正文摘录

Each cookbook is a worked example: a real dataset, the System One questions that decide something about it, and the code that turns those decisions into a working system. Read one when you want to see how the primitives and patterns come together on a concrete problem, or copy one as the starting point for your own. This section assumes you know the TypeSafe primitives and understand how confidence works. If not, read those first. Each cookbook is listed once, under the problem it solves. Many also use techniques from other sections. LLMs and agents Use Jev alongside an LLM or agent: pick tools and skills, screen what goes in and out, and check what comes back. CookbookWhat it doesLevelFunction callingTurns natural-language trading requests into calls to ordinary typed functions by mapping function names and closed-set arguments to confidence-aware System One questions.IntermediateSkill suggestionPicks at most one skill for an agent turn out of the 194 in Nous Research’s Hermes catalog, using two TypeSafe requests to rank and re-check the top candidates.IntermediateGuardrails for LLMsScreens every message into and out of an LLM app with one TypeSafe request, then passes, reviews, blocks, or sends it to support by thresholds you set.IntermediateDouble-checking citationsCatch wrong or hallucinated citations by checking against the source document. One Choice question decides whether the quote’s context supports the claim.BeginnerVerifying LLM answers against their sourceCheck whether an LLM’s answer follows from the paragraphs it was given, using three Noul questions in one request, and send the doubtful answers to review.BeginnerClassifying RAG passagesScore each retrieved passage with one TypeSafe request, then decide in code which ones reach the answering model.IntermediateSimple memory systemLet Jev decide which requests and answers are worth remembering, then wrap the Jev call in a small function that adds memories to later calls.Beginner Classification Assign inputs to categories at any depth. CookbookWhat it doesLevelHierarchical classificationUses parallel beam search over Jev’s Choice probabilities to classify documents in deep patent, retail product, and biomedical hierarchies.IntermediateClassification using confidenceClassify SEC annual reports into 75 industry groups with one Choice each, then read the answer’s own confidence to decide whether to report that group or the broader division above it.BeginnerTwitch chat filterHides insults, spam, and unasked-for gameplay tips in Twitch chat, blurs spoilers, and highlights questions. Each message gets one TypeSafe request with three questions, requests run concurrently, and plain rules in code turn the answers into what the viewer sees.Beginner Extraction Pull typed values and structure out of messy text. CookbookWhat it doesLevelSDE cascadeExtracts structured data with a cheap model, checks each field with Jev, and escalates to a reasoning model only when a check fires.IntermediateDate extractionExtracts absolute and relative dates by asking Jev for the parts named in a document, then resolving and validating them in code with confidence-based review.BeginnerPre-parsed value extractionFinds candidate emails, phone numbers, and amounts with a regex, has Jev pick the one you ask for, and normalizes that exact span in code.BeginnerStructure recoveryReconstructs Markdown from plain text that lost its formatting in two requests: one stitches hard-wrapped lines back together, one classifies every block (heading, list, code, callout).BeginnerShopping cartTurns a natural-language cafe order into a structured cart: a shrinking-options loop of Choice questions finds every item, then one batched request per item fills its known fields.Beginner Search and matching Find the lines, passages, or records that match a query or each other. CookbookWhat it doesLevelRe-rankingBuilds 30-passage BM25 shortlists for 40 CLERC legal queries, then uses one System One question per query-candidate pair to raise top-1 accuracy from 5% to 30% and top-10 accuracy from 38% to 65%.BeginnerInfinite cardinality choiceFrom someone’s own description, find the film they half-remember among 5,000: one Noul per film on a short plot, again on a long plot for the top eighty, and one Choice over the top twenty. The right film comes first 78% of the time, against 33% when embedding search builds the shortlist.IntermediateLine-by-line searchBuild semantic search for GitHub’s Terms of Service. In one request, score 218 line ids against a plain-language query with a Choice question, and use a Noul question to check whether the document contains an answer.BeginnerKnowledge graph entity alignmentRoute candidate record pairs from two sources to a merge recommendation, manual review, or no link, using one Score question. Three Noul questions check individual fields. The worked example uses 450 album pairs from Wikidata and MusicBrainz.BeginnerIntelliprompterTick off a presenter’s notes as they speak: Jev scores the live transcript against each note not yet covered, and a note stays ticked once its score passes the threshold.Beginner Techniques Get more out of any question: repeat it, batch it, or turn its answers into features. CookbookWhat it doesLevelSelf-consistency: choicesAsk a model the same moderation question twice: how often does the decision change? A test of reliability that needs no answer key, comparing LLMs and Jev on borderline posts.BeginnerSelf-consistency: noulsAsk a model about the same insurance claim twice: how often does the decision change? A test of reliability that needs no answer key, comparing LLMs and Jev on borderline claims.BeginnerParallel questionsRuns a 13-question regulatory briefing over the GDPR Wikipedia article, showing that batching every question into one TypeSafe call is 12.2x cheaper and 11.8x faster with no change in answers.BeginnerAutoresearch feature discoveryLet an LLM propose questions about labelled text, have Jev answer them for every row, and train CatBoost on the answers, feeding its misses back to the next step. The worked example predicts how polite Wikipedia editors’ requests read.Advanced Image processing Find things in photos and scans, and check what was read from them. CookbookWhat it doesLevelReading a scanned vaccination recordFind each vaccine on a scanned travel record with a Noul and a Box, read the year of each dose with a Choice that can answer unreadable, and check each dose still covers the trip in a text-only request.IntermediateOCR confidence and bounding boxesCheck the values an OCR extractor read from invoice photos: Jev boxes each value, scores it against the page and against a crop of its box, and flags low scores for review.IntermediateFeeder-cam visit logSend frames from bird feeder camera footage to Jev with five questions, one of them a Box that finds the bird, then use plain code to turn the answers into a visit log per species.Intermediate We’re always keen to learn how people are making use of our primitives. If you’ve built something worth a cookbook, drop us a note!Was this page helpful?YesNo