Skip to content

Uncaught TypeError in aider line 10 #1219

Closed
@umutcanoner

Description

@umutcanoner

Aider version: 0.54.7-dev

An uncaught exception occurred:

Traceback (most recent call last):
  File "aider", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "main.py", line 640, in main
    coder.run()
  File "base_coder.py", line 727, in run
    self.run_one(user_message, preproc)
  File "base_coder.py", line 770, in run_one
    list(self.send_message(message))
  File "base_coder.py", line 1131, in send_message
    self.show_exhausted_error()
  File "base_coder.py", line 1208, in show_exhausted_error
    input_tokens = self.main_model.token_count(self.format_messages())
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "models.py", line 590, in token_count
    msgs = json.dumps(messages)
           ^^^^^^^^^^^^^^^^^^^^
  File "__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "encoder.py", line 200, in encode
    chunks = self.iterencode(o, _one_shot=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "encoder.py", line 258, in iterencode
    return _iterencode(o, 0)
           ^^^^^^^^^^^^^^^^^
  File "encoder.py", line 180, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type ChatChunks is not JSON serializable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions