7273cbe4ba
Extracted from: https://github.com/temiroff/Blacknode.git Score: 1.0
11 lines
951 B
Markdown
11 lines
951 B
Markdown
# Examples: graph-based-node-orchestration
|
|
|
|
## Usage Example
|
|
|
|
```python
|
|
# How to use this skill
|
|
# Inputs: NIM_MODEL constant (e.g., 'nim:meta/llama-3.1-8b-instruct') for the LLM model, blacknode package with Graph, Node, and cook functionality, Python script defining node types with inputs/outputs and connecting them via edges
|
|
# Process: Import required modules (blacknode as bn, NIM_MODEL) and ensure API keys are available via require_nim_api_key() → Create a bn.Graph() instance to hold all nodes and their connections → Define individual nodes with specific input/output parameters (e.g., Text node with 'value' input, LLMAgent node with model parameter, Output node with 'value' output)
|
|
# Outputs: A fully constructed graph with typed nodes and defined connections, Executed result (e.g., processed text, summary, or other output) from the final node, A reusable pattern that can be adapted to different models, hardware, or task types
|
|
```
|