Files
ekzamen-samokorrektiruyusch…/README.md
T

920 B
Raw Blame History

SelfCorrecting Agent

This repository demonstrates a minimal selfcorrecting agent that uses the LangChain OpenAI provider to generate responses from an LLM.

Prerequisites

  • Node.js v18 or newer (ESM support required)
  • An OpenAI API key set in the environment variable OPENAI_API_KEY

Installation

npm install

Usage

npm start

The script will send a prompt to the LLM and print the response.

Project Structure

  • src/agent.js Contains the logic to interact with the LLM.
  • src/index.js Entry point that demonstrates usage.
  • package.json Project metadata and dependencies.

Adding a Different LLM Provider

If you prefer to use another provider (e.g., Ollama), replace the dependency and imports:

npm install langchain-ollama
import { Ollama } from 'langchain-ollama';

Adjust the model initialization accordingly.