continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
19.63k stars 1.71k forks source link

Bedrock fails autocomplete: 'inferenceConfig.stopSequences' failed to satisfy constraint #2296

Open mystaroll opened 2 months ago

mystaroll commented 2 months ago

Before submitting your bug report

Relevant environment info

- OS: Linux
- Continue: 0.8.52
- IDE: vscode
- Model: any model in AWS Bedrock
- config.json: -

Description

Bedrock provider fails autocomplete with the following

1 validation error detected: Value '[</CO, </COMPLETION>, /src/, #- coding: utf-8, ```, def, class, """#]' at 'inferenceConfig.stopSequences' failed to satisfy constraint: Member must have length less than or equal to 4

I forced an override in config.json with

"completionOptions": {
    "stop": ["</CO"]
  },

but it doesn't do the trick.

To reproduce

No response

Log output

No response

xytxxx commented 2 months ago
xytxxx commented 2 months ago

My config.json: ( the problem persists whether or not I include completionOptions)

  "models": [
    {
      "model": "anthropic.claude-3-5-sonnet-20240620-v1:0",
      "provider": "bedrock",
      "title": "Claude 3.5 Sonnet Bedrock",
      "profile": "dev",
      "region": "us-west-2",
      "completionOptions": {
        "temperature": 0.2,
        "topP": 0.9,
        "topK": 40,
        "presencePenalty": 0.2,
        "frequencyPenalty": 0.0,
        "stop": ["\n"],
        "maxTokens": 600
      }
    }
  ],
  "tabAutocompleteModel": {
    "title": "Claude 3.5 Sonnet Bedrock",
    "profile": "dev",
    "region": "us-west-2",
    "model": "anthropic.claude-3-5-sonnet-20240620-v1:0",
    "provider": "bedrock",
    "completionOptions": {
      "temperature": 0.2,
      "topP": 0.9,
      "topK": 40,
      "presencePenalty": 0.2,
      "frequencyPenalty": 0.0,
      "stop": ["\n"],
      "maxTokens": 600
    }
  },
xytxxx commented 2 months ago

It seems to be a bedrock limitation: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_InferenceConfiguration.html

malaki12003 commented 1 month ago

FYI, fixed at https://github.com/continuedev/continue/pull/2554.