Skip to content
AgentsKit

@agentskit/adapters β€” Type Aliases

API type aliases for @agentskit/adapters.

#Type Alias: CarbonTable

CarbonTable = Record<ProviderRegionKey, number>

Defined in: packages/adapters/src/carbon.ts:27

Carbon intensity values used to estimate emissions for provider regions.


#Type Alias: DataRegion

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

Defined in: packages/core/dist/message-8TsZHkTl.d.ts:6

Cloud region used to describe where a service stores or processes data.


#Type Alias: DeprecationAction

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

Defined in: packages/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: packages/adapters/src/ensemble.ts:28

Function that selects an output from ensemble branch results.


#Type Alias: MockResponse

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

Defined in: packages/adapters/src/mock.ts:13

A mock response emitted by a mock adapter.


#Type Alias: ModelProviderId

ModelProviderId = "openrouter" | "anthropic" | "openai" | "cliproxyapi"

Defined in: packages/adapters/src/provider.ts:9

Providers reachable through the single model-provider port.


#Type Alias: ProviderRegionKey

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

Defined in: packages/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: packages/adapters/src/mock.ts:173

Recorded turns used to replay adapter responses.


#Type Alias: RouterPolicy

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

Defined in: packages/adapters/src/router.ts:47

Policy used to select an adapter routing candidate.

Explore nearby