feat: solution for 'Экзамен: Самокорректирующийся агент'

This commit is contained in:
2026-07-01 14:42:36 +03:00
parent 153b04b33c
commit 08e0fee223
5 changed files with 95 additions and 213 deletions
+17
View File
@@ -0,0 +1,17 @@
import { OpenAI } from 'langchain-openai';
/**
* Generates a response from the LLM for a given prompt.
*
* @param {string} prompt - The input prompt to send to the LLM.
* @returns {Promise<string>} The LLM's response text.
*/
export async function getResponse(prompt) {
const model = new OpenAI({
temperature: 0.7,
modelName: 'gpt-3.5-turbo'
});
const response = await model.invoke(prompt);
return response;
}