ChatFred: TypeError: 'type' object is not subscriptable

I had a look at the troubleshooting section

  • [√ ] Yes
  • No

Describe the bug A clear and concise description of what the bug is. Test with ‘cf say it is a test’, but nothing happens. Workflow debugger says:

[23:09:00.215] ChatFred[Keyword] Processing complete
[23:09:00.217] ChatFred[Keyword] Passing output 'say it is a test' to Run Script
[23:09:00.722] ERROR: ChatFred[Run Script] Traceback (most recent call last):
  File "src/text_chat.py", line 58, in <module>
    def read_from_log() -> list[str]:
TypeError: 'type' object is not subscriptable
[23:09:00.723] ChatFred[Run Script] Processing complete
[23:09:00.723] ChatFred[Run Script] Passing output '' to Large Type
[23:09:00.724] ChatFred[Run Script] Passing output '' to Conditional
[23:09:00.725] ChatFred[Run Script] Passing output '' to Conditional
[23:09:00.725] ChatFred[Conditional] Processing complete
[23:09:00.726] ChatFred[Conditional] Passing output '' to Copy to Clipboard
[23:09:00.726] ChatFred[Copy to Clipboard] Processing complete
[23:09:00.727] ChatFred[Copy to Clipboard] Passing output '' to Conditional
[23:09:00.727] ChatFred[Conditional] Processing complete
[23:09:00.728] ChatFred[Conditional] Passing output '' to Post Notification

To Reproduce Steps to reproduce the behavior: Trigger ChatFred with ‘cf say it is a test’

Relevant information from the ChatFred_Error.log file No error log was produced. ChatFred version: 1.2.1 Alfred version: 5.0.6

Additional context By the way, ‘cfi’ command works well.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 15 (9 by maintainers)

Most upvoted comments

Yes - it works splendidly. Thanks for all your work on this!

You’ve cracked it! It seems that my mac no longer had Python installed after an update.

Thanks for all your help with this!

Hi @chrislemke,

I just uninstalled and reintalled via your link and this is the error that came through on the debug viewer:

[23:27:58.792] ChatFred[Keyword] Processing complete
[23:27:58.797] ChatFred[Keyword] Passing output 'asdfasdf' to Run Script
[23:27:59.120] ERROR: ChatFred[Run Script] Traceback (most recent call last):
  File "/.../Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.BBAFA9DD-4B66-4BDE-8042-BD93A6FE29FA/src/text_chat.py", line 153, in make_chat_request
    openai.ChatCompletion.create(
AttributeError: module 'openai' has no attribute 'ChatCompletion'. Did you mean: 'Completion'?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/.../Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.BBAFA9DD-4B66-4BDE-8042-BD93A6FE29FA/src/text_chat.py", line 186, in <module>
    __prompt, __response = make_chat_request(
  File "/.../Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.BBAFA9DD-4B66-4BDE-8042-BD93A6FE29FA/src/text_chat.py", line 167, in make_chat_request
    response = exception_response(exception)
  File "/.../Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.BBAFA9DD-4B66-4BDE-8042-BD93A6FE29FA/src/error_handling.py", line 74, in exception_response
    if isinstance(error, openai.error.Timeout):
AttributeError: module 'openai.error' has no attribute 'Timeout'
[23:27:59.130] ChatFred[Run Script] Processing complete
[23:27:59.131] ChatFred[Run Script] Passing output '' to Large Type
[23:27:59.132] ChatFred[Run Script] Passing output '' to Conditional
[23:27:59.133] ChatFred[Run Script] Passing output '' to Conditional
[23:27:59.134] ChatFred[Conditional] Processing complete
[23:27:59.135] ChatFred[Conditional] Passing output '' to Copy to Clipboard
[23:27:59.136] ChatFred[Copy to Clipboard] Processing complete
[23:27:59.137] ChatFred[Copy to Clipboard] Passing output '' to Conditional

Let me know if there is anything else I can assist with.

Thanks

This release (1.2.2) should work.