You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/docs/operations/configuration.md
+35-6Lines changed: 35 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,15 +26,15 @@ under the License.
26
26
27
27
There are three ways to configure Flink Agents:
28
28
29
-
1.**Explicit Settings**
29
+
1.**Explicit Settings in Code**
30
30
2.**YAML Configuration File**
31
31
3.**Configuration During Build Agent Time**
32
32
33
33
{{< hint info >}}
34
34
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.
35
35
{{< /hint >}}
36
36
37
-
### Explicit Settings
37
+
### Explicit Settings in Code
38
38
39
39
Users can explicitly modify the configuration when defining the `AgentsExecutionEnvironment`:
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.
84
84
85
-
#### Configuration Structure
85
+
#### Format
86
86
87
87
The YAML file must follow this format, with all agent-specific settings nested under the `agent:` key:
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
0 commit comments