Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 31, 2025

This PR implements the enterprise WeChat intelligent robot interface as requested, providing comprehensive API support for managing and interacting with AI-powered robots in WeChat Work applications.

Overview

The implementation adds a new WxCpIntelligentRobotService that enables developers to:

  • Create and manage intelligent robots with customizable names, descriptions, and avatars
  • Conduct AI-powered conversations with session management for context continuity
  • Update robot configurations including enabling/disabling robot status
  • Reset conversation sessions to clear chat history when needed
  • Delete robots when no longer required

Key Components

Service Interface

WxCpService wxCpService = ...; // Initialize WeChat Work service
WxCpIntelligentRobotService robotService = wxCpService.getIntelligentRobotService();

// Create a new intelligent robot
WxCpIntelligentRobotCreateRequest request = new WxCpIntelligentRobotCreateRequest();
request.setName("Customer Service Bot");
request.setDescription("AI-powered customer support");
WxCpIntelligentRobotCreateResponse response = robotService.createRobot(request);

// Start intelligent conversation
WxCpIntelligentRobotChatRequest chatRequest = new WxCpIntelligentRobotChatRequest();
chatRequest.setRobotId(response.getRobotId());
chatRequest.setUserid("user123");
chatRequest.setMessage("How can I help you today?");
WxCpIntelligentRobotChatResponse chatResponse = robotService.chat(chatRequest);

API Endpoints

The implementation follows WeChat Work's official API documentation and includes endpoints for:

  • POST /cgi-bin/intelligent_robot/create - Create robots
  • POST /cgi-bin/intelligent_robot/update - Update robot configuration
  • POST /cgi-bin/intelligent_robot/get - Retrieve robot information
  • POST /cgi-bin/intelligent_robot/chat - Conduct AI conversations
  • POST /cgi-bin/intelligent_robot/reset_session - Reset conversation context
  • POST /cgi-bin/intelligent_robot/delete - Remove robots

Bean Classes

Complete set of request/response classes with proper JSON serialization:

  • WxCpIntelligentRobot - Robot entity with status and metadata
  • WxCpIntelligentRobotCreateRequest/Response - Robot creation
  • WxCpIntelligentRobotChatRequest/Response - AI conversation handling
  • WxCpIntelligentRobotUpdateRequest - Robot configuration updates

Integration

The service follows existing WxJava patterns and integrates seamlessly:

  • Added to main WxCpService interface as getIntelligentRobotService()
  • Properly initialized in BaseWxCpServiceImpl
  • Includes comprehensive documentation and usage examples
  • All code follows project checkstyle standards and passes validation

This enhancement enables developers to build sophisticated AI-powered customer service, internal assistants, and automated conversation systems within enterprise WeChat applications.

Fixes #3682.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits August 31, 2025 14:59
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] 请求增加 企业微信智能机器人接口 Add enterprise WeChat intelligent robot interface support Aug 31, 2025
@Copilot Copilot AI requested a review from binarywang August 31, 2025 15:01
Copilot finished work on behalf of binarywang August 31, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

请求增加 企业微信智能机器人接口
2 participants