Close the gaps where the 0.6 features met each other - #23
Merged
Merged
Conversation
Images now reach the model through Predict and ChainOfThought. A signature declaring an image input had it flattened to an [image: ...] placeholder before the request was built, so the model never saw the picture. Every provider overrides cacheScope(). Two clients differing only in maxTokens, safetySettings, baseURL or declared capabilities hashed to the same key, so one could be served a reply the other would never produce. AnthropicRefusalError becomes a subclass of ContentFilterError rather than an alias, so narrowing to Anthropic means Anthropic again while a cross-provider catch still works. Also: evaluate() delegates to the shared concurrency pool instead of carrying its own, the examples page uses the published MockLM rather than a StubLM snippet that never compiled, and .claude/ is excluded from lint and format so a local git worktree cannot break either.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-ups from merging the fifteen 0.6 feature branches. Each item is something a single unit could not fix on its own, because it needed another unit to have landed first.
Images reach
PredictVision landed complete at the
ChatMessageand provider layers, butPredictbuilt a string prompt, so a signature declaring animageinput had it flattened to[image: image/png]before the request was assembled — the model never saw the picture.PredictandChainOfThoughtnow build content parts whenever an image field is supplied, and a plain string otherwise, so text-only programs send byte-for-byte what they always did.Structured output over an image asks for the schema in the prompt, because the provider methods that constrain decoding accept only a string. Validation is unchanged; only the guarantee that the model cannot emit the wrong shape is lost. That is documented in the docs and in a callout.
Provider cache scoping
The caching unit added a
cacheScope()hook but could not touch the provider files. Until nowAnthropicLM({ maxTokens: 64 })andAnthropicLM({ maxTokens: 8192 })hashed identically, as did Gemini clients differing insafetySettingsand OpenAI clients differing inbaseURL— so one could be served a reply the other's configuration would never have produced. All four providers now override it, with a regression test.AnthropicRefusalErrorWas an alias of
ContentFilterError, which meantinstanceof AnthropicRefusalErroralso matched OpenAI and Gemini content filters. It is now a subclass: a cross-providercatchonContentFilterErrorstill works, and narrowing to Anthropic means Anthropic again.Housekeeping
evaluate()delegates to the shared pool inutils/poolinstead of carrying a second copy. Its0 → 1 laneclamp stays, since the shared pool rejects a non-positive limit outright.site/examples.htmlused aStubLMsnippet callingsuper({ model: 'stub' }), which never matchedBaseLM's(provider, model)constructor. It now uses theMockLMthat ships at@ts-dspy/core/testing..claude/is excluded from eslint and prettier. Git worktrees live there, sonpm run lintwas failing on other branches' checkouts.Verification
build,lint,typecheck,format:check,verify:packagingall clean; 718 tests pass. Docs verified in a browser: 21 sections numbered 01–21, TOC order matching exactly, all 61 code blocks highlighted, no horizontal overflow.🤖 Generated with Claude Code