> 技术文档 > 【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型

【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型


一、登录

得先有账号(注册账号)
https://portal.azure.com/
账号:xxxxx
密码:xxxx

二、安装部署AI服务

登录后,在首页输入 OpenAI 搜索
【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型
【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型

三、创建模型

1、服务组列表

【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型
【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型

2、选择模型

【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型

【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型

3、开始聊天调试

【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型

四、操作手册

1、文档地址

右上角点击链接
https://learn.microsoft.com/zh-cn/azure/ai-foundry/openai/chatgpt-quickstart?tabs=keyless%2Ctypescript-keyless%2Cpython-new%2Ccommand-line&pivots=programming-language-java

【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型

【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型

2、导入依赖

<dependency> <groupId>com.azure</groupId> <artifactId>azure-ai-openai</artifactId> <version>1.0.0-beta.10</version> </dependency> <dependency> <groupId>com.azure</groupId> <artifactId>azure-core</artifactId> <version>1.53.0</version> </dependency> <dependency> <groupId>com.azure</groupId> <artifactId>azure-identity</artifactId> <version>1.15.1</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <version>1.7.9</version> </dependency>

3、java 案例代码

每个人的都不一样
需要端点地址 https://sztyai.openai.azure.com/openai/deployments/gpt-4/chat/completions?api-version=2025-01-01-preview
秘钥 xxxxxxxxxxxxxxxx
复制一下代码示例进 IDEA 即可运行

【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型

一、登录

得先有账号(注册账号)
https://portal.azure.com/
账号:xxxxx
密码:xxxx

二、安装部署AI服务

登录后,在首页输入 OpenAI 搜索
【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型
【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型

三、创建模型

1、服务组列表

【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型
【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型

2、选择模型

【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型

【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型

3、开始聊天调试

【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型

四、操作手册

1、文档地址

右上角点击链接
https://learn.microsoft.com/zh-cn/azure/ai-foundry/openai/chatgpt-quickstart?tabs=keyless%2Ctypescript-keyless%2Cpython-new%2Ccommand-line&pivots=programming-language-java

【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型

【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型

2、导入依赖

<dependency> <groupId>com.azure</groupId> <artifactId>azure-ai-openai</artifactId> <version>1.0.0-beta.10</version> </dependency> <dependency> <groupId>com.azure</groupId> <artifactId>azure-core</artifactId> <version>1.53.0</version> </dependency> <dependency> <groupId>com.azure</groupId> <artifactId>azure-identity</artifactId> <version>1.15.1</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <version>1.7.9</version> </dependency>

3、java 案例代码

每个人的都不一样
需要端点地址 https://sztyai.openai.azure.com/openai/deployments/gpt-4/chat/completions?api-version=2025-01-01-preview
秘钥 xxxxxxxxxxxxxxxx
复制一下代码示例进 IDEA 即可运行

【AI】一、spring ai 调用 微软云 Azure 的 ChatGPT4 LLM 聊天模型

上犹新闻