Comments (15)
This release (1.2.2) should work.
from chatfred.
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
from chatfred.
You've cracked it! It seems that my mac no longer had Python installed after an update.
Thanks for all your help with this!
from chatfred.
Yes - it works splendidly. Thanks for all your work on this!
from chatfred.
Hey @han-ysys!
Sorry for this. I already found the bug (at least I hope) and will provide a new release soon. If you want to fix it on your machine you can simply the following code in the text_chat.py
file.
def read_from_log() -> list[str]:
"""Reads the log file and returns the last __history_length lines."""
history: list[str] = []
if os.path.isfile(__log_file_path) is False:
return history
with open(__log_file_path, "r", encoding="utf-8") as log_file:
logs = log_file.readlines()
for line in logs:
line = line.replace("\n", "")
history.append(line)
return history[: __history_length * 2]
by:
def read_from_log():
"""Reads the log file and returns the last __history_length lines."""
history = []
if os.path.isfile(__log_file_path) is False:
return history
with open(__log_file_path, "r", encoding="utf-8") as log_file:
logs = log_file.readlines()
for line in logs:
line = line.replace("\n", "")
history.append(line)
return history[: __history_length * 2]
Alternatively you can update your Python Version to >= 3.10.
from chatfred.
Hi Chris
Just a heads up - I had the same issue and the suggested code fix above did not seem to work for me. Will the most recent release be live on the Alfred Gallery soon?
from chatfred.
Hey! Version 1.2.2. should already be online: https://alfred.app/workflows/chrislemke/chatfred/
from chatfred.
Hey @CullumAttwell!
Do you get the same error message?
from chatfred.
Hi @CullumAttwell,
thanks for providing this information. This is a strange error.
AttributeError: module 'openai' has no attribute 'ChatCompletion'.
Since ChatCompletion
obviously does exist I have a bit of the feeling that an old version of the OpenAI packages - for some reason still remains on your machine.
Could you navigate to: ~/Apps/Alfred/Alfred.alfredpreferences/workflows/user.workflow.THE ID OF THE CHATFRED WORKFLOW/src/libs/openai/__init__.py
. Alternatively you can make right-click on the workflow and an Open in Finder
and then navigate from the to the /src/libs/openai/__init__.py
destination.
Right at the top you should find:
from openai.api_resources import (
Audio,
ChatCompletion,
Completion,
Customer,
Edit,
Deployment,
Embedding,
Engine,
ErrorObject,
File,
FineTune,
Image,
Model,
Moderation,
)
If it does not contain ChatCompletion
we know your machine has the old package/files and you can simply install the new version.
Same applies for the AttributeError: module 'openai.error' has no attribute 'Timeout'
error.
from chatfred.
Morning @chrislemke,
Thanks for your response.
I have just tested this out and I can confirm that I have ChatCompletion within the specificed file.
I completed a fresh install from https://alfred.app/workflows/chrislemke/chatfred/ but the issue still persists.
On a side note, I have realised that I am able to use the "cft" part of the worflow (I was unaware of this before) but the "cf" and "cfi" commands still allude me.
from chatfred.
Thanks for the quick update. What error you are getting if you try cfi
?
from chatfred.
[09:14:43.118] ChatFred[Keyword] Passing output 'tester' to Run Script
[09:14:43.336] ERROR: ChatFred[Run Script] Traceback (most recent call last):
File "/.../Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8D40654A-A2DC-483E-87C4-16AF50908560/src/image_generation.py", line 67, in make_request
response = openai.Image.create(prompt=prompt, n=1, size=f"{size}x{size}")
AttributeError: module 'openai' has no attribute 'Image'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/.../Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8D40654A-A2DC-483E-87C4-16AF50908560/src/image_generation.py", line 85, in <module>
__response = make_request(get_query(), __size)
File "/.../Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8D40654A-A2DC-483E-87C4-16AF50908560/src/image_generation.py", line 75, in make_request
error_message=exception._message, # type: ignore # pylint: disable=protected-access
AttributeError: 'AttributeError' object has no attribute '_message'
[09:14:43.348] ChatFred[Run Script] Processing complete
[09:14:43.350] ChatFred[Run Script] Passing output '' to Conditional
[09:14:43.351] ChatFred[Conditional] Processing complete
[09:14:43.352] ChatFred[Conditional] Passing output '' to Large Type
from chatfred.
Maybe you can provide information like:
- Python version
- Alfred version
- MacOS version
Does "fresh install" means you removed the old workflow version before you installed the new one?
from chatfred.
Wow nice! I hope it works now for you?!
from chatfred.
Great! You are welcome! Enjoy using it. And please feel free to suggest any new features you would like to have or report any bug you encounter!
from chatfred.
Related Issues (20)
- Azure OpenAI API support? HOT 1
- Ollama support
- Notifications "You exceeded your current quota, please check your plan and billing details." instead of proper responds. HOT 3
- Gallery version is outdated HOT 1
- Do you have any plan to support DALL-E 3? HOT 3
- Constant error message: hmm something is wrong with your request, try again later... HOT 14
- Instruct GPT Models Deprecated HOT 7
- Autocomplete for aliases HOT 1
- Add support for images using GPT4-vision
- support custom model
- No response, just large 💬 emoji HOT 8
- how to chat to the previous gpt reply? HOT 2
- Token overuse HOT 3
- Order when using the Universal action & combined prompts
- Use Chatfred with LocalAI server? HOT 3
- Cannot Set the history_length to 0 Despite Being Provided HOT 7
- ChatGPT Aliases Should Search for Keyword Within the Prompt, Instead of the Other Way Around HOT 1
- Ability to edit system prompt HOT 4
- Is anyone experiencing problems with inputs being cutoff? HOT 3
- Streaming the Reply to Save Time HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatfred.