InvocationContext class

Constructors

InvocationContext({BaseArtifactService? artifactService, required BaseSessionService sessionService, Object? memoryService, Object? credentialService, Object? contextCacheConfig, required String invocationId, String? branch, required BaseAgent agent, Content? userContent, required Session session, Map<String, Map<String, Object?>>? agentStates, Map<String, bool>? endOfAgents, bool endInvocation = false, LiveRequestQueue? liveRequestQueue, Map<String, ActiveStreamingTool>? activeStreamingTools, List<Object?>? transcriptionCache, String? liveSessionResumptionHandle, List<Object?>? inputRealtimeCache, List<Object?>? outputRealtimeCache, RunConfig? runConfig, ResumabilityConfig? resumabilityConfig, EventsCompactionConfig? eventsCompactionConfig, bool tokenCompactionChecked = false, PluginManager? pluginManager, List<BaseTool>? canonicalToolsCache})

Properties

activeStreamingTools Map<String, ActiveStreamingTool>?
getter/setter pair
agent BaseAgent
getter/setter pair
agentStates Map<String, Map<String, Object?>>
getter/setter pair
appName String
no setter
artifactService BaseArtifactService?
getter/setter pair
branch String?
getter/setter pair
canonicalToolsCache List<BaseTool>?
getter/setter pair
contextCacheConfig Object?
getter/setter pair
credentialService Object?
getter/setter pair
endInvocation bool
getter/setter pair
endOfAgents Map<String, bool>
getter/setter pair
eventsCompactionConfig EventsCompactionConfig?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
inputRealtimeCache List<Object?>?
getter/setter pair
invocationId String
getter/setter pair
isResumable bool
no setter
liveRequestQueue LiveRequestQueue?
getter/setter pair
liveSessionResumptionHandle String?
getter/setter pair
memoryService Object?
getter/setter pair
outputRealtimeCache List<Object?>?
getter/setter pair
pluginManager PluginManager
getter/setter pair
resumabilityConfig ResumabilityConfig?
getter/setter pair
runConfig RunConfig?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
session Session
getter/setter pair
sessionService BaseSessionService
getter/setter pair
tokenCompactionChecked bool
getter/setter pair
transcriptionCache List<Object?>?
getter/setter pair
userContent Content?
getter/setter pair
userId String
no setter

Methods

addEventsToMemory({required List<Event> events, String? sessionId, Map<String, Object?>? customMetadata}) Future<void>
addMemory({required List<MemoryEntry> memories, Map<String, Object?>? customMetadata}) Future<void>
addSessionToMemory() Future<void>
copyWith({BaseAgent? agent, String? branch, Content? userContent, String? invocationId, RunConfig? runConfig}) InvocationContext
deleteArtifact({required String filename, String? sessionId}) Future<void>
findMatchingFunctionCall(Event functionResponseEvent) Event?
getArtifactVersion({required String filename, String? sessionId, int? version}) Future<ArtifactVersion?>
getEvents({bool currentInvocation = false, bool currentBranch = false}) List<Event>
incrementLlmCallCount() → void
listArtifacts({String? sessionId}) Future<List<String>>
listArtifactVersions({required String filename, String? sessionId}) Future<List<int>>
loadArtifact({required String filename, String? sessionId, int? version}) Future<Part?>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
populateInvocationAgentStates() → void
resetSubAgentStates(String agentName) → void
saveArtifact({required String filename, required Part artifact, String? sessionId, Map<String, Object?>? customMetadata}) Future<int>
searchMemory({required String query}) Future<SearchMemoryResponse>
setAgentState(String agentName, {BaseAgentState? agentState, bool endOfAgent = false}) → void
shouldPauseInvocation(Event event) bool
toString() String
A string representation of this object.
inherited

Operators

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