diff --git a/packages/bumpgen-core/src/services/llm/openai.ts b/packages/bumpgen-core/src/services/llm/openai.ts index 2bbcf88..4e8ad3e 100644 --- a/packages/bumpgen-core/src/services/llm/openai.ts +++ b/packages/bumpgen-core/src/services/llm/openai.ts @@ -29,21 +29,19 @@ const makePlanNodeMessage = ( role: "user" as const, content: [ `I'm upgrading the package '${bumpedPackage}' and my code is failing. You might need to modify the code or the imports. Look at the errors below and think step-by-step about what the errors mean and how to fix the code.\n`, + `\n${importMessages.join("\n")}\n`, ``, - ] - .concat(importMessages.length ? [...importMessages, "\n"] : []) - .concat([`${planNode.block}`, "\n"]) - .concat( - planNode.kind === "seed" && planNode.errorMessages.length > 0 - ? [ - `The block has the following build errors:`, - "", - ...planNode.errorMessages.map((e) => `\n${e.message}\n`), - "", - ] - : [], - ) - .join("\n"), + `${planNode.block}`, + "\n", + ...(planNode.kind === "seed" && planNode.errorMessages.length > 0 + ? [ + `The block has the following build errors:`, + "", + ...planNode.errorMessages.map((e) => `\n${e.message}\n`), + "", + ] + : []), + ].join("\n"), }; }; @@ -218,14 +216,7 @@ export const fitToContext = ( export const createOpenAIService = (openai: OpenAI) => { return { codeplan: { - getReplacements: async ( - context: LLMContext, - temperature: number, - // externalDependencyContext: { - // imports: DependencyGraphNode[]; - // sourcegraph: ContextSearchResponse["getCodyContext"]; - // }, - ) => { + getReplacements: async (context: LLMContext, temperature: number) => { const { spatialContext, temporalContext,