diff --git a/README.md b/README.md index 305c84c..a712aa0 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,25 @@ # Самокорректирующийся агент -## Описание +This repository contains a minimal setup for a self-correcting agent using LangChain and OpenAI. +The `requirements.txt` file includes all necessary dependencies. -Данный проект демонстрирует простое использование библиотек **langgraph** и **langchain-openai**. -- **langgraph** – библиотека для построения графов взаимодействия с LLM. -- **langchain-openai** – обёртка над OpenAI API, позволяющая удобно работать с моделями. - -## Установка +## Setup ```bash +# Create a virtual environment (optional but recommended) +python -m venv venv +source venv/bin/activate # On Windows: venv\Scripts\activate + +# Install dependencies pip install -r requirements.txt ``` -## Запуск +## Running the Test Script ```bash -python src/main.py +python main.py ``` -> **Важно:** Для работы с OpenAI необходимо задать переменную окружения `OPENAI_API_KEY`. -> Если ключ не установлен, скрипт выполнит только проверку версии `langgraph`. - -## Пример вывода - -``` -langgraph version: 0.0.1 -OPENAI_API_KEY not set; skipping LLM call. -``` - -Если ключ установлен, вы увидите ответ модели: - -``` -langgraph version: 0.0.1 -LLM response: Hello! -``` +You should see a message confirming that the LangChain OpenAI import was successful and an LLM instance was created. --- \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..88559b0 --- /dev/null +++ b/main.py @@ -0,0 +1,12 @@ +from langchain_openai import ChatOpenAI + +def main(): + # Simple test to ensure imports work + try: + llm = ChatOpenAI() + print("LangChain OpenAI import successful. LLM instance created.") + except Exception as e: + print(f"Error creating LLM instance: {e}") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index d7a5a25..21d2e3a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ -langgraph -langchain-openai \ No newline at end of file +langchain>=0.1.0 +langchain-openai>=0.0.1 +openai>=1.0.0 \ No newline at end of file