Azure-Samples / acme-fitness-store

Sample - how to deploy Spring Boot apps to Azure?
https://docs.microsoft.com/en-us/azure/spring-cloud/overview
MIT License
84 stars 158 forks source link

Need to set ai model explicitly before executing preprocess.sh script in local #173

Closed guitarsheng closed 1 year ago

guitarsheng commented 1 year ago

I found some issue , in the step (Optional) Preprocess the data into the vector store in acme-fitness-store/apps/acme-assist/README.md at Azure · Azure-Samples/acme-fitness-store (github.com).

Before running preprocess.sh script locally, the application.yaml file should to be changed as below:

spring:
  ai:
    azure:
      openai:
        apiKey: <api key>
        endpoint: <ai endpoint>
        model: text-embedding-ada-002    //the model should be set to text-embedding-xxx explicitly.
...
markpollack commented 1 year ago

The current file is

spring:
  ai:
    azure:
      openai:
        model: gpt-35-turbo-16k
management:
  endpoints:
    web:
      exposure:
        include: info,health

The model refers to the AI model and needs to be gpt-35-turbo-16k, not text-embedding-ada-002. There is a property embeddingModel but the default value in Spring AI is text-embedding-ada-002 so there is no need to set it.

I would recommend that we do not tell the user's to update application.yaml

        apiKey: <api key>
        endpoint: <ai endpoint>

but instead tell them to set the environment variables.

export SPRING_AI_AZURE_OPENAI_API_KEY=<api key>
export SPRING_AI_AZURE_OPENAI_ENDPOINT=<end point>

It can go either way, but setting env vars is already something they need to do, so it keeps the flow of the experience the same for the user.

guitarsheng commented 1 year ago

Yes, I have made change in this PR

https://github.com/Azure-Samples/acme-fitness-store/pull/183