This project is a Spring Boot application that integrates with various AI chat services, including Anthropic Claude and Azure OpenAI. It provides a WebSocket interface for real-time communication and a REST API for standard HTTP requests. It is a part of assignment for "Saltmine"
For further reference, please consider the following sections:
-
Clone the repository:
git clone
-
Navigate to the project directory:
cd <repository-name>
-
Docker Build and Run :
docker build -t spring-ai-chat . docker run -e AOKEY=<YOUR_AZURE_API_KEY> -e OKEY=<YOUR_OPENAI_API_KEY> -e CKEY=<YOUR_CLAUDE -e VKEY=<YOUR_VERGE_SENSE_API_KEY> oc_planning
-
Access the application:
-
Open your REST client and use the base URL
http://localhost:8080to access the application. -
Use the WebSocket client to interact with the AI chat services, at :
ws://localhost:8080/chat/websocketCONNECT accept-version:1.1,1.2 host:localhost ^@
SUBSCRIBE id:sub-0 destination:/oc/messages \u0000SEND destination:/app/chat {"prompt":"Find me an available standing desk near the marketing team on the 3rd floor for tomorrow afternoon."} \u0000 -
For WebSocket, you can use a tool like WebSocket Test Client to test the WebSocket connection.
-
For REST API, you can use tools like Postman or curl to send HTTP requests to the endpoints provided by the application.
-
For example, to send a message to the AI chat service, you can use the following curl command:
curl -X GET http://localhost:8080/api/v1/workspace \ -H "Content-Type: application/json" \ -d '{ "query": "Find me an available standing desk near the marketing team on the 3rd floor for tomorrow afternoon.", "aiEngine": "AZURE_OPENAI" }'
Note : The system is designed to work with the specific Messages only due to time constraints.
Sample Response :
Hello! I've found a standing desk for you near the marketing team on the 3rd floor for tomorrow afternoon. You can use the space details provided in the JSON format below to proceed with your booking:
{
"desktype": "standing",
"location": {
"floor_number": 3,
"zone": "Marketing Zone",
"team_area": "Marketing Team"
},
"time": {
"datetime_range": "tomorrow afternoon"
},
"proximity": "near Marketing Team",
"spaces": [
{
"id": "space000011",
"name": "3rd Floor",
"type": "floor",
"capacity": 120,
"parentid": "buildinghq"
},
{
"id": "space000022",
"name": "Marketing Zone",
"type": "zone",
"capacity": 25,
"parentid": "space000011"
}
]
}
Let me know if you need further assistance or if there's anything else I can help you with!