You are working on the hyperswitch repository (Rust payment processing system).…
- User
You are working on the hyperswitch repository (Rust payment processing system).
REPOSITORY SETUP:
- Repository: juspay/hyperswitch
- Working directory: ./repos/hyperswitch_pool_1 (already cloned)
- Base commit: d6e925fd348af9b69bd3a756cd21142eeccd180a
- Task ID: juspay__hyperswitch-8847
- Version: v1.117.0
TASK DESCRIPTION: Bug: feat: Add schema to store chat request response
- add schema for chat, to store request and response
- store chats to chat schema asynchronously
- encrypt the sensitive data
- have endpoint to list the chat data and decrypt it properly
DETAILED CONTEXT & HINTS:
Type of Change
- Bugfix
- New feature
- Enhancement
- Refactoring
- Dependency updates
- Documentation
- CI/CD
Description
- Store the user query and response from the ai service for the analysis.
- Allow the api only for internal user
Additional Changes
This pull request introduces support for encrypted chat conversations and adds database models and APIs for storing and retrieving chat interactions. The changes span configuration, API models, database schema, and core logic to enable secure chat storage and querying, with proper secret management for encryption keys.
Chat encryption and configuration:
- Added
encryption_keyto[chat]sections in all config files and updatedChatSettingsto use a secret for the encryption key, with secret management integration for secure handling.
Chat API model extensions:
- Added new API models for listing chat conversations (
ChatListRequest,ChatConversation,ChatListResponse)
Database schema and models for chat interactions:
- Introduced
hyperswitch_ai_interactiontable and corresponding Rust models for storing encrypted chat queries and
Assistant
I'll help you implement the chat schema feature for the hyperswitch repository. Let me start by understanding the codebase structure and identifying the key areas that need changes.
Assistant
Let me first explore the repository structure to understand where chat functionality should be implemented and how the existing codebase is organized.
Assistant
(no content)
Assistant
Let me look more closely at the specific implementation details of the chat feature and check if there are any database schema changes needed.
Assistant
(no content)
Assistant
(no content)
Assistant
(no content)
Assistant
Now let me examine the API models for chat to understand the current structure and what needs to be enhanced.
Assistant
Let me check the configuration files to see the current chat settings and understand how encryption should be implemented.
Assistant
(no content)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.