run_nodes
Class info¶
🛈 DocStrings¶
Automatic agent function execution.
run_nodes
¶
run_nodes(config: JoinablePathLike | AgentsManifest, **kwargs: Any) -> dict[str, Any]
Run node functions synchronously.
Convenience wrapper around run_nodes_async for sync contexts. See run_nodes_async for full documentation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config
|
JoinablePathLike | AgentsManifest
|
Agent configuration path |
required |
**kwargs
|
Any
|
Arguments to pass to run_nodes_async |
{}
|
Returns:
Type | Description |
---|---|
dict[str, Any]
|
Dict mapping function names to their results |
Source code in src/llmling_agent/running/run_nodes.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|
run_nodes_async
async
¶
run_nodes_async(
config: JoinablePathLike | AgentsManifest,
*,
module: str | None = None,
functions: list[str] | None = None,
inputs: dict[str, Any] | None = None,
parallel: bool = False,
) -> dict[str, Any]
Execute node functions with dependency handling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config
|
JoinablePathLike | AgentsManifest
|
Node configuration (path or manifest) |
required |
module
|
str | None
|
Optional module to discover functions from |
None
|
functions
|
list[str] | None
|
Optional list of function names to run (auto-discovers if None) |
None
|
inputs
|
dict[str, Any] | None
|
Optional input values for function parameters |
None
|
parallel
|
bool
|
Whether to run independent functions in parallel |
False
|
Returns:
Type | Description |
---|---|
dict[str, Any]
|
Dict mapping function names to their results |
Example
@node_function
async def analyze(analyzer: Agent) -> str:
return await analyzer.run("...")
results = await run_nodes_async("agents.yml")
print(results["analyze"])
Source code in src/llmling_agent/running/run_nodes.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|