github Effect-TS/effect @effect/ai-typesafe@4.1.0

Minor Changes

  • #8829 3f8f359 Thanks @jem-computer! - Declare decision images as input fields with Decision.Image, and add Decision.locate, which answers with a bounding box around one target in an image field.

    • DecideOptions.images is removed. Add Decision.Image fields to the input schema and refer to each image by its path in instructions:

      // Before
      DecisionModel.decide(Triage, { input: "Checkout error", images: [screenshot] })
      // After
      const Triage = Decision.make({
        input: Schema.Struct({ report: Schema.String, screenshot: Decision.Image }),
        decisions
      })
      DecisionModel.decide(Triage, { input: { report: "Checkout error", screenshot } })
    • Custom providers receive images as { reference, path, image }, with each image replaced by its reference in state and its data as a base64 string or URL.

    • Decision.locate({ image: "photo", instructions }) takes a path that Decision.make checks against the input's image fields. Providers opt in with supportsLocate: true. Decision.Any and DecisionModel.ProviderAnswer gain locate variants, so exhaustive switches over them need a Locate case.

    • TypeSafeDecisionModel supports images, sent as assets keyed by reference, and sends locate decisions as Box questions, which need jev-preview or jev-1.14.0. OpenAI and Cloudflare label each image with its reference.

  • #8829 3c42058 Thanks @effect-bot! - Remove AiError.HttpRequestDetails and Response.HttpRequestDetails, so AI errors and response metadata no longer carry request headers or query parameters. AiError.NetworkError records the request as method and url fields instead of request, and the request field is gone from AiError.HttpContext and Response.ResponseMetadataPart.

Patch Changes

Don't miss a new effect release

NewReleases is sending notifications on new releases.