Jump to content

ChatGPT / DALL-E - OpenAI integrations


Recommended Posts

Posted
1 hour ago, sorgel said:

So, basically I'm not sure why we need to duplicate the whole workflow for every new command. Looks like we can stick with editing the original workflow.


You don’t need to duplicate the whole workflow, nor should you edit the original. You should instead make another small workflow with just what you need calling this one. This is explained in the FAQ, under How can I reuse pre-made prompts?

Posted
4 minutes ago, vitor said:


You don’t need to duplicate the whole workflow, nor should you edit the original. You should instead make another small workflow with just what you need calling this one. This is explained in the FAQ, under How can I reuse pre-made prompts?

Ah, I see now, sorry, I've misunderstood the original instruction.

Posted
On 6/20/2024 at 12:11 PM, lone said:

I made a test example where I try to scroll, and it constantly rolls down

 

 

This behavior is hard-coded in the extension. I'm not sure why @Vero supposed it could be changed with Automation Tasks update.


But we can change it by editing the file chatgpt in the workflow folder. There are several lines behavior: { scroll: 'end' } for different cases.  I don't see the documentation for this thing. But at least changing it to behavior: { scroll: 'start' } will stop infinite scrolling.


What is interesting now is how to hide the first message from the Text view. Personally, I prefer not to see the full prompt, in my case it can be really long.

Posted (edited)
5 minutes ago, vitor said:

You can click the (?) in any object to go to its documentation.


Thanks! Yes, I tried '?" but then i had to find a link to the json description on that page, and that's where I've failed. So `auto` could fit this task more than `start`. 

Edited by sorgel
grammar fix
Posted (edited)
51 minutes ago, sorgel said:

What is interesting now is how to hide the first message from the Text view. Personally, I prefer not to see the full prompt, in my case it can be really long

So the simplest and a bit dirty way to do it is to use  the `replace` in this block

  if (streamMarker)
    return JSON.stringify({
      rerun: 0.1,
      variables: { streaming_now: true },
      response: '…',
      behaviour: { response: 'replace' },
    });


While it ruins the approach where you try to use this workflow for continuous discussion, it makes workflow more usable for one-time prompts

Edited by sorgel
Posted
23 hours ago, sorgel said:

So the simplest and a bit dirty way to do it is to use  the `replace` in this block

  if (streamMarker)
    return JSON.stringify({
      rerun: 0.1,
      variables: { streaming_now: true },
      response: '…',
      behaviour: { response: 'replace' },
    });


While it ruins the approach where you try to use this workflow for continuous discussion, it makes workflow more usable for one-time prompts

I tried all possible options, with any replace behavior it scrolls.

Posted

Hi, I just installed the ChatGPT / DALL-E workflow, but I am getting an error when trying to prompt ChatGPT.  Error below. Prompting DALL-E works well.

 

[21:32:15.199] ChatGPT / DALL-E[Keyword] Processing complete

[21:32:15.207] ChatGPT / DALL-E[Keyword] Passing output '' to Arg and Vars

[21:32:15.209] ChatGPT / DALL-E[Arg and Vars] Processing complete

[21:32:15.210] ChatGPT / DALL-E[Arg and Vars] Passing output '' to Run Script

[21:32:15.283] ChatGPT / DALL-E[Run Script] Processing complete

[21:32:15.290] ChatGPT / DALL-E[Run Script] Passing output '' to Automation Task

[21:32:15.291] ERROR: ChatGPT / DALL-E[Automation Task] Task not found 'com.alfredapp.automation.core/files-and-folders/path.exists'

 

Workflow version: 2024.11

Alfred version: 5.5 [2257]

Mac OS version: Sonoma 14.5

 

I will appreciate help to torubleshoot the problem.

Posted

I feel like I am missing something basic. I would to have text selected in, say, an email I am writing and then hit a keyboard shortcut and be able to use that in a chatgpt session. For example, select text in email program, hit hotkey, type "make this sound more formal" hit return and have alfred replace the text with the response...

When I select the AskChatGPT universal action, it sends the text directly to ChatGPT, which I don't find helpful.

Posted
34 minutes ago, Chatbot said:

Is there a way that I can config openai api base in this tool?

 

That is covered at the top of FAQ (second post in this thread).

Posted

Welcome @Steev28,

 

I can see the sense in altering the message before sending specifically when using a Universal Action where the text you want to use may not have the proper context. I’m experimenting with it and this version does it. It won’t auto-paste the result, as that’s a bit outside the scope of the workflow but on the result you can ⌥↩ to copy it to the clipboard.

 

This is a first draft and may change or be reverted before release.

Posted

Seeing an issue in the debugger when I try and use this workflow:
 

Code 1: /Users/robdeskoski/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8DF3C6CF-EE0A-4AFC-8C1D-2E383942484A/chatgpt: execution error: Error: SyntaxError: JSON Parse error: Expected ']' (-2700)

 

API Key seems fine, typing in as per the examples.

Posted

@ged12345 When reporting issues, please include your exact installed versions of:

  • The Workflow.
  • Alfred.
  • macOS.

In addition to:

  • The debugger output. Perform the failing action, click “Copy” on the top right and paste it here.
  • Details on what you did, what happened, and what you expected to happen. A short video of the steps with the debugger open may help to find the problem faster.

These requirements are listed in the FAQ (second post on the thread).

Posted

Updated to 2024.12.

  • Allow to further refine question when sending via Universal Action.
  • Remove steps to move from cache to data.
  • Update JSON parsing of chunks.
  • Remove extraneous space.

Posted (edited)

Is it possible to integrate SOCKS proxy in the workflow? ChatGPT doesn't work in my country and I need to use VPN. But it's a shame to turn on VPN every time when I want to use the workflow.

Edited by sosaveme
  • 4 weeks later...
Posted (edited)

Hi @vitor

 

Thank you for the great workflow! Everything is functioning well, except I can’t seem to access the Chat History feature. When I hit ⌥⏎, the previous chats aren’t appearing.

 

Workflow: v2024.14

Alfred: 5.5

macOS: 12.7.6

 

The debugger output:

 

[20:22:58.284] ChatGPT / DALL-E[Hotkey] Processing complete

[20:22:58.287] ChatGPT / DALL-E[Hotkey] Passing output '' to Keyword

[20:22:58.343] ChatGPT / DALL-E[Keyword] Processing complete

[20:22:58.345] ChatGPT / DALL-E[Keyword] Passing output '' to Script Filter

[20:22:58.349] ChatGPT / DALL-E[Script Filter] Queuing argument '(null)'

[20:22:58.454] ChatGPT / DALL-E[Script Filter] Script with argv '(null)' finished

[20:22:58.454] ERROR: ChatGPT / DALL-E[Script Filter] Code 1: /Users/mac/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/84C7C5CE-C9B2-4A1D-95A8-3DC1ADFBAB6C: execution error: Error: TypeError: dirContents(archiveDir)

    .filter(file => file.endsWith(".json"))

    .toReversed is not a function. (In 'dirContents(archiveDir)

    .filter(file => file.endsWith(".json"))

    .toReversed()', 'dirContents(archiveDir)

    .filter(file => file.endsWith(".json"))

    .toReversed' is undefined) (-2700)

 

I’d be really grateful if you could help me figure this out! If you need any additional details, please just let me know.

Edited by amirk
Posted

Welcome @amirk,

 

There’s no Hotkey in the workflow, so whatever you have has been modified. Revert it to its proper state by installing from the Alfred Gallery. There’s something funky going on for sure, since it’s not even looking for histories in the proper folder.

 

If you want to call the workflow with something it doesn’t have, don’t modify it as you’ll lose the modifications when there is an update. Refer to “How can I reuse pre-made prompts?” in the FAQ for the proper methodology. In your case it’s even simpler: just connect a Hotkey Trigger to a Call External Trigger Output set to open continue_chat from this workflow.

Posted (edited)

@vitor Thank you for the reply!

 

Yes, I've modified the workflow by just adding a hotkey instead of using keyword. Now I have a separate workflow set up to initiate the process. Thanks for the advice!

 

As you have suggested, I deleted the workflow and downloaded it from the gallery. But unfortunately the issue still remains.

 

The debugger output:

 

[11:56:48.089] ChatGPT / DALL-E[Keyword] Processing complete

[11:56:48.090] ChatGPT / DALL-E[Keyword] Passing output '' to Script Filter

[11:56:48.103] ChatGPT / DALL-E[Script Filter] Queuing argument '(null)'

[11:56:48.208] ChatGPT / DALL-E[Script Filter] Script with argv '(null)' finished

[11:56:48.209] ERROR: ChatGPT / DALL-E[Script Filter] Code 1: /Users/mac/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/28C4750C-CF7A-4B95-A7D8-9DFC7E8D28BA: execution error: Error: TypeError: dirContents(archiveDir)

    .filter(file => file.endsWith(".json"))

    .toReversed is not a function. (In 'dirContents(archiveDir)

    .filter(file => file.endsWith(".json"))

    .toReversed()', 'dirContents(archiveDir)

    .filter(file => file.endsWith(".json"))

    .toReversed' is undefined) (-2700)

 

Edited by amirk
Posted

Ah, yeah, I see the issue. It’s because you’re using an older version of macOS which doesn’t support a feature.


This version should get you sorted. That link is temporary, so if you’re not going to upgrade macOS anytime soon, keep it so you can revert to it if you need.

Posted

Awesome! It works now. Thanks so much for the support!

 

Just one more question, can I update the workflow through the Alfred Gallery in the future or do I have to keep using this version?

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...