Minor Changes
-
#12184
5a21380Thanks @thushanth-bengre-langchain! - feat(typesafe)!: implementTypeSafeClassifieras a decision modelTypeSafeClassifiernow extendsBaseDecisionModelfrom@langchain/core/decisionsand requires@langchain/core>= 1.4.0. This is a breaking change:- Questions are passed with each request instead of to the constructor:
new TypeSafeClassifier().invoke({ state, questions })replacesnew TypeSafeClassifier({ questions }).invoke(state) - Responses are core's
ClassifierResponse. Token usage isusage_metadata(input_tokens,output_tokens,total_tokens) instead ofusage(inputTokens,outputTokens) - Question and answer types are re-exported from core, and every question requires
instructions.ClassificationResponse,QuestionContent(nowContent),Usage,ValidatedQuestions,JsonValue, andTypeSafeClassifierCallOptionsare removed - Add
Boxquestions, and send image content blocks in state or question content as TypeSafe image assets - An invalid question now throws a plain
Errorfrominvokeinstead of aTypeSafeErrorfrom the constructor Stateis core's type, which no longer listsDate; dates are still sent as ISO strings
- Questions are passed with each request instead of to the constructor:
Patch Changes
-
#12192
9920d4bThanks @jkennedyvz! - Require Zod 4.6.6 or newer for installed dependencies to exclude versions affected by GHSA-mrhx-c7xc-m3w5. Zod v3 schemas remain supported through the bundledzod/v3entry point. -
#12186
035b74bThanks @thushanth-bengre-langchain! - refactor(typesafe): deprecate experimental middleware- Deprecate
autoModeMiddlewareandmodelRouterMiddlewarefrom@langchain/typesafe/middleware. They warn once when called and will be removed in 0.2.0 - Use
autoModeMiddlewareandmodelRouterMiddlewarefromlangchainwithclassifier: new TypeSafeClassifier()instead
- Deprecate