This is an automated email from the ASF dual-hosted git repository.
sxnan 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 5a55f1af [doc] Rename OpenAI (Azure) to Azure OpenAI (#506)
5a55f1af is described below
commit 5a55f1afbf19d0d73abd2375d17278d674f49bab
Author: Xuannan <[email protected]>
AuthorDate: Thu Jan 29 17:25:46 2026 +0800
[doc] Rename OpenAI (Azure) to Azure OpenAI (#506)
---
docs/content/docs/development/chat_models.md | 384 +++++++++++++--------------
docs/content/docs/faq/faq.md | 8 +-
2 files changed, 196 insertions(+), 196 deletions(-)
diff --git a/docs/content/docs/development/chat_models.md
b/docs/content/docs/development/chat_models.md
index 69b60b83..bfe72338 100644
--- a/docs/content/docs/development/chat_models.md
+++ b/docs/content/docs/development/chat_models.md
@@ -142,6 +142,153 @@ public class MyAgent extends Agent {
## Built-in Providers
+### Anthropic
+
+Anthropic provides cloud-based chat models featuring the Claude family, known
for their strong reasoning, coding, and safety capabilities.
+
+#### Prerequisites
+
+1. Create an account at [Anthropic Console](https://console.anthropic.com/)
+2. Navigate to [API Keys](https://console.anthropic.com/settings/keys) and
create a new secret key
+
+#### AnthropicChatModelConnection Parameters
+
+{{< tabs "AnthropicChatModelConnection Parameters" >}}
+
+{{< tab "Python" >}}
+
+| Parameter | Type | Default | Description |
+|-----------|------|---------|-------------|
+| `api_key` | str | Required | Anthropic API key for authentication |
+| `max_retries` | int | `3` | Maximum number of API retry attempts |
+| `timeout` | float | `60.0` | API request timeout in seconds |
+
+{{< /tab >}}
+
+{{< tab "Java" >}}
+
+| Parameter | Type | Default | Description |
+|-----------|------|---------|-------------|
+| `api_key` | String | Required | Anthropic API key for authentication |
+| `timeout` | int | None | Timeout in seconds for API requests |
+| `max_retries` | int | `2` | Maximum number of API retry attempts |
+
+{{< /tab >}}
+
+{{< /tabs >}}
+
+#### AnthropicChatModelSetup Parameters
+
+{{< tabs "AnthropicChatModelSetup Parameters" >}}
+
+{{< tab "Python" >}}
+
+| Parameter | Type | Default | Description |
+|-----------|------|---------|-------------|
+| `connection` | str | Required | Reference to connection method name |
+| `model` | str | `"claude-sonnet-4-20250514"` | Name of the chat model to use
|
+| `prompt` | Prompt \| str | None | Prompt template or reference to prompt
resource |
+| `tools` | List[str] | None | List of tool names available to the model |
+| `max_tokens` | int | `1024` | Maximum number of tokens to generate |
+| `temperature` | float | `0.1` | Sampling temperature (0.0 to 1.0) |
+| `additional_kwargs` | dict | `{}` | Additional Anthropic API parameters |
+
+{{< /tab >}}
+
+{{< tab "Java" >}}
+
+| Parameter | Type | Default | Description |
+|-----------|------|---------|-------------|
+| `connection` | String | Required | Reference to connection method name |
+| `model` | String | `"claude-sonnet-4-20250514"` | 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 |
+| `max_tokens` | long | `1024` | Maximum number of tokens to generate |
+| `temperature` | double | `0.1` | Sampling temperature (0.0 to 1.0) |
+| `json_prefill` | boolean | `true` | Prefill assistant response with "{" to
enforce JSON output (disabled when tools are used) |
+| `strict_tools` | boolean | `false` | Enable strict mode for tool calling
schemas |
+| `additional_kwargs` | Map<String, Object> | `{}` | Additional Anthropic API
parameters (top_k, top_p, stop_sequences) |
+
+{{< /tab >}}
+
+{{< /tabs >}}
+
+#### Usage Example
+
+{{< tabs "Anthropic Usage Example" >}}
+
+{{< tab "Python" >}}
+```python
+class MyAgent(Agent):
+
+ @chat_model_connection
+ @staticmethod
+ def anthropic_connection() -> ResourceDescriptor:
+ return ResourceDescriptor(
+ clazz=ResourceName.ChatModel.ANTHROPIC_CONNECTION,
+ api_key="<your-api-key>",
+ max_retries=3,
+ timeout=60.0
+ )
+
+ @chat_model_setup
+ @staticmethod
+ def anthropic_chat_model() -> ResourceDescriptor:
+ return ResourceDescriptor(
+ clazz=ResourceName.ChatModel.ANTHROPIC_SETUP,
+ connection="anthropic_connection",
+ model="claude-sonnet-4-20250514",
+ max_tokens=2048,
+ temperature=0.7
+ )
+
+ ...
+```
+{{< /tab >}}
+
+{{< tab "Java" >}}
+```java
+public class MyAgent extends Agent {
+ @ChatModelConnection
+ public static ResourceDescriptor anthropicConnection() {
+ return
ResourceDescriptor.Builder.newBuilder(ResourceName.ChatModel.ANTHROPIC_CONNECTION)
+ .addInitialArgument("api_key", "<your-api-key>")
+ .addInitialArgument("timeout", 120)
+ .addInitialArgument("max_retries", 3)
+ .build();
+ }
+
+ @ChatModelSetup
+ public static ResourceDescriptor anthropicChatModel() {
+ return
ResourceDescriptor.Builder.newBuilder(ResourceName.ChatModel.ANTHROPIC_SETUP)
+ .addInitialArgument("connection", "anthropicConnection")
+ .addInitialArgument("model", "claude-sonnet-4-20250514")
+ .addInitialArgument("temperature", 0.7d)
+ .addInitialArgument("max_tokens", 2048)
+ .build();
+ }
+
+ ...
+}
+```
+{{< /tab >}}
+
+{{< /tabs >}}
+
+#### Available Models
+
+Visit the [Anthropic Models
documentation](https://docs.anthropic.com/en/docs/about-claude/models) for the
complete and up-to-date list of available chat models.
+
+Some popular options include:
+- **Claude Sonnet 4.5** (claude-sonnet-4-5-20250929)
+- **Claude Sonnet 4** (claude-sonnet-4-20250514)
+- **Claude Sonnet 3.7** (claude-3-7-sonnet-20250219)
+- **Claude Opus 4.1** (claude-opus-4-1-20250805)
+
+{{< hint warning >}}
+Model availability and specifications may change. Always check the official
Anthropic documentation for the latest information before implementing in
production.
+{{< /hint >}}
+
### Azure AI
Azure AI provides cloud-based chat models through Azure AI Inference API,
supporting various models including Llama, Mistral, Phi, and other models
deployed via Azure AI Studio.
@@ -151,7 +298,7 @@ Azure AI is only supported in Java currently. To use Azure
AI from Python agents
{{< /hint >}}
{{< hint warning >}}
-**Azure AI vs OpenAI (Azure):** Azure AI uses the Azure AI Inference API to
access models deployed via Azure AI Studio (Llama, Mistral, Phi, etc.). If you
want to use OpenAI models (GPT-4, etc.) hosted on Azure, see [OpenAI
(Azure)](#openai-azure) instead.
+**Azure AI vs Azure OpenAI:** Azure AI uses the Azure AI Inference API to
access models deployed via Azure AI Studio (Llama, Mistral, Phi, etc.). If you
want to use OpenAI models (GPT-4, etc.) hosted on Azure, see [Azure
OpenAI](#azure-openai) instead.
{{< /hint >}}
#### Prerequisites
@@ -235,72 +382,59 @@ Some popular options include:
Model availability and specifications may change. Always check the official
Azure AI documentation for the latest information before implementing in
production.
{{< /hint >}}
-### Anthropic
+### Azure OpenAI
-Anthropic provides cloud-based chat models featuring the Claude family, known
for their strong reasoning, coding, and safety capabilities.
+Azure OpenAI provides access to OpenAI models (GPT-4, GPT-4o, etc.) through
Azure's cloud infrastructure, using the same OpenAI SDK with Azure-specific
authentication and endpoints. This offers enterprise security, compliance, and
regional availability while using familiar OpenAI APIs.
+
+{{< hint info >}}
+Azure OpenAI is only supported in Python currently. To use Azure OpenAI from
Java agents, see [Using Cross-Language
Providers](#using-cross-language-providers).
+{{< /hint >}}
+
+{{< hint warning >}}
+**Azure OpenAI vs Azure AI:** Azure OpenAI uses the OpenAI SDK to access
OpenAI models (GPT-4, etc.) hosted on Azure. If you want to use other models
like Llama, Mistral, or Phi deployed via Azure AI Studio, see [Azure
AI](#azure-ai) instead.
+{{< /hint >}}
#### Prerequisites
-1. Create an account at [Anthropic Console](https://console.anthropic.com/)
-2. Navigate to [API Keys](https://console.anthropic.com/settings/keys) and
create a new secret key
+1. Create an Azure OpenAI resource in the [Azure
Portal](https://portal.azure.com/)
+2. Deploy a model in [Azure OpenAI Studio](https://oai.azure.com/)
+3. Obtain your endpoint URL, API key, API version, and deployment name from
the Azure portal
-#### AnthropicChatModelConnection Parameters
+#### AzureOpenAIChatModelConnection Parameters
-{{< tabs "AnthropicChatModelConnection Parameters" >}}
+{{< tabs "AzureOpenAIChatModelConnection Parameters" >}}
{{< tab "Python" >}}
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
-| `api_key` | str | Required | Anthropic API key for authentication |
-| `max_retries` | int | `3` | Maximum number of API retry attempts |
+| `api_key` | str | Required | Azure OpenAI API key for authentication |
+| `api_version` | str | Required | Azure OpenAI REST API version (e.g.,
"2024-02-15-preview"). See [API
versions](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#rest-api-versioning)
|
+| `azure_endpoint` | str | Required | Azure OpenAI endpoint URL (e.g.,
`https://{resource-name}.openai.azure.com`) |
| `timeout` | float | `60.0` | API request timeout in seconds |
-
-{{< /tab >}}
-
-{{< tab "Java" >}}
-
-| Parameter | Type | Default | Description |
-|-----------|------|---------|-------------|
-| `api_key` | String | Required | Anthropic API key for authentication |
-| `timeout` | int | None | Timeout in seconds for API requests |
-| `max_retries` | int | `2` | Maximum number of API retry attempts |
+| `max_retries` | int | `3` | Maximum number of API retry attempts |
{{< /tab >}}
{{< /tabs >}}
-#### AnthropicChatModelSetup Parameters
+#### AzureOpenAIChatModelSetup Parameters
-{{< tabs "AnthropicChatModelSetup Parameters" >}}
+{{< tabs "AzureOpenAIChatModelSetup Parameters" >}}
{{< tab "Python" >}}
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `connection` | str | Required | Reference to connection method name |
-| `model` | str | `"claude-sonnet-4-20250514"` | Name of the chat model to use
|
+| `model` | str | Required | Name of OpenAI model deployment on Azure |
+| `model_of_azure_deployment` | str | None | The underlying model name (e.g.,
'gpt-4', 'gpt-35-turbo'). Used for token metrics tracking |
| `prompt` | Prompt \| str | None | Prompt template or reference to prompt
resource |
| `tools` | List[str] | None | List of tool names available to the model |
-| `max_tokens` | int | `1024` | Maximum number of tokens to generate |
-| `temperature` | float | `0.1` | Sampling temperature (0.0 to 1.0) |
-| `additional_kwargs` | dict | `{}` | Additional Anthropic API parameters |
-
-{{< /tab >}}
-
-{{< tab "Java" >}}
-
-| Parameter | Type | Default | Description |
-|-----------|------|---------|-------------|
-| `connection` | String | Required | Reference to connection method name |
-| `model` | String | `"claude-sonnet-4-20250514"` | 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 |
-| `max_tokens` | long | `1024` | Maximum number of tokens to generate |
-| `temperature` | double | `0.1` | Sampling temperature (0.0 to 1.0) |
-| `json_prefill` | boolean | `true` | Prefill assistant response with "{" to
enforce JSON output (disabled when tools are used) |
-| `strict_tools` | boolean | `false` | Enable strict mode for tool calling
schemas |
-| `additional_kwargs` | Map<String, Object> | `{}` | Additional Anthropic API
parameters (top_k, top_p, stop_sequences) |
+| `temperature` | float | None | Sampling temperature (0.0 to 2.0). Not
supported by reasoning models |
+| `max_tokens` | int | None | Maximum number of tokens to generate |
+| `logprobs` | bool | `False` | Whether to return log probabilities of output
tokens |
+| `additional_kwargs` | dict | `{}` | Additional Azure OpenAI API parameters |
{{< /tab >}}
@@ -308,7 +442,7 @@ Anthropic provides cloud-based chat models featuring the
Claude family, known fo
#### Usage Example
-{{< tabs "Anthropic Usage Example" >}}
+{{< tabs "Azure OpenAI Usage Example" >}}
{{< tab "Python" >}}
```python
@@ -316,70 +450,43 @@ class MyAgent(Agent):
@chat_model_connection
@staticmethod
- def anthropic_connection() -> ResourceDescriptor:
+ def azure_openai_connection() -> ResourceDescriptor:
return ResourceDescriptor(
- clazz=ResourceName.ChatModel.ANTHROPIC_CONNECTION,
+ clazz=ResourceName.ChatModel.AZURE_OPENAI_CONNECTION,
api_key="<your-api-key>",
- max_retries=3,
- timeout=60.0
+ api_version="2024-02-15-preview",
+ azure_endpoint="https://your-resource.openai.azure.com"
)
@chat_model_setup
@staticmethod
- def anthropic_chat_model() -> ResourceDescriptor:
+ def azure_openai_chat_model() -> ResourceDescriptor:
return ResourceDescriptor(
- clazz=ResourceName.ChatModel.ANTHROPIC_SETUP,
- connection="anthropic_connection",
- model="claude-sonnet-4-20250514",
- max_tokens=2048,
- temperature=0.7
+ clazz=ResourceName.ChatModel.AZURE_OPENAI_SETUP,
+ connection="azure_openai_connection",
+ model="my-gpt4-deployment", # Your Azure deployment name
+ model_of_azure_deployment="gpt-4", # Underlying model for metrics
+ max_tokens=1000
)
...
```
{{< /tab >}}
-{{< tab "Java" >}}
-```java
-public class MyAgent extends Agent {
- @ChatModelConnection
- public static ResourceDescriptor anthropicConnection() {
- return
ResourceDescriptor.Builder.newBuilder(ResourceName.ChatModel.ANTHROPIC_CONNECTION)
- .addInitialArgument("api_key", "<your-api-key>")
- .addInitialArgument("timeout", 120)
- .addInitialArgument("max_retries", 3)
- .build();
- }
-
- @ChatModelSetup
- public static ResourceDescriptor anthropicChatModel() {
- return
ResourceDescriptor.Builder.newBuilder(ResourceName.ChatModel.ANTHROPIC_SETUP)
- .addInitialArgument("connection", "anthropicConnection")
- .addInitialArgument("model", "claude-sonnet-4-20250514")
- .addInitialArgument("temperature", 0.7d)
- .addInitialArgument("max_tokens", 2048)
- .build();
- }
-
- ...
-}
-```
-{{< /tab >}}
-
{{< /tabs >}}
#### Available Models
-Visit the [Anthropic Models
documentation](https://docs.anthropic.com/en/docs/about-claude/models) for the
complete and up-to-date list of available chat models.
+Azure OpenAI supports OpenAI models deployed through your Azure subscription.
Visit the [Azure OpenAI Models
documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models)
for the complete and up-to-date list of available models.
Some popular options include:
-- **Claude Sonnet 4.5** (claude-sonnet-4-5-20250929)
-- **Claude Sonnet 4** (claude-sonnet-4-20250514)
-- **Claude Sonnet 3.7** (claude-3-7-sonnet-20250219)
-- **Claude Opus 4.1** (claude-opus-4-1-20250805)
+- **GPT-4o** (gpt-4o)
+- **GPT-4** (gpt-4)
+- **GPT-4 Turbo** (gpt-4-turbo)
+- **GPT-3.5 Turbo** (gpt-35-turbo)
{{< hint warning >}}
-Model availability and specifications may change. Always check the official
Anthropic documentation for the latest information before implementing in
production.
+Model availability depends on your Azure region and subscription. Always check
the official Azure OpenAI documentation for regional availability before
implementing in production.
{{< /hint >}}
### Ollama
@@ -688,113 +795,6 @@ Some popular options include:
Model availability and specifications may change. Always check the official
OpenAI documentation for the latest information before implementing in
production.
{{< /hint >}}
-### OpenAI (Azure)
-
-OpenAI (Azure) provides access to OpenAI models (GPT-4, GPT-4o, etc.) through
Azure's cloud infrastructure, using the same OpenAI SDK with Azure-specific
authentication and endpoints. This offers enterprise security, compliance, and
regional availability while using familiar OpenAI APIs.
-
-{{< hint info >}}
-OpenAI (Azure) is only supported in Python currently. To use OpenAI (Azure)
from Java agents, see [Using Cross-Language
Providers](#using-cross-language-providers).
-{{< /hint >}}
-
-{{< hint warning >}}
-**OpenAI (Azure) vs Azure AI:** OpenAI (Azure) uses the OpenAI SDK to access
OpenAI models (GPT-4, etc.) hosted on Azure. If you want to use other models
like Llama, Mistral, or Phi deployed via Azure AI Studio, see [Azure
AI](#azure-ai) instead.
-{{< /hint >}}
-
-#### Prerequisites
-
-1. Create an Azure OpenAI resource in the [Azure
Portal](https://portal.azure.com/)
-2. Deploy a model in [Azure OpenAI Studio](https://oai.azure.com/)
-3. Obtain your endpoint URL, API key, API version, and deployment name from
the Azure portal
-
-#### AzureOpenAIChatModelConnection Parameters
-
-{{< tabs "AzureOpenAIChatModelConnection Parameters" >}}
-
-{{< tab "Python" >}}
-
-| Parameter | Type | Default | Description |
-|-----------|------|---------|-------------|
-| `api_key` | str | Required | Azure OpenAI API key for authentication |
-| `api_version` | str | Required | Azure OpenAI REST API version (e.g.,
"2024-02-15-preview"). See [API
versions](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#rest-api-versioning)
|
-| `azure_endpoint` | str | Required | Azure OpenAI endpoint URL (e.g.,
`https://{resource-name}.openai.azure.com`) |
-| `timeout` | float | `60.0` | API request timeout in seconds |
-| `max_retries` | int | `3` | Maximum number of API retry attempts |
-
-{{< /tab >}}
-
-{{< /tabs >}}
-
-#### AzureOpenAIChatModelSetup Parameters
-
-{{< tabs "AzureOpenAIChatModelSetup Parameters" >}}
-
-{{< tab "Python" >}}
-
-| Parameter | Type | Default | Description |
-|-----------|------|---------|-------------|
-| `connection` | str | Required | Reference to connection method name |
-| `model` | str | Required | Name of OpenAI model deployment on Azure |
-| `model_of_azure_deployment` | str | None | The underlying model name (e.g.,
'gpt-4', 'gpt-35-turbo'). Used for token metrics tracking |
-| `prompt` | Prompt \| str | None | Prompt template or reference to prompt
resource |
-| `tools` | List[str] | None | List of tool names available to the model |
-| `temperature` | float | None | Sampling temperature (0.0 to 2.0). Not
supported by reasoning models |
-| `max_tokens` | int | None | Maximum number of tokens to generate |
-| `logprobs` | bool | `False` | Whether to return log probabilities of output
tokens |
-| `additional_kwargs` | dict | `{}` | Additional Azure OpenAI API parameters |
-
-{{< /tab >}}
-
-{{< /tabs >}}
-
-#### Usage Example
-
-{{< tabs "OpenAI (Azure) Usage Example" >}}
-
-{{< tab "Python" >}}
-```python
-class MyAgent(Agent):
-
- @chat_model_connection
- @staticmethod
- def azure_openai_connection() -> ResourceDescriptor:
- return ResourceDescriptor(
- clazz=ResourceName.ChatModel.AZURE_OPENAI_CONNECTION,
- api_key="<your-api-key>",
- api_version="2024-02-15-preview",
- azure_endpoint="https://your-resource.openai.azure.com"
- )
-
- @chat_model_setup
- @staticmethod
- def azure_openai_chat_model() -> ResourceDescriptor:
- return ResourceDescriptor(
- clazz=ResourceName.ChatModel.AZURE_OPENAI_SETUP,
- connection="azure_openai_connection",
- model="my-gpt4-deployment", # Your Azure deployment name
- model_of_azure_deployment="gpt-4", # Underlying model for metrics
- max_tokens=1000
- )
-
- ...
-```
-{{< /tab >}}
-
-{{< /tabs >}}
-
-#### Available Models
-
-OpenAI (Azure) supports OpenAI models deployed through your Azure
subscription. Visit the [Azure OpenAI Models
documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models)
for the complete and up-to-date list of available models.
-
-Some popular options include:
-- **GPT-4o** (gpt-4o)
-- **GPT-4** (gpt-4)
-- **GPT-4 Turbo** (gpt-4-turbo)
-- **GPT-3.5 Turbo** (gpt-35-turbo)
-
-{{< hint warning >}}
-Model availability depends on your Azure region and subscription. Always check
the official Azure OpenAI documentation for regional availability before
implementing in production.
-{{< /hint >}}
-
### Tongyi (DashScope)
Tongyi provides cloud-based chat models from Alibaba Cloud, offering powerful
Chinese and English language capabilities.
diff --git a/docs/content/docs/faq/faq.md b/docs/content/docs/faq/faq.md
index d86ada37..b46733ab 100644
--- a/docs/content/docs/faq/faq.md
+++ b/docs/content/docs/faq/faq.md
@@ -93,19 +93,19 @@ Flink Agents provides built-in integrations for many
ecosystem providers. Some i
| Provider | Python | Java |
|---|---|---|
-| [OpenAI]({{< ref "docs/development/chat_models#openai" >}}) | ✅ | ✅ |
| [Anthropic]({{< ref "docs/development/chat_models#anthropic" >}}) | ✅ | ❌ |
+| [Azure AI]({{< ref "docs/development/chat_models#azure-ai" >}}) | ❌ | ✅ |
+| [Azure OpenAI]({{< ref "docs/development/chat_models#azure-openai" >}}) | ✅
| ❌ |
| [Ollama]({{< ref "docs/development/chat_models#ollama" >}}) | ✅ | ✅ |
+| [OpenAI]({{< ref "docs/development/chat_models#openai" >}}) | ✅ | ✅ |
| [Tongyi (DashScope)]({{< ref "docs/development/chat_models#tongyi-dashscope"
>}}) | ✅ | ❌ |
-| [OpenAI (Azure)]({{< ref "docs/development/chat_models#openai-azure" >}}) |
✅ | ❌ |
-| [Azure AI]({{< ref "docs/development/chat_models#azure-ai" >}}) | ❌ | ✅ |
**Embedding Models**
| Provider | Python | Java |
|---|---|---|
-| [OpenAI]({{< ref "docs/development/embedding_models#openai" >}}) | ✅ | ❌ |
| [Ollama]({{< ref "docs/development/embedding_models#ollama" >}}) | ✅ | ✅ |
+| [OpenAI]({{< ref "docs/development/embedding_models#openai" >}}) | ✅ | ❌ |
**Vector Stores**