You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+27-9
Original file line number
Diff line number
Diff line change
@@ -79,6 +79,7 @@ This project consists of several microservices:
79
79
-**Customers Service**: Manages customer data.
80
80
-**Vets Service**: Handles information about veterinarians.
81
81
-**Visits Service**: Manages pet visit records.
82
+
-**GenAI Service**: Provides a chatbot interface to the application.
82
83
-**API Gateway**: Routes client requests to the appropriate services.
83
84
-**Config Server**: Centralized configuration management for all services.
84
85
-**Discovery Server**: Eureka-based service registry.
@@ -102,16 +103,33 @@ Spring Petclinic integrates a Chatbot that allows you to interact with the appli
102
103
3. Is there an owner named Betty?
103
104
4. Which owners have dogs?
104
105
5. Add a dog for Betty. Its name is Moopsie.
105
-
6. Create a new owner
106
+
6. Create a new owner.
107
+
108
+

109
+
110
+
This `spring-petlinic-genai-service` microservice currently supports **OpenAI** (default) or **Azure's OpenAI** as the LLM provider.
111
+
In order to start the microservice, perform the following steps:
112
+
113
+
1. Decide which provider you want to use. By default, the `spring-ai-openai-spring-boot-starter` dependency is enabled.
114
+
You can change it to `spring-ai-azure-openai-spring-boot-starter`in the `pom.xml`.
115
+
2. Create an OpenAI API key or a Azure OpenAI resource in your Azure Portal.
116
+
Refer to the [OpenAI's quickstart](https://platform.openai.com/docs/quickstart) or [Azure's documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/) for further information on how to obtain these.
117
+
You only need to populate the provider you're using - either openai, or azure-openai.
118
+
If you don't have your own OpenAI API key, don't worry!
119
+
You can temporarily use the `demo` key, which OpenAI provides free of charge for demonstration purposes.
120
+
This `demo` key has a quota, is limited to the `gpt-4o-mini` model, and is intended solely for demonstration use.
121
+
With your own OpenAI account, you can test the `gpt-4o` model by modifying the `deployment-name` property of the `application.yml` file.
122
+
3. Export your API keys and endpoint as environment variables:
This Microservice currently supports OpenAI or Azure's OpenAI as the LLM provider.
110
-
In order to enable Spring AI, perform the following steps:
111
-
112
-
1. Decide which provider you want to use. By default, the `spring-ai-azure-openai-spring-boot-starter` dependency is enabled. You can change it to `spring-ai-openai-spring-boot-starter`in `pom.xml`.
113
-
2. Copy `src/main/resources/creds-template.yaml` into `src/main/resources/creds.yaml`, and edit its contents with your API key and API endpoint. Refer to OpenAI's or Azure's documentation for further information on how to obtain these. You only need to populate the provider you're using - either openai, or azure-openai.
114
-
3. Boot the `spring-petclinic-genai-service` microservice.
115
133
## In case you find a bug/suggested improvement for Spring Petclinic Microservices
116
134
117
135
Our issue tracker is available here: https://github.com/spring-petclinic/spring-petclinic-microservices/issues
Copy file name to clipboardexpand all lines: spring-petclinic-genai-service/src/main/java/org/springframework/samples/petclinic/genai/PetclinicChatClient.java
+3-2
Original file line number
Diff line number
Diff line change
@@ -37,21 +37,22 @@ public PetclinicChatClient(ChatClient.Builder builder, ChatMemory chatMemory) {
37
37
you don't know the answer, then ask the user a followup question to try and clarify the question they are asking.
38
38
If you do know the answer, provide the answer but do not provide any additional followup questions.
39
39
When dealing with vets, if the user is unsure about the returned results, explain that there may be additional data that was not returned.
40
-
Only if the user is asking about the total number of all vets, answer that there are a lot and ask for some additional criteria.
40
+
Only if the user is asking about the total number of all vets, answer that there are a lot and ask for some additional criteria.
41
41
For owners, pets or visits - provide the correct data.
42
42
""")
43
43
.defaultAdvisors(
44
44
// Chat memory helps us keep context when using the chatbot for up to 10 previous messages.
0 commit comments