Jump to content

iandol

Member
  • Posts

    148
  • Joined

  • Last visited

  • Days Won

    7

iandol last won the day on October 8 2023

iandol had the most liked content!

Recent Profile Visitors

1,720 profile views

iandol's Achievements

Member

Member (4/5)

35

Reputation

  1. Well poe.com has a web search bot for AI: https://poe.com/Web-Search ...but I don't imagine it supports a simple GET style request[1]... Remember they want to monetise / control access for this which is why you are stuck with a bunch of APIs rather than an open HTTPs interface... This depends on the websites and what they are willing to offer ---- [1] you could use proxyman to work out what the traffic to that is, when I use it I get a uuid or encoded unique URL back but what the traffic is I didn't test.
  2. Why not use the Web Search feature of Alfred? https://www.alfredapp.com/help/features/web-search/ Which sites support a web search interface for gemini etc. though?
  3. I'll have a look. The OpenAI API is pretty simple to be honest, taking their simple guide: https://platform.openai.com/docs/guides/text-generation/chat-completions-api curl https://api.openai.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -d '{ "model": "gpt-3.5-turbo", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": "Hello!" } ] }' We have: API address, API key, the model name & the messages as the core components. Messages are obvious, but the address, key and model name are essential and also required for online alternatives like openrouter.ai and local tools like LM Studio. The hard coded model names for OpenAI do not work for any other alternative, so a way to override it is needed. These are definitely "if there was only one more version, what should be included" options... I think having the standard drop-down for models hard coded is great for beginners (your UI is clean and simple), and the env variable as a text field is perfect for more advanced use. There are a bunch of other parameters for fine tuning the model response: temperature, max_tokens, n, top_p etc. β€” of these I think none are really essential, though if I was forced to pick I'd have temperature (guiding the fidelity vs. creativity of the model responses) and max_tokens (as at least local models have specific token count limits): https://platform.openai.com/docs/api-reference/chat/create These options are certainly very specialist. I agree that stream=off is not worth supporting, as it adds substantial backend complexity for you with minimal gain (while I love GPT4All, I just won't use it with Alfred, and LM Studio, Ollama and others can take its place...)
  4. Feature Request: you have added the custom API address, which is great. There are services like openrouter which support OpenAI API, with many other models too: https://openrouter.ai/docs#principles β€” I think Poe is another example. To get these to work you must specify the model (i.e. "openai/gpt-3.5-turbo"). At the moment you hard-code the model values so this will fail. If you allow more flexible model input then servies like openrouter could also be used by this workflow. The simplest is to use an env var to override the model if set (assume this is advanced user only). Otherwise a text entry option in the workflow UI?
  5. Well, your experience tells us there is a problem. Again, there is not one API method, there are several endpoints each with different requirements and functions. At a minimum there are two endpoints (/v1/completions & /v1/chat/completions) and there is a streaming and non-streaming mode. I have said that for local use, two different apps that both "support" OpenAI API, only one works, and the other doesn't (because it needs stream=false). Just because a service says X it does not specify X.y or X.z β€” what API mode does ChatFred use, is it the same? My point is to help you determine what the problem is, without knowing the problem you have no hope of finding the solution...
  6. But does their API support streaming mode or not? I suspect even with streaming if their API is slow then this will cause connection stalled errors (there is a timeout in the code, if you tweak it perhaps you can recover the error)? I know there are some services that bypass the country limitations (I am in China, so must go through a VPN for example), and this can add latency to the connection also...
  7. What third-party tool are you testing? It needs to support stream=true to work... I see the same connection stalled error with GPT4All (https://gpt4all.io/index.html), which uses a non-streaming OpenAI API, but LMStudio (https://lmstudio.ai) which supports streaming does work...
  8. It seems the script got stuck at line 200 https://github.com/alfredapp/openai-workflow/blob/main/Workflow/chatgpt#L200 and kept returning the first error from the stream.txt so I didn't see any change editing the code. πŸ€ͺ I deleted the files in the workflow data folder and it seems to be working now, though sometimes the model response is slow (when it first loads into memory), and there is a stream error. Anyway I can confirm LM Studio + Hermes 7B model works well with your modified script with the caveat that you must NOT append a / to the endpoint, and I don't know why once it errors it cannot recover without manually deleting the files (possibly βŒ˜β†΅ would have done this, I didn't try it?). GPT4All fails to work, as it doesn't use a streaming API (stream=false). Non-streaming mode is easier to work with (blocking response is trivial to handle), but your code is optimised for streaming...
  9. To answer my own question (after trying to do this in VSCode, so many JS tools its hard to find what you want...) Open Safari, enable developer tools then enable this option: Now in your JXA script type in debugger; where you want, e.g. Now use Alfred as you normally would and when Alfred runs the script, the remote javascript debugger will pop up. Cool!
  10. I usually learn best when I can get code into a debugger and breakpoint my way through the code. I do this with Ruby and Lua plugins by using remote debugging. The docs for Ruby are here: https://github.com/ruby/debug#remote-debugging and the Lua tool here: https://github.com/pkulchenko/MobDebug β€” remote debugging allows you to "hook in" to any code run by a different app (i.e. Alfred could run ruby without any explicit debug command in place, but with a breakpoint command a remote debugger could hook in to that script). It seems Javascript (JXA) is a useful language for macOS automation. I see @vitor for example uses it for his great ChatGPT workflow. So my question is: is there a remote debugging interface that would enable me to run an Alfred workflow, and breakpoint a Javascript script and inspect it as it runs?
  11. Thanks so much, I think this setting is a nice compromise (env variables are hidden away for miost users). I am having problems with the setting though: {"error":"Unexpected endpoint or method. (POST //v1/chat/completions)"} The variable seems to be being sent if I add a debug node: [13:33:35.534] ChatGPT / DALL-E[Debug] 'what is the elvish scripting language?', { chatgpt_api_endpoint = "http://localhost:4891" chatgpt_keyword = "chatgpt" dalle_image_number = "1" dalle_images_folder = "/Users/ian/Desktop/DALL-E" dalle_keyword = "dalle" dalle_model = "dall-e-2" dalle_quality = "standard" dalle_style = "vivid" dalle_write_metadata = "1" gpt_model = "gpt-4" init_question = "what is the elvish scripting language?" openai_api_key = "sk-xxxxxxxxxxx" system_prompt = "" } The problem is the `//` I get the same error if I use curl directly: β–ΆοΈŽ curl -s -X POST http://localhost:4891//v1/chat/completions {"error":"Unexpected endpoint or method. (POST //v1/chat/completions)"}⏎ There is no `/` at the end of my variable, not sure where the extra `/` is coming from?
  12. Right, I did the same. Vitor's workflow can work for local use with a simple change. I use both GPT4All and LMStudio and as both support the same API they can be swapped out without any changes other than API base URI. But Vitor wants to focus on OpenAI services only, so we either need to make local changes to his workflow, or someone can release a fork of his workflow to add local use?
  13. Moderator’s note: The ChatGPT / DALL-E workflow offers the ability to change the API end point in the Workflow Environment Variables, enabling the possibility of using local models. This is complex and requires advanced configuration, not something we can officially provide support for. This thread was split from the main one so members of the community can help each other setting up their own specific models. Thanks vitor! There are many open source models with performance equivalent to GPT3.5 or better, without the privacy concerns, dependency on an internet connection for each question, or costs. And there are a number of macOS apps that manage them. This unlocks the power of LLMs for everyone. The good news is that most of these tools offer a local API server that is compatible with the OpenAI API. Therefore all one needs to do is change the URI and you can switch from the commercial OpenAI service to a privacy-respecting, open source, and free alternative: https://github.com/nomic-ai/gpt4all β€” more basic UI, model selected using model key of API https://lmstudio.ai β€” more advanced UI, uses UI selected model for API requests. Checking the code, the JS can be tweaked to make the URI redirect to localhost: http://localhost:4891/v1/chat/completions β€” for GPT4All, the model file needs to be specified but for LMStudio the model is chosen in the UI and that is what the API serves. So a feature request is the option to specify the API address so this workflow can run locally if LMStudio or GPT4All (or several others) are installed. Dall-E is a harder deal, as while there are open source models like stable diffusion (and amazing macOS apps like Draw things to use them), i don't know of a tool that offers an API that would be hot-swappable for the OpenAI commercial APIs...
  14. Awesome and congratulations! Woah, the changelog is epic!!!! Downloading now!
  15. It is the new year for sure, both on solar and lunar calanders β€” @Vero any updates? I would also like to mention GPT4All β€” a local-only tool that enables multiple model workflows without internet, with an API and can explore local docs: https://gpt4all.io/index.html β€” it would be great if ChatFred or its sequel could access this too!
×
×
  • Create New...