Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul committed Jan 31, 2025
1 parent 167c754 commit 610e9c8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/agents/reflection/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ async function reflection(
const langMemClient = new Client({
apiUrl:
"https://langmem-v0-544fccf4898a5e3c87bdca29b5f9ab21.us.langgraph.app",
apiKey: process.env.LANGCHAIN_API_KEY,
});

const existingRules = await getReflectionsPrompt(config);
Expand All @@ -67,9 +68,7 @@ async function reflection(
};
const threads = [[conversation, feedback]];

const { thread_id } = await langMemClient.threads.create();
console.log("BEFORE AWAITING RUN!");
const result = await langMemClient.runs.wait(thread_id, "prompt_optimizer", {
const result = await langMemClient.runs.wait(null, "optimize_prompts", {
input: {
prompts: [
{
Expand All @@ -86,8 +85,6 @@ async function reflection(
},
});

console.dir(result, { depth: null });

const updated = (result as Record<string, any>).updated_prompts[0].prompt;

await putReflectionsPrompt(config, updated);
Expand Down

0 comments on commit 610e9c8

Please sign in to comment.