# Class GraphAI

- Defined in packages/graphai/src/graphai.ts:31

#####
Index

### Constructors

constructor

### Properties

agentFilters
agentFunctionInfoDictionary
bypassAgentIds
callbacks
config?
graphId
graphLoader?
nodes
onLogCallback
propFunctions
retryLimit?
taskManager
verbose
version

### Methods

abort
appendLog
asString
clearCallbacks
errors
getAgentFunctionInfo
initializeGraphAI
injectValue
isRunning
onExecutionComplete
pushQueue
pushQueueIfReadyAndRunning
registerCallback
resetPending
resultOf
results
resultsOf
run
setLoopLog
setPreviousResults
transactionLogs
updateLog

##
Constructors

### constructor

- new GraphAI(
  graphData: GraphData,
  agentFunctionInfoDictionary: AgentFunctionInfoDictionary,
  options?: GraphOptions,
  ): GraphAI

  #### Parameters

  - graphData: GraphData
  - agentFunctionInfoDictionary: AgentFunctionInfoDictionary
  - options: GraphOptions = ...

  #### Returns GraphAI

  - Defined in packages/graphai/src/graphai.ts:125

##
Properties

### `Readonly` agentFilters

agentFilters: AgentFilterInfo[]

- Defined in packages/graphai/src/graphai.ts:41

### `Readonly` agentFunctionInfoDictionary

agentFunctionInfoDictionary: AgentFunctionInfoDictionary

- Defined in packages/graphai/src/graphai.ts:39

### `Readonly` bypassAgentIds

bypassAgentIds: string[]

- Defined in packages/graphai/src/graphai.ts:37

### callbacks

callbacks: CallbackFunction[] = []

- Defined in packages/graphai/src/graphai.ts:48

### `Optional` `Readonly` config

config?: ConfigDataDictionary = {}

- Defined in packages/graphai/src/graphai.ts:38

### `Readonly` graphId

graphId: string

- Defined in packages/graphai/src/graphai.ts:33

### `Optional` `Readonly` graphLoader

graphLoader?: GraphDataLoader

- Defined in packages/graphai/src/graphai.ts:44

### nodes

nodes: GraphNodes

- Defined in packages/graphai/src/graphai.ts:46

### onLogCallback

onLogCallback: CallbackFunction = ...

- Defined in packages/graphai/src/graphai.ts:47

### `Readonly` propFunctions

propFunctions: PropFunction[]

- Defined in packages/graphai/src/graphai.ts:43

### `Optional` `Readonly` retryLimit

retryLimit?: number

- Defined in packages/graphai/src/graphai.ts:42

### `Readonly` taskManager

taskManager: TaskManager

- Defined in packages/graphai/src/graphai.ts:40

### verbose

verbose: boolean

- Defined in packages/graphai/src/graphai.ts:49

### `Readonly` version

version: number

- Defined in packages/graphai/src/graphai.ts:32

##
Methods

### abort

- abort(): void

  #### Returns void

  - Defined in packages/graphai/src/graphai.ts:281

### appendLog

- appendLog(log: TransactionLog): void

  #### Parameters

  - log: TransactionLog

  #### Returns void

  - Defined in packages/graphai/src/graphai.ts:359

### asString

- asString(): string

  #### Returns string

  - Defined in packages/graphai/src/graphai.ts:184

### clearCallbacks

- clearCallbacks(): void

  #### Returns void

  - Defined in packages/graphai/src/graphai.ts:374

### errors

- errors(): Record<string, Error>

  #### Returns Record<string, Error>

  - Defined in packages/graphai/src/graphai.ts:204

### getAgentFunctionInfo

- getAgentFunctionInfo(
  agentId?: string,
  ):
  | AgentFunctionInfo
  | {
  agent: () => Promise<null>;
  cacheType: undefined;
  hasGraphData: boolean;
  inputs: null;
  }

  #### Parameters

  - `Optional` agentId: string

  #### Returns
  | AgentFunctionInfo
  | {
  agent: () => Promise<null>;
  cacheType: undefined;
  hasGraphData: boolean;
  inputs: null;
  }

  - Defined in packages/graphai/src/graphai.ts:166

### initializeGraphAI

- initializeGraphAI(): void

  #### Returns void

  - Defined in packages/graphai/src/graphai.ts:344

### injectValue

- injectValue(nodeId: string, value: ResultData, injectFrom?: string): void

  #### Parameters

  - nodeId: string
  - value: ResultData
  - `Optional` injectFrom: string

  #### Returns void

  - Defined in packages/graphai/src/graphai.ts:384

### isRunning

- isRunning(): boolean

  #### Returns boolean

  - Defined in packages/graphai/src/graphai.ts:300

### onExecutionComplete

- onExecutionComplete(node: ComputedNode): void

  #### Parameters

  - node: ComputedNode

  #### Returns void

  - Defined in packages/graphai/src/graphai.ts:305

### pushQueue

- pushQueue(node: ComputedNode): void

  #### Parameters

  - node: ComputedNode

  #### Returns void

  - Defined in packages/graphai/src/graphai.ts:239

### pushQueueIfReadyAndRunning

- pushQueueIfReadyAndRunning(node: ComputedNode): void

  #### Parameters

  - node: ComputedNode

  #### Returns void

  - Defined in packages/graphai/src/graphai.ts:232

### registerCallback

- registerCallback(callback: CallbackFunction): void

  #### Parameters

  - callback: CallbackFunction

  #### Returns void

  - Defined in packages/graphai/src/graphai.ts:370

### resetPending

- resetPending(): void

  #### Returns void

  - Defined in packages/graphai/src/graphai.ts:291

### resultOf

- resultOf(source: DataSource): ResultData

  #### Parameters

  - source: DataSource

  #### Returns ResultData

  - Defined in packages/graphai/src/graphai.ts:400

### results

- results<T = DefaultResultData>(all: boolean): ResultDataDictionary<T>

  #### Type Parameters

  - T = DefaultResultData

  #### Parameters

  - all: boolean

  #### Returns ResultDataDictionary<T>

  - Defined in packages/graphai/src/graphai.ts:191

### resultsOf

- resultsOf(
  inputs?: Record<string, any>,
  anyInput?: boolean,
  ): Record<string, ResultData>

  #### Parameters

  - `Optional` inputs: Record<string, any>
  - anyInput: boolean = false

  #### Returns Record<string, ResultData>

  - Defined in packages/graphai/src/graphai.ts:393

### run

- run<T = DefaultResultData>(all?: boolean): Promise<ResultDataDictionary<T>>

  #### Type Parameters

  - T = DefaultResultData

  #### Parameters

  - all: boolean = false

  #### Returns Promise<ResultDataDictionary<T>>

  - Defined in packages/graphai/src/graphai.ts:249

### setLoopLog

- setLoopLog(log: TransactionLog): void

  #### Parameters

  - log: TransactionLog

  #### Returns void

  - Defined in packages/graphai/src/graphai.ts:354

### setPreviousResults

- setPreviousResults(
  previousResults: ResultDataDictionary<DefaultResultData>,
  ): void

  #### Parameters

  - previousResults: ResultDataDictionary<DefaultResultData>

  #### Returns void

  - Defined in packages/graphai/src/graphai.ts:351

### transactionLogs

- transactionLogs(): TransactionLog[]

  #### Returns TransactionLog[]

  - Defined in packages/graphai/src/graphai.ts:379

### updateLog

- updateLog(log: TransactionLog): void

  #### Parameters

  - log: TransactionLog

  #### Returns void

  - Defined in packages/graphai/src/graphai.ts:365