Jump to content

OpenAI ChatGPT Workflow


c0desurfer

Recommended Posts

Just type your query after the 'ai' keyword and the result will be pasted into your active application.

Go to https://beta.openai.com/account/api-keys to get your OpenAI API key and configure the workflow first.

 

image.thumb.png.20a08e7762c70cb8a6e617c282af1e84.png

 

Get the workflow at https://github.com/c0desurfer/alfred-openai-chatgpt.

Edited by c0desurfer
new screenshot
Link to comment
Share on other sites

It's not working for me. I type "ai" + prompt (same as image) and I see "This will be the query for OpenAI", but when I press enter nothing happens, alfred's prompt box just disappears.

image.png.955285d2c34516a2ef90e169ac5cf1ea.png

^ says to install openai Python module but I have no idea how to do that, I've just setup the API key. 

 

 

Link to comment
Share on other sites

On 12/22/2022 at 4:02 PM, c0desurfer said:

Yes, currently the script assumes you are using pyenv to manage python versions and the openai module is installed via pip in the "default" instance.

 

That is a huge assumption and dependency, the workflow cannot be added to the Gallery in that state because it cannot be expected most people will have that set up. Plus, the Python command setting (to set python or python3) won’t be clear for most people and it defaults to the least common option.


Can you use /usr/bin/python3 and bundle the python package inside the workflow? That would work out of the box and it’s how the majority of Python workflows work.

 

Edited by vitor
Link to comment
Share on other sites

21 hours ago, vitor said:

Can you use /usr/bin/python3 and bundle the python package inside the workflow? That would work out of the box and it’s how the majority of Python workflows work.

 

I didn't know that was possible, this is my first workflow. Any docs on that?

Link to comment
Share on other sites

Didn't work for me.

 

Needs to be more intelligent or verbose about errors if Python isn't set up correctly.

 

[12:23:40.354] Logging Started...
[12:23:42.544] OpenAI ChatGPT[Keyword] Processing complete
[12:23:42.547] OpenAI ChatGPT[Keyword] Passing output 'what is love?' to Run Script
[12:23:42.835] ERROR: OpenAI ChatGPT[Run Script] pyenv: no such command `virtualenv-init'
pyenv: no such command `activate'
dyld[57018]: Library not loaded: '/opt/homebrew/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/Python'
  Referenced from: '/usr/local/bin/python'
  Reason: tried: '/opt/homebrew/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/Python' (no such file), '/Library/Frameworks/Python.framework/Versions/3.9/Python' (no such file), '/System/Library/Frameworks/Python.framework/Versions/3.9/Python' (no such file)
[12:23:42.840] OpenAI ChatGPT[Run Script] Processing complete
[12:23:42.840] OpenAI ChatGPT[Run Script] Passing output '' to Copy to Clipboard

 

Edited by gingerbeardman
Link to comment
Share on other sites

  • 4 months later...

@c0desurfer Looking at the GitHub page it seems you haven’t been active there in general, which is OK, but without the changes this can’t go in the Gallery as most users won’t be able to set it up. I’ll move this to completed to help clean up this forum section which allows me to better parse the remainder, but that’s not a permanent outcome, you can always comment back in the future if there’s been progress and I’ll take another look. And, naturally, this has no bearing on your sharing of the workflow anywhere, it’s perfectly fine to have something which fits mostly your needs, a major power of Alfred is precisely that you can create things to work exactly as you want them to.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...