ChatGPTNextWeb / ChatGPT-Next-Web

A cross-platform ChatGPT/Gemini UI (Web / PWA / Linux / Win / MacOS). ไธ€้”ฎๆ‹ฅๆœ‰ไฝ ่‡ชๅทฑ็š„่ทจๅนณๅฐ ChatGPT/Gemini ๅบ”็”จใ€‚
https://app.nextchat.dev/
MIT License
76.71k stars 59.21k forks source link

[Bug] invalid_request_error with claude and anthropic api #5256

Closed MelBourbon closed 1 month ago

MelBourbon commented 3 months ago

๐Ÿ“ฆ Deployment Method

Docker

๐Ÿ“Œ Version

2.14.1

๐Ÿ’ป Operating System

Ubuntu

๐Ÿ“Œ System Version

22.04

๐ŸŒ Browser

Chrome

๐Ÿ“Œ Browser Version

127.0.6533.100

๐Ÿ› Bug Description

I added my claude (anthopic) API Key to docker-compose.yml with ANTHROPIC_API_KEY: xxx Docker starts fine but when sending prompt the following error is received.

{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "messages.1.content: all 'assistant' content blocks should be text"
  }
}

If I add ANTHROPIC_API_VERSION: 2023-06-01 to docker-compose.ymlthe docker does not start with following error:

Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 33, in <module>
    sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')())
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 81, in main
    command_func()
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 200, in perform_command
    project = project_from_options('.', options)
  File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 60, in project_from_options
    return get_project(
  File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 148, in get_project
    config_data = config.load(config_details, interpolate)
  File "/usr/lib/python3/dist-packages/compose/config/config.py", line 423, in load
    processed_files = [
  File "/usr/lib/python3/dist-packages/compose/config/config.py", line 424, in <listcomp>
    process_config_file(config_file, config_details.environment, interpolate=interpolate)
  File "/usr/lib/python3/dist-packages/compose/config/config.py", line 626, in process_config_file
    validate_against_config_schema(config_file, config_file.version)
  File "/usr/lib/python3/dist-packages/compose/config/validation.py", line 474, in validate_against_config_schema
    handle_errors(
  File "/usr/lib/python3/dist-packages/compose/config/validation.py", line 541, in handle_errors
    error_msg = '\n'.join(format_error_func(error) for error in errors)
  File "/usr/lib/python3/dist-packages/compose/config/validation.py", line 541, in <genexpr>
    error_msg = '\n'.join(format_error_func(error) for error in errors)
  File "/usr/lib/python3/dist-packages/compose/config/validation.py", line 450, in process_config_schema_errors
    return handle_generic_error(error, path)
  File "/usr/lib/python3/dist-packages/compose/config/validation.py", line 320, in handle_generic_error
    config_key, error_msg = _parse_oneof_validator(error)
  File "/usr/lib/python3/dist-packages/compose/config/validation.py", line 411, in _parse_oneof_validator
    json.dumps(context.instance),
  File "/usr/lib/python3.10/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python3.10/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python3.10/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python3.10/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '

๐Ÿ“ท Recurrence Steps

  1. Set up docker-compose.yml
  2. Start docker
  3. Set model to claude
  4. Sending prompt

๐Ÿšฆ Expected Behavior

Model should reply

๐Ÿ“ Additional Information

No response

nextchat-manager[bot] commented 3 months ago

Please follow the issue template to update description of your issue.

Issues-translate-bot commented 3 months ago

Bot detected the issue body's language is not English, translate it automatically.


Title: [Bug]

MelBourbon commented 2 months ago

Please follow the issue template to update description of your issue.

Issue Template not existing anymore

lloydzhou commented 1 month ago

่ฟ™ไธช้กน็›ฎๆ˜ฏjs็š„๏ผŒไฝ†ๆ˜ฏ็œ‹็ป™ๅ‡บๆฅ็š„ไธ€ๅ †้”™่ฏฏๆ—ฅๅฟ—ๆ˜ฏpython็š„๏ผŸ

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


This project is in js, but the bunch of error logs shown are in python?