# 3.1 환경 설정과 LangChain의 ChatOpenAI를 활용한 검증

* 파이썬 가상환경 설정
  * [conda](https://conda.io/projects/conda/en/latest/user-guide/getting-started.html) ↗️, [virtualenv](https://virtualenv.pypa.io/en/latest/) ↗️ 등 이미 사용중인 방법이 있다면 해당 방법 사용
  * 개인적으로 [pyenv](https://github.com/pyenv/pyenv) ↗️ 추천
* 환경변수 관리
  * [python-dotenv](https://pypi.org/project/python-dotenv/) ↗️  활용
  * `load_dotenv()` 를 활용하면 `.env` 의 값을 불러올 수 있음
* 이번 강의의 목적은 [ChatOpenAI](https://python.langchain.com/v0.2/docs/integrations/chat/openai/) ↗️ 를 활용해서 LLM의 답변을 생성하는 것
  * 환경변수를 `ChatOpenAI` 에 매번 넣어주지 않으려면 OpenAI Dashboard에서 생성한 API KEY를 `OPENAI_API_KEY` 라는 이름으로 저장해야함
  * quota 초과 에러메시지가 나온다면 [OpenAI Dashboard](https://platform.openai.com/settings/organization/billing/overview) ↗️ 에 들어가셔서 `Credit Balance` 를 확인해주세요

<figure><img src="/files/o9Suc2TCvSEt7mWYBHah" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jason-kang.gitbook.io/rag-llm-application-feat.-langchain/3.-langchain-retrieval-augmented-generation-rag/3.1-langchain-chatopenai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
