Files
ekzamen-samokorrektiruyusch…/README.md
T

44 lines
920 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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
```bash
npm install
```
## Usage
```bash
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:
```bash
npm install langchain-ollama
```
```js
import { Ollama } from 'langchain-ollama';
```
Adjust the model initialization accordingly.
---