This is an automated email from the ASF dual-hosted git repository.
wenjin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-agents.git
The following commit(s) were added to refs/heads/main by this push:
new 541913d0 [Doc] Docs update for OpenAI responses API (#582)
541913d0 is described below
commit 541913d02bfd4b105ea8a45fd5e6657c9b23f8e5
Author: Adesh Nalpet Adimurthy <[email protected]>
AuthorDate: Mon Apr 13 07:16:25 2026 -0400
[Doc] Docs update for OpenAI responses API (#582)
* Update completions API naming and add responses API docs
* Remove repeated set-up instructions
* Add two sections in OpenAI
---
docs/content/docs/development/chat_models.md | 97 ++++++++++++++++++++++++++--
1 file changed, 91 insertions(+), 6 deletions(-)
diff --git a/docs/content/docs/development/chat_models.md
b/docs/content/docs/development/chat_models.md
index 82ea82f8..cf65b057 100644
--- a/docs/content/docs/development/chat_models.md
+++ b/docs/content/docs/development/chat_models.md
@@ -648,9 +648,11 @@ OpenAI provides cloud-based chat models with
state-of-the-art performance for a
1. Create an account at [OpenAI Platform](https://platform.openai.com/)
2. Navigate to [API Keys](https://platform.openai.com/api-keys) and create a
new secret key
-#### OpenAIChatModelConnection Parameters
+#### Completions API
-{{< tabs "OpenAIChatModelConnection Parameters" >}}
+##### OpenAICompletionsConnection Parameters
+
+{{< tabs "OpenAICompletionsConnection Parameters" >}}
{{< tab "Python" >}}
@@ -680,9 +682,9 @@ OpenAI provides cloud-based chat models with
state-of-the-art performance for a
{{< /tabs >}}
-#### OpenAIChatModelSetup Parameters
+##### OpenAICompletionsSetup Parameters
-{{< tabs "OpenAIChatModelSetup Parameters" >}}
+{{< tabs "OpenAICompletionsSetup Parameters" >}}
{{< tab "Python" >}}
@@ -722,9 +724,9 @@ OpenAI provides cloud-based chat models with
state-of-the-art performance for a
{{< /tabs >}}
-#### Usage Example
+##### Usage Example
-{{< tabs "OpenAI Usage Example" >}}
+{{< tabs "OpenAI Chat Completions Usage Example" >}}
{{< tab "Python" >}}
```python
@@ -786,6 +788,89 @@ public class MyAgent extends Agent {
{{< /tabs >}}
+#### Responses API
+
+{{< hint info >}}
+Responses API is only supported in Java currently. To use OpenAI Responses API
from Python agents, see [Using Cross-Language
Providers](#using-cross-language-providers).
+{{< /hint >}}
+
+##### OpenAIResponsesModelConnection Parameters
+
+{{< tabs "OpenAIResponsesModelConnection Parameters" >}}
+
+{{< tab "Java" >}}
+
+| Parameter | Type | Default | Description |
+|-----------|------|---------|-------------|
+| `api_key` | String | Required | OpenAI API key for authentication |
+| `api_base_url` | String | None | Base URL for OpenAI API (useful for
proxies) |
+| `max_retries` | int | `2` | Maximum number of API retry attempts |
+| `timeout` | int | None | Timeout in seconds for API requests |
+| `default_headers` | Map<String, String> | None | Default headers for API
requests |
+| `model` | String | None | Default model to use if not specified in setup |
+
+{{< /tab >}}
+
+{{< /tabs >}}
+
+##### OpenAIResponsesModelSetup Parameters
+
+{{< tabs "OpenAIResponsesModelSetup Parameters" >}}
+
+{{< tab "Java" >}}
+
+| Parameter | Type | Default | Description |
+|-----------|------|---------|-------------|
+| `connection` | String | Required | Reference to connection method name |
+| `model` | String | `"gpt-4o"` | Name of the chat model to use |
+| `prompt` | Prompt \| String | None | Prompt template or reference to prompt
resource |
+| `tools` | List<String> | None | List of tool names available to the model |
+| `temperature` | double | `0.1` | Sampling temperature (0.0 to 2.0) |
+| `max_tokens` | int | None | Maximum number of tokens to generate |
+| `strict` | boolean | `false` | Enable strict mode for tool calling schemas |
+| `reasoning_effort` | String | None | Reasoning effort level for reasoning
models ("low", "medium", "high") |
+| `store` | boolean | `false` | Whether to store the response for later
retrieval |
+| `instructions` | String | None | System-level instructions for the model |
+| `additional_kwargs` | Map<String, Object> | `{}` | Additional Responses API
parameters |
+
+{{< /tab >}}
+
+{{< /tabs >}}
+
+##### Usage Example
+
+{{< tabs "OpenAI Responses API Usage Example" >}}
+
+{{< tab "Java" >}}
+```java
+public class MyAgent extends Agent {
+ @ChatModelConnection
+ public static ResourceDescriptor openaiResponsesConnection() {
+ return
ResourceDescriptor.Builder.newBuilder(ResourceName.ChatModel.OPENAI_RESPONSES_CONNECTION)
+ .addInitialArgument("api_key", "<your-api-key>")
+ .addInitialArgument("timeout", 120)
+ .addInitialArgument("max_retries", 3)
+ .build();
+ }
+
+ @ChatModelSetup
+ public static ResourceDescriptor openaiResponsesChatModel() {
+ return
ResourceDescriptor.Builder.newBuilder(ResourceName.ChatModel.OPENAI_RESPONSES_SETUP)
+ .addInitialArgument("connection", "openaiResponsesConnection")
+ .addInitialArgument("model", "gpt-4o")
+ .addInitialArgument("temperature", 0.3d)
+ .addInitialArgument("max_tokens", 2048)
+ .addInitialArgument("store", true)
+ .build();
+ }
+
+ ...
+}
+```
+{{< /tab >}}
+
+{{< /tabs >}}
+
#### Available Models
Visit the [OpenAI Models
documentation](https://platform.openai.com/docs/models) for the complete and
up-to-date list of available chat models.