xintongsong commented on code in PR #232:
URL: https://github.com/apache/flink-agents/pull/232#discussion_r2409735256


##########
docs/content/docs/operations/configuration.md:
##########
@@ -22,8 +22,261 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-{{< hint warning >}}
-**TODO**: How to configure Flink Agents for local execution and Flink cluster 
execution.
+## How to configure Flink Agents
 
-**TODO**: List of all built-in Configuration options.
-{{< /hint >}}
\ No newline at end of file
+There are three ways to configure Flink Agents:
+
+1. **Explicit Settings in Code**
+2. **YAML Configuration File**
+3. **Configuration During Build Agent**

Review Comment:
   And we should explain the scope



##########
docs/content/docs/operations/configuration.md:
##########
@@ -22,8 +22,261 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-{{< hint warning >}}
-**TODO**: How to configure Flink Agents for local execution and Flink cluster 
execution.
+## How to configure Flink Agents
 
-**TODO**: List of all built-in Configuration options.
-{{< /hint >}}
\ No newline at end of file
+There are three ways to configure Flink Agents:
+
+1. **Explicit Settings in Code**
+2. **YAML Configuration File**
+3. **Configuration During Build Agent**
+
+{{< hint info >}}
+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.
+{{< /hint >}}
+
+### Explicit Settings in Code
+
+Users can explicitly modify the configuration when defining the 
`AgentsExecutionEnvironment`:
+
+{{< tabs>}}
+{{< tab "python" >}}
+
+```python
+# Get Flink Agents execution environment
+agents_env = AgentsExecutionEnvironment.get_execution_environment()
+
+# Get configuration object from the environment
+config = agents_env.get_configuration()
+
+# Set custom configuration using a direct key (string-based key)
+# This is suitable for user-defined or non-standardized settings.
+config.set_str("OpenAIChatModelSetup.model", "gpt-5")
+
+# Set framework-level configuration using a predefined ConfigOption class
+# This ensures type safety and better integration with the framework.
+config.set(FlinkAgentsCoreOptions.KAFKA_BOOTSTRAP_SERVERS, 
"kafka-broker.example.com:9092")
+```
+
+{{< /tab >}}
+
+{{< tab "java" >}}
+
+```java
+// Get Flink Agents execution environment
+AgentsExecutionEnvironment agentsEnv = 
AgentsExecutionEnvironment.getExecutionEnvironment(env);
+
+// Get configuration object
+Configuration config = agentsEnv.getConfig();
+
+// Set custom configuration using key (direct string key)
+config.setInt("kafkaActionStateTopicNumPartitions", 128);  // Kafka topic 
partitions count
+
+// Set framework configuration using ConfigOption (predefined option class)
+config.set(AgentConfigOptions.KAFKA_BOOTSTRAP_SERVERS, 
"kafka-broker.example.com:9092");  // Kafka cluster address
+```
+
+{{< /tab >}}
+{{< /tabs >}}
+
+### YAML Configuration File
+
+Flink Agents allows reading configurations from a YAML file.
+
+#### Format
+
+The YAML file must follow this format, with all agent-specific settings nested 
under the `agent` key:
+
+```yaml
+agent:
+  # Agent-specific configurations
+  OpenAIChatModelSetup.model: "gpt-5"
+  OpenAIChatModelConnection.max_retries: 10
+```
+
+#### Loading Behavior
+
+**Local Mode**
+
+Use the `AgentsExecutionEnvironment.get_configuration()` API to load a custom 
YAML file directly:
+
+```python
+config = agents_env.get_configuration("path/to/your/config.yaml")
+```
+
+**MiniCluster Mode / Cluster Submission**
+
+By default, Flink Agents configurations are included in the standard Flink 
configuration file (config.yaml) used for cluster submissions.
+
+- **For MiniCluster**:
+  Manual setup is **required** — always export the environment variable before 
running the job:
+
+  ```bash
+  export FLINK_CONF_DIR="path/to/your/config.yaml"
+  ```
+
+  This ensures that Flink can locate and load the configuration file 
correctly. If this environment variable is not set, no configuration files will 
be loaded, which may lead to unexpected behavior or failures.
+
+- **For Cluster Submission**:
+  The configuration is automatically loaded from 
`$FLINK_HOME/conf/flink-conf.yaml` (if the `agent:` section exists).

Review Comment:
   1. It's still not clear enough that the flink-agents config is part of the 
flink config.
   2. Let's put the cluster mode first, as we do not emphasize the local mode 
in this version.



##########
docs/content/docs/operations/configuration.md:
##########
@@ -22,8 +22,261 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-{{< hint warning >}}
-**TODO**: How to configure Flink Agents for local execution and Flink cluster 
execution.
+## How to configure Flink Agents
 
-**TODO**: List of all built-in Configuration options.
-{{< /hint >}}
\ No newline at end of file
+There are three ways to configure Flink Agents:
+
+1. **Explicit Settings in Code**
+2. **YAML Configuration File**
+3. **Configuration During Build Agent**

Review Comment:
   Both 1) and 3) are in codes. I would suggest to describe these as:
   1. Setting via the AgentsExecutionEnvironment
   2. Setting via a YAML configuration file
   3. Setting via the ResourceDescriptor



##########
docs/content/docs/operations/configuration.md:
##########
@@ -22,8 +22,261 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-{{< hint warning >}}
-**TODO**: How to configure Flink Agents for local execution and Flink cluster 
execution.
+## How to configure Flink Agents
 
-**TODO**: List of all built-in Configuration options.
-{{< /hint >}}
\ No newline at end of file
+There are three ways to configure Flink Agents:
+
+1. **Explicit Settings in Code**
+2. **YAML Configuration File**
+3. **Configuration During Build Agent**
+
+{{< hint info >}}
+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.

Review Comment:
   I think configuration during building agent time should have the highest 
priority.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to