intellij에서 option+enter를 눌러 auto-import를 적용할 수 있다.
근데, 해당 프로젝트 내의 import는 적용이 되는데, 설치된 package는 auto import를 추천하지 않는다.
ChatOpenAI는 langchain에 있는 것인데, langchain은 이미 설치되어 있는 상태다.
여러가지 방안을 해봤는데, 잘 안되어서 intellij의 프로젝트 파일(my-project.iml)을 수정해봤다.
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/project" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
나의 가상환경 경로는 venv
가 아니라 .venv
이다. 위에서 venv를 .venv로 변경하니 적용이 되었다.
반응형