IRMetadata
Defined in: packages/ai.matey.types/src/ir.ts:597
Request/response metadata.
Tracks provenance, timing, warnings, and custom metadata throughout the adapter chain.
Example
Section titled “Example”const metadata: IRMetadata = { requestId: 'req_abc123', timestamp: Date.now(), provenance: { frontend: 'anthropic', backend: 'openai', middleware: ['logging', 'caching'] }, warnings: [ { category: 'parameter-normalized', severity: 'info', message: 'Temperature scaled from 0-2 to 0-1 range', field: 'temperature' } ], custom: { userId: 'user_123', sessionId: 'session_456' }};Properties
Section titled “Properties”custom?
Section titled “custom?”
readonlyoptionalcustom:Record<string,unknown>
Defined in: packages/ai.matey.types/src/ir.ts:633
Custom metadata fields. Can be used by middleware or application code.
provenance?
Section titled “provenance?”
readonlyoptionalprovenance:IRProvenance
Defined in: packages/ai.matey.types/src/ir.ts:621
Adapter chain provenance.
providerResponseId?
Section titled “providerResponseId?”
readonlyoptionalproviderResponseId:string
Defined in: packages/ai.matey.types/src/ir.ts:611
Provider’s response identifier. Set by backend adapter from the provider’s actual response ID. Examples: OpenAI’s “chatcmpl-xxx”, Anthropic’s “msg_xxx”. Useful for correlating with provider logs and billing.
requestId
Section titled “requestId”
readonlyrequestId:string
Defined in: packages/ai.matey.types/src/ir.ts:603
Unique request identifier. Generated by the client (frontend adapter or Bridge). Stable across retries and fallbacks for correlation.
timestamp
Section titled “timestamp”
readonlytimestamp:number
Defined in: packages/ai.matey.types/src/ir.ts:616
Request timestamp (milliseconds since epoch).
warnings?
Section titled “warnings?”
readonlyoptionalwarnings: readonlyIRWarning[]
Defined in: packages/ai.matey.types/src/ir.ts:627
Semantic drift warnings collected during processing. Documents any transformations or compatibility issues.