Skip to content

Size troubles #13

@glennfu

Description

@glennfu

I'm trying to run this on a project with the following prompt:

Upgrade the Rails version to 7.0.3.1 following known migration guides to upgrade a Rails project from Rails 6 to Rails 7. Ensure that `bundle exec rspec` still passes

I've tried to trim down my files in src_include as much as possible to fit within the default limits but when I try a prompt I see:

reqJson {
  model: 'gpt-4',
  temperature: 0,
  total_tokens: 4050,
  max_tokens: 29905,
  top_p: 1,
  frequency_penalty: 0,
  presence_penalty: 0,
  rawApi: false,
  messages: [
    {
      role: 'system',
      content: "You are an assistant, who can only reply in JSON object, reply with a yes (in a param named 'reply') if you understand"
    },
    { role: 'assistant', content: '{"reply":"yes"}' },
    {
      role: 'user',
      content: '[object Object]\n' +
        '[object Object]\n' +
        '[object Object]\n' +
        '[object Object]\n' +
        '[object Object]'
    }
  ]
}
getCompletion API error {
  message: "This model's maximum context length is 8192 tokens. However, you requested 29973 tokens (68 in the messages, 29905 in the completion). Please reduce the length of the messages or completion.",
  type: 'invalid_request_error',
  param: 'messages',
  code: 'context_length_exceeded'
}

I'm not sure how to debug further here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions