Skip to content
AgentsKit

@agentskit/adapters — Type Aliases

API type aliases for @agentskit/adapters.

#Type Alias: CarbonTable

CarbonTable = Record<ProviderRegionKey, number>

Defined in: adapters/src/carbon.ts:24


#Type Alias: DataRegion

DataRegion = "eu" | "us" | "apac"

Defined in: core/dist/message-DlpY7JIR.d.ts:4


#Type Alias: DeprecationAction

DeprecationAction = "warn" | "remap" | "fail"

Defined in: adapters/src/deprecation.ts:19

Provider model deprecation policy. When a provider deprecates a model, today the adapter silently 404s in production. This module lets you ship a deprecation table per provider and pick a behaviour:

  • warn — log once at startup, keep using the model.
  • remap — auto-substitute the configured successor.
  • fail — throw at startup so deploys catch it.

The deprecation table is community-updateable: the default export holds known deprecations as of the AgentsKit release; consumers can pass their own table to override or extend.

Closes issue #800.


#Type Alias: EnsembleAggregator

EnsembleAggregator = "majority-vote" | "concat" | "longest" | ((branches) => string | Promise<string>)

Defined in: adapters/src/ensemble.ts:19


#Type Alias: MockResponse

MockResponse = StreamChunk[] | ((request) => StreamChunk[])

Defined in: adapters/src/mock.ts:10


#Type Alias: ProviderRegionKey

ProviderRegionKey = `$\{string\}:$\{string\}`

Defined in: adapters/src/carbon.ts:22

Carbon-aware routing data. Estimated grid CO2 intensity (gCO2eq per 1k tokens) per provider+region. Numbers are best-effort approximations derived from public grid-mix data and provider PUE disclosures — they are good enough to differentiate "very dirty" from "very clean" but are not audited.

Sources:

  • Electricity Maps (electricitymaps.com) for grid carbon intensity.
  • Provider PUE / efficiency reports (Anthropic, Google, AWS).
  • LLMCarbon (Faiz et al., 2024) for tok→J coefficients.

Pull-requests welcome to refine. The table is community-updateable and ships at compile time; a runtime table can be passed via applyCarbonTable(candidates, customTable).

Closes part of issue #209.


#Type Alias: RecordingFixture

RecordingFixture = RecordedTurn[]

Defined in: adapters/src/mock.ts:161


#Type Alias: RouterPolicy

RouterPolicy = "cheapest" | "fastest" | "greenest" | "green-cost" | "capability-match" | ((input) => string | Promise<string>)

Defined in: adapters/src/router.ts:41

Explore nearby