FakeAgent class final

One agent next to its FakePerson of kind agent (same ID, handle and display name).

The configured values (billingMode, credentialHolderId) change through the handlers of rest/agent_handlers.dart; the reported values change through FakeWorld.agentHeartbeat, the fake's stand-in for the heartbeat of 09 4.8. FakeWorld.agentJson builds the API Agent from both.

Example:

final agent = world.addAgent(handle: 'support', displayName: 'Support');
world.agentHeartbeat(agent.id, reportedBillingMode: 'personal');
world.agentWarnings(agent); // ['billing_mode_mismatch']

Constructors

FakeAgent({required String id, String billingMode = 'organization', String? credentialHolderId, String? reportedBillingMode, List<String>? billingModesSupported, String keyType = 'api_key', String? evidenceMethod = 'resolved_credentials', String state = 'online', String adapterKind = 'hermes', String toolClass = 'chat', String description = ''})
Creates the agent of the principal id; every other value has the default of a fresh agent on the organization key with a runtime that is online.

Properties

adapterKind ↔ String
The adapter kind, for example hermes.
getter/setter pair
billingMode ↔ String
The configured backend policy (10 8 "Soll"): organization or personal.
getter/setter pair
billingModeChangedAt ↔ String?
When the backend policy last changed, or null before the first change.
getter/setter pair
billingModesSupported ↔ List<String>?
The modes the adapter can prove (billing_modes_supported); null when not reported.
getter/setter pair
credentialHolderId ↔ String?
The person whose subscription a personal agent uses; null with organization.
getter/setter pair
description ↔ String
The description of the agent card.
getter/setter pair
evidenceMethod ↔ String?
billing_evidence.method, or null to omit it.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
id → String
The principal ID (the ID of the FakePerson of kind agent).
final
keyType ↔ String
billing_evidence.key_type: api_key, oauth, cloud, none or unknown.
getter/setter pair
lastHeartbeatAt ↔ String?
When the last heartbeat arrived, or null before the first one.
getter/setter pair
mismatchAtHeartbeat ↔ bool
Whether the last heartbeat saw the reported mode differ from the configured one; the server warns billing_mode_mismatch only for a mismatch that lasted longer than billing.mismatch_alert_after (10 8), which the fake counts as one heartbeat. A change of the configured mode clears it.
getter/setter pair
reportedBillingMode ↔ String?
The mode the runtime reports (10 8 "Ist"); null for an adapter that follows the configured mode per run, so the API omits it.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
state ↔ String
The runtime state of the heartbeat: online, degraded, offline or unknown.
getter/setter pair
tokens → Map<String, Map<String, Object?>>
The API tokens of the agent (ApiToken JSON) by token ID, oldest first; a revoked token keeps its row with revoked_at.
final
toolClass ↔ String
The configured tool class: chat, scoped or host.
getter/setter pair
version ↔ int
The version of the agent row; every change of the configured values raises it, and If-Match compares against it.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited