open-interpreter icon indicating copy to clipboard operation
open-interpreter copied to clipboard

AttributeError: module 'interpreter' has no attribute 'chat'

Open NatanAmado opened this issue 1 year ago • 2 comments

Describe the bug

When trying to run interpreter.chat() I get:

AttributeError: module 'interpreter' has no attribute 'chat'

This same function worked just a few weeks ago, so I thought something in the definitions had changed, so I checked the library, but there was still a definition for chat in the OpenInterpreter class.

I also tried it on another computer with Python 3.10.9, but I got the same results.

Reproduce

import interpreter

def run (prompt, key):
    interpreter.api_key = key
    output = interpreter.chat(prompt, stream=True)
    for chunk in output:
    print(chunk)

run("hello", "sk-3j9...")

Expected behavior

Output being returned in chunks.

Screenshots

No response

Open Interpreter version

0.2.0

Python version

Python 3.11.4

Operating System name and version

MacOS 14.1.2 (23B92)

Additional context

No response

NatanAmado avatar Jan 14 '24 12:01 NatanAmado

Your import statement should be

from interpreter import interpreter - docs

You will also need to update to interpreter.llm.api_key docs

MikeBirdTech avatar Jan 14 '24 14:01 MikeBirdTech

Your import statement should be

from interpreter import interpreter - docs

You will also need to update to interpreter.llm.api_key docs

It worked for me

Charlz91108112 avatar Jan 27 '24 14:01 Charlz91108112