This is the spring ai version for spring petclinic, if you want to see a langchain4j version, please refer to spring-petclinic-langchain4j
Spring Petclinic is a Spring Boot application built
using Maven. You can build a jar
file and run it from the command line (it should work just as well with Java 17 or newer), Before you build the
application, you need to setup some openai properties in src/main/resources/application.properties
:
git clone https://github.com/showpune/spring-petclinic-springai.git
cd spring-petclinic-springai
mv src/main/resources/application.properties.example src/main/resources/application.properties
edit the src/main/resources/application.properties
file and add the following properties:
spring.ai.azure.openai.api-key=**
spring.ai.azure.openai.endpoint=https://***.openai.azure.com/
spring.ai.azure.openai.chat.options.deployment-name=gpt-4
spring.ai.azure.openai.chat.options.temperature=0.8
spring.ai.chat.client.enabled=true
spring.ai.azure.openai.embedding.options.deployment-name=text-embedding-ada-002
You can build the application by running the following command:
./mvnw package
java -jar target/*.jar
You can then access the Petclinic at http://localhost:8080/
And the OpenAI chatbot at http://localhost:8080/chat.html.
Go to the owner page, you can query all owner information of "Davis"
You can also talk with the agent, query your information.
you can also talk with Chinese
Go to the owner page you can see your information is added
The Spring PetClinic sample application is released under version 2.0 of the Apache License.