Chainlit / cookbook

Chainlit's cookbook repo
https://github.com/Chainlit/chainlit
726 stars 270 forks source link

Error running openinterpreter example #27

Closed fcolavecchia closed 11 months ago

fcolavecchia commented 11 months ago

I have the following error when running the openinterpreter example, using OpenAI (any model gives the same result). Not fluent with chainlit (nor openinterpreter), so maybe I am doing something wrong?

'Interpreter' object has no attribute 'active_block'
Traceback (most recent call last):
  File "/opt/miniconda3/envs/ai/lib/python3.10/site-packages/chainlit/utils.py", line 41, in wrapper
    return user_function(**params_values)
  File "/Users/flavioc/Codes/GitHub/chainlit-cookbook/openinterpreter/app.py", line 109, in main
    interpreter.chat(message)
  File "/opt/miniconda3/envs/ai/lib/python3.10/site-packages/interpreter/core/core.py", line 65, in chat
    for _ in self._streaming_chat(message=message, display=display):
  File "/opt/miniconda3/envs/ai/lib/python3.10/site-packages/interpreter/core/core.py", line 75, in _streaming_chat
    validate_llm_settings(self)
  File "/opt/miniconda3/envs/ai/lib/python3.10/site-packages/interpreter/terminal_interface/validate_llm_settings.py", line 97, in validate_llm_settings
    display_markdown_message(f"> Model set to `{interpreter.model.upper()}`")
  File "/opt/miniconda3/envs/ai/lib/python3.10/site-packages/interpreter/utils/display_markdown_message.py", line 18, in display_markdown_message
    rich_print(Markdown(line))
  File "/opt/miniconda3/envs/ai/lib/python3.10/site-packages/rich/__init__.py", line 74, in print
    return write_console.print(*objects, sep=sep, end=end)
  File "/opt/miniconda3/envs/ai/lib/python3.10/site-packages/rich/console.py", line 1672, in print
    with self:
  File "/opt/miniconda3/envs/ai/lib/python3.10/site-packages/rich/console.py", line 864, in __exit__
    self._exit_buffer()
  File "/opt/miniconda3/envs/ai/lib/python3.10/site-packages/rich/console.py", line 822, in _exit_buffer
    self._check_buffer()
  File "/opt/miniconda3/envs/ai/lib/python3.10/site-packages/rich/console.py", line 2059, in _check_buffer
    self.file.write(text)
  File "/Users/flavioc/Codes/GitHub/chainlit-cookbook/openinterpreter/app.py", line 33, in write
    if interpreter.active_block and type(interpreter.active_block).__name__ == "CodeBlock":
AttributeError: 'Interpreter' object has no attribute 'active_block'
willydouhard commented 11 months ago

@constantinidan can you help on this?

constantinidan commented 11 months ago

@fcolavecchia I removed the line about formatting (the code is displayed as plain text). I would need to investigate more on the change that occurred. In the meantime, the code works!