Skip to content

Commit 7a1ddcd

Browse files
committed
address comments
1 parent 99bf850 commit 7a1ddcd

File tree

1 file changed

+35
-6
lines changed

1 file changed

+35
-6
lines changed

docs/content/docs/operations/configuration.md

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ under the License.
2626

2727
There are three ways to configure Flink Agents:
2828

29-
1. **Explicit Settings**
29+
1. **Explicit Settings in Code**
3030
2. **YAML Configuration File**
3131
3. **Configuration During Build Agent Time**
3232

3333
{{< hint info >}}
3434
The priority of configuration sources, from highest to lowest, is: **Explicit Settings**, followed by **YAML Configuration File**, and finally **Configuration During Build Agent Time**. In case of duplicate keys, the value from the highest-priority source will override those from lower-priority ones.
3535
{{< /hint >}}
3636

37-
### Explicit Settings
37+
### Explicit Settings in Code
3838

3939
Users can explicitly modify the configuration when defining the `AgentsExecutionEnvironment`:
4040

@@ -80,9 +80,9 @@ config.set(AgentConfigOptions.KAFKA_BOOTSTRAP_SERVERS, "kafka-broker.example.com
8080

8181
### YAML Configuration File
8282

83-
Flink Agents reads configuration from a YAML file structured under the **`agent:`** root key. This file is typically used when submitting jobs to a Flink cluster or running locally with a custom configuration.
83+
Flink Agents allows reading configurations from a YAML file.
8484

85-
#### Configuration Structure
85+
#### Format
8686

8787
The YAML file must follow this format, with all agent-specific settings nested under the `agent:` key:
8888

@@ -111,7 +111,7 @@ config = agents_env.get_configuration("path/to/your/config.yaml")
111111

112112
**MiniCluster Mode / Cluster Submission**
113113

114-
Flink Agents automatically loads configurations from `$FLINK_CONF_DIR/conf.yaml`, ensuring the file includes the `agent:` section.
114+
By default, Flink Agents configurations are included in the standard Flink configuration file (config.yaml) used for cluster submissions.
115115

116116
- **For MiniCluster**:
117117
Manual setup is **required** — always export the environment variable before running the job:
@@ -127,7 +127,36 @@ Flink Agents automatically loads configurations from `$FLINK_CONF_DIR/conf.yaml`
127127

128128
### Configuration During Build Agent Time
129129

130-
How to configure during the build agent time: please refer to the documentation under "How to Build an Agents," specifically the document titled ["Workflow Agent"]({{< ref "docs/development/workflow_agent" >}}).
130+
For resources like `ChatModel`, `EmbeddingModel`, and `VectorStore`, Flink Agents allows configuration **during agent definition** via `ResourceDescriptor`. This enables declarative setup of model parameters directly in the agent class.
131+
132+
#### Example: Defining a Math-Focused Chat Model
133+
134+
``````python
135+
class MyAgent(Agent):
136+
"""Example agent demonstrating the new ChatModel architecture."""
137+
138+
@chat_model_connection
139+
@staticmethod
140+
def ollama_connection() -> ResourceDescriptor:
141+
"""Defines the connection to the Ollama model service."""
142+
return ResourceDescriptor(
143+
clazz=OllamaChatModelConnection # Connection class
144+
)
145+
146+
@chat_model_setup
147+
@staticmethod
148+
def math_chat_model() -> ResourceDescriptor:
149+
"""Configures a math-focused chat model using the Ollama connection."""
150+
return ResourceDescriptor(
151+
clazz=OllamaChatModelSetup, # Model setup class
152+
connection="ollama_connection", # Reference to the connection method
153+
model=OLLAMA_MODEL, # Specific model name
154+
tools=["add"], # Add tools
155+
extract_reasoning=True # Enable reasoning extraction
156+
)
157+
``````
158+
159+
131160

132161
## Built-in configuration options
133162

0 commit comments

Comments
 (0)