Develokit / K-HACKATHON-BackEnd

0 stars 1 forks source link

openai api 등록 & 엔티티 완료 #1

Closed yaewon0411 closed 1 month ago

yaewon0411 commented 1 month ago

에러 1

Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'openai.key' in value "${openai.key}"

  1. PropertySource("classpath:application.yaml") 설정 했으나 해결 안되서
  2. run -> edit configuration에서 active profile에 dev 설정했더니, 에러 내용 달라짐
    
    org.springframework.beans.factory.BeanCreationException: 
    Error creating bean with name 'openAiChatModel' defined in class path resource [org/springframework/ai/autoconfigure/openai/OpenAiAutoConfiguration.class]: 
    Failed to instantiate [org.springframework.ai.openai.OpenAiChatModel]: 
    Factory method 'openAiChatModel' threw exception with message: OpenAI API key must be set

Caused by: java.lang.IllegalArgumentException: OpenAI API key must be set


3. 처음 스타터에서 설정한  openai 라이브러리 사전 설정으로 인한 에러 같음. 해당 라이브러리 사용 안 할 예정이라 제거함