Jump to content

_oho

Member
  • Posts

    30
  • Joined

  • Last visited

Contact Methods

  • Twitter
    _oho

Profile Information

  • Location
    Paris

_oho's Achievements

Member

Member (4/5)

1

Reputation

  1. Ok, think I found it (may be ? At least I get it to work). Had activated logs (cool feature) and seen error is coming from `chatgpt` script. Editing this script I can't see the use of `chatgpt_api_endpoint` variable. In stead `dalle_api_enpoint` only is used (may be for ChatGPT and DALLE ?). const apiEndpoint = envVar("dalle_api_endpoint") || "https://api.openai.com As anyway I have no paid credit for Dalle, so I have overrided `dalle_api_endpoint`in Environement Variable. And it seems to work. Thank you for your quick answer yesterday and thank you for you enormous / genius Workflow that I love. Actually make me remind how great is Alfred... Can't wait for your new version that will fix allow easy integration off other models (like Ollama). Was wondering, do you think there is a way to get code synthaxic coloration in ChatGPT workflow answer ? O.
  2. Thank you Vitor for removing my post. I realized it was not appropriate as it was a real salvage dirty hack :). To be honest I haven't played with Alfred workflows for around 10 years. Just using it (every day) without modifications. I have to admit that it have improved so much (congrats to the team by the way). I have tried your preview but can't make it work :(. I have only change in environment variable : `chatgpt_api_endpoint` (don't know what entry is expected on `chatgpt_model_override` as changing this does not seems to help). Changed also `gpt_model` in Configuration Builder to add my own local currently used models. Than could change my chosen model in `Configure Workflow`. Buty whatever I do, I keep having API key error, meaning it's not using my local endpoint Any idea ? Hope this is not a very dump thing I'm doing wrong (I'm sure seeing how dirty I can hack, you would not be surprised ). O.
  3. Actually, you can use Ollama (https://github.com/ollama/ollama) to serve locally any available open source models (including gemma from Google, llama2 from Meta, or Mistral from the French startup, but many others ...). Ollama is compatible with OpenAI API so I just hacked a bit the current workflow by changing `chatgpt_api_enpoint` to `http://localhost:11434` + changing model name and label in `userconfigurationconfig` And to my great surprise it works ... Of course, I believe your mac should be robust enough. Forget to mention I have a M3 Max with 48 Go of RAM. But I'm pretty sure it's reasonably work on a M1 with 8 Mo of RAM. On my M3 answer is very fast. It would be good to have an update of the workflow that would add the option (+ howto) to use Ollama... _oho.
  4. )) Ok, crossing my hands on my back, looking at the ground and blushing ... I have to admit that it was the fastest route based on what google gave me first. I'm a poor marketing guy ;( Your rock, it's even better! In particularly because I needed to get rid of standard output that prevented generating feedback on Alfred ... I then could easily add stdout= on the subprocess.call: FNULL = open(os.devnull, 'w') retcode = subprocess.call(['sips', '-s', 'format', 'png', 'out.jpg', '--out', 'out.png'], stdout=FNULL, stderr=subprocess.STDOUT) I was fighting using my command line to find a way with os.system to get rid of it, but to be honest it was a nightmare . Not even sure I could have succeed ... Thanx again. I love Alfred and Alfred community ... _oho
  5. Thanks guys for putting me on the right track (and pushing me not to be too lazy). There is indeed a way to manage it from command line without having to setup painful image management lib dependencies (like PIL in python - for instance). I have just verified that the following command line from python does the trick (convert a base64 bit encoded jpeg data text to a local png file): os.system("echo " + data + " | perl -MMIME::Base64 -ne 'print decode_base64($_)' > out.jpeg && sips -s format png out.jpeg --out out.png") supposing that you have: import os and data is something like: data = b'''/9j/4AAQSkZJRgABAQAAAQABAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcg SlBFRyB2NjIpLCBxdWFsaXR5ID0gNzUK/9sAQwAIBgYHBgUIBwcHCQkICgwUDQwLCwwZEhMPFB0a Hx4dGhwcICQuJyAiLCMcHCg3KSwwMTQ0NB8nOT04MjwuMzQy/9sAQwEJCQkMCwwYDQ0YMiEcITIy MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy/8AAEQgAeABk AwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMF ... Vo1IOPeiin1EDDc5x24rT0uUJMschwrHg+hoorGezNINpqx1SOxijUMxAOHJwM8nH6VqRQRMSQoV cD60UVmjtjsJf3aWFo8q8ADgY6n0rgb65mvbh5pmLMepJoorSOxz1pMqxtty2BhefrVOe+luMj7i nsKKKt7HOQBBjpRRRUAf/9k=''' Without doing it from Python, it would be from simple command line something like: perl -MMIME::Base64 -ne 'print decode_base64($_)' < base64dataJPEG.txt > image.jpeg && sips -s format png image.jpeg --out image.png _oho
  6. Hum..., cool I didn't know sips at all! And it look really handful and simple as from command line. Thank for the tip. This said, in my very particular case, the original image is a 64bits encoded jpeg data text. Quickly looking at sips, I don't see any way to use as input a base64 image. Can we ? Could it be that I have missed something ? O.
  7. Thank! I'll have a look, it's still possible that I did something too complicated, but I couldn't find on Python an easy way to convert base64 jpeg to png file. For info only (might be useful for others) I did something like : def Base64ToPng(base64DataTxt,filename,destination_path): import base64 import re from PIL import Image from io import BytesIO base64JustDataTxt = re.sub(r'data\:image\/jpeg;base64, ', "", base64DataTxt) #logging.error('base64JustDataTxt:\n' + base64JustDataTxt) im = Image.open(BytesIO(base64.b64decode(base64JustDataTxt))) im.save(destination_path + '/' + filename + '.png', 'PNG') return destination_path + '/' + filename + '.png' Then I needed here PIL in particular (that was not that easy to install). I'm currently porting my backend process to local python process within Alfred. Almost done ... Once done, I'll double check to see if I can make it without extra dependencies ... O.
  8. Thank you for your note RodgerWW. Yes, I believe I will not have much other choices than do the conversion locally. Actually I wanted to avoid too much dependencies from local side and provide from backend all the content needed to display my result from the workflow without need of some kind of local processing. I have just did convert from backend side my base64 jpeg image to a base64 png image hoping that Alfred would accept a base64 image if it were png. I believe there are no other options to provide with a local png as file only (in top of application icon option) - right ? I will then now work on do the conversion locally from Alfred Workflow. Unfortunately I don't think I will succeed in doing this without need of dependencies like libjpeg, libpng and other Python stuff like PIL/Pillow or some kind of PHP ImageMagic ... ;( _oho
  9. Hello, I can't find in the forum anything similar to my bellow question, so I hope this is not a yet again asked question ... I was trying to set 64bit encoded data image at the place of an image name in Workflow result display, but this does not work. Is there a was to do it or it's just not possible at all yet ? Example: <items> <item uid="123456" arg="http://google.com" valid="YES"> <title>My row title</title> <subtitle>some kind of subtitle</subtitle> <icon type="filetype"> data:image/jpeg;base64, /9j/4AAQSkZJRgABAQAAAQABAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcg SlBFRyB2NjIpLCBxdWFsaXR5ID0gNzUK/9sAQwAIBgYHBgUIBwcHCQkICgwUDQwLCwwZEhMPFB0a Hx4dGhwcICQuJyAiLCMcHCg3KSwwMTQ0NB8nOT04MjwuMzQy/9sAQwEJCQkMCwwYDQ0YMiEcITIy MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy/8AAEQgAeABk AwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMF ... Vo1IOPeiin1EDDc5x24rT0uUJMschwrHg+hoorGezNINpqx1SOxijUMxAOHJwM8nH6VqRQRMSQoV cD60UVmjtjsJf3aWFo8q8ADgY6n0rgb65mvbh5pmLMepJoorSOxz1pMqxtty2BhefrVOe+luMj7i nsKKKt7HOQBBjpRRRUAf/9k= </icon> </item> </items> If this is not possible, does someone see a possible workaround if my image sources are 64encoded data ? Olivier.
  10. "contact list result" is the keyword used to call newt script filter that just do in bash: cat << INFO `more /tmp/ldap-result.xml` INFO Meaning that your /tmp/ldap-result.xml should not exist or be not well formed. Try to see if you have a /tmp/ldap-result.xml. Also, my parsing is expected a specific type of info from your ldapsearch result. if the result is different, it will not work. O.
  11. Hello Chris, I don't know if you have already solved your problem? Sorry for late reply, I'm on vacation and as commonly stated, "with limited email access" Looking at the python script, what you probably want to set first is your ldap host. So first line to change is line 4: LDAP_HOST="". In my cas it's something like LDAP_HOST="ldap://myCompanyInterlaHost.internalDomain" Next step is to find out the options (in red) to set in line 24. ldap_result=Popen(["ldapsearch", "-S", "displayName", "-x", "-b", "dc=localInfoToChange,dc=fr", "-H", LDAP_HOST, "-LLL", "(displayName="+KEYWORD+"*)", "telephoneNumber", "mail", "uid", "displayName], stdout=PIPE, stderr=devnull).communicate()[0] Note: blue strings are the fields I'm querying at while running ldapsearch command. Finally, I'm doing some parsing of returned text from ldapsearch command. In my case, I'm looking to extract "telephoneNumber", "displayName", "uid", and "mail". In a loop while I find results I write to a file the content, correctly formatted for Alfted listing info. Sorry, as I'm not at the office, I cannot show what looks like the result of ldapsearch. What I would suggest is to start by identifying your ldap server url then play around with ldapsearch command line from within terminal and see if you can get some results based on your search. The rest will be playing with parsing your own results. Good luck. O.
  12. Hello, very nice workflow. I found issues while using it (did not work at first place). After investigation I found that: 1) I did not set first the option to "Enable access for assistive devices and applications" (see: http://support.apple.com/kb/HT6026). Without this, the workflow does not work. 2) my language is in French and it did not work unless I set "deviceselected" as «class utf8» as follow: set deviceselected to the value of text field 1 of row i of table 1 of scroll area 1 of tab group 1 of window 1 as «class utf8» Indeed, my headphone is named: "écouteur" ... I wanted to do a pull request, but it's looks like the GitHub code is not updated. is it ? Otherwise, any idea why when my headphone is plugged I don't see in the list of output my local speaker (named Haut-parleurs internes in French)? I would love to be able to switch between local speakers and headphone without need to unplug my local headphone. That would be my main usage after send it through AirPlay ... And it's the all point of the workflow ... Olivier.
  13. [version 1.1 on GitHub does fix a regression that prevented multiple image selection] Hello, I have a Macbook pro retina. And every time I need to share a screenshot with friends or co-workers, I have to resize them as this screenshots will just be too big to be shared on their original size. Then I wrote this quick and dirty workflow that does resize you images selection while choosing your preferred percentage. Personally I usually use 40% ... When I say quick and dirty, it's because I use a build-in automator function that does just that for me. But I had to create as many "application" than percentage ratio proposed. And each .app are 1,7 Mo (that's the dirty part ;( ). So the all workflow is around 17 Mo to download! Usage: Select your image(s) from desktop or finder, type "resize" + TAB then select your preferred ratio and hit "ENTER" If you want to keep a copy of the resized image, press "CTRL" before "ENTER" Download: get it from GitHub Dependencies: None O.
  14. Hello Segphaul, this look really cool. unfortunately, I can't make it to work Do I need some python library install to make it work ? Like installing pygments? Am I the only one for whom this does not work out of the box ? O.
  15. Hello, Here is a yet another "System file show/hide toggle". Sorry for spamming, I should have search before, as wile writing this note, I see this have been done already here. You can still download it from GitHub. O.
×
×
  • Create New...