effect-io-ai

Package: @effect/ai
Module: LanguageModel

LanguageModel.ExtractContext

Utility type that extracts the context requirements from LanguageModel options.

Automatically infers the required services based on the toolkit configuration.

Signature

type ExtractContext<Options> = Options extends {
  readonly toolkit: Toolkit.WithHandler<infer _Tools>
} ? Tool.Requirements<_Tools[keyof _Tools]>
  : Options extends {
    readonly toolkit: Effect.Effect<Toolkit.WithHandler<infer _Tools>, infer _E, infer _R>
  } ? Tool.Requirements<_Tools[keyof _Tools]> | _R
  : never

Source

Since v1.0.0