Skip to content

Commit

Permalink
fix: increase the max_token
Browse files Browse the repository at this point in the history
  • Loading branch information
sshivaditya committed Jan 9, 2025
1 parent c8b685c commit ca4e482
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/adapters/openai/helpers/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import { WriteFile } from "../../../tools/write-file";
import { ExploreDir } from "../../../tools/explore-dir";
import { SearchFiles } from "../../../tools/search-files";

const MAX_TRIES = 20;
const MAX_TRIES = 10;

const sysMsg = `You are a capable AI assistant currently running on a GitHub bot.
You are designed to assist with resolving issues by making incremental fixes using a standardized tool interface.
Each tool implements a common interface that provides consistent error handling and result reporting.
Workflow:
1. The repository has already been cloned and you are in the correct working directory
2. After each attempt to solve the issue, you will be asked if the solution is complete
2. After each attempt to solve the issue by using an appropriate tool, you will receive feedback, if the attempt was successful or not
3. If not complete, you will continue with additional attempts up to ${MAX_TRIES} tries
4. Each attempt should build upon previous attempts, learning from any failures
Expand Down Expand Up @@ -146,7 +146,7 @@ export class Completions extends SuperOpenAi {

constructor(client: OpenAI, context: Context) {
super(client, context);
this.maxTokens = 100;
this.maxTokens = 100000;
this.attempts = 0;
this.tools = {
readFile: new ReadFile(),
Expand Down Expand Up @@ -318,6 +318,7 @@ export class Completions extends SuperOpenAi {
presence_penalty: 0,
});

this.context.logger.info("LLM response:" + JSON.stringify(res, null, 2));
finalResponse = res;

// Get the LLM's response
Expand Down

0 comments on commit ca4e482

Please sign in to comment.