-
-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Support for more complex HTTP requests in search_engines.js #73
Comments
Hey! I agree with you that lacking support for non- When a
I'd encourage you to submit a PR on the main SurfingKeys repo adding support for other HTTP verbs. I am a maintainer over there and would be happy to review your PR. P.s. if you get a ChatGPT completion working, please feel free to open a PR here! |
Thanks for the quick response! Ok, I think I can work out on a PR for SurfingKeys. Which approach do you prefer between the two alternatives (static objects modeling HTTP requests vs. callbacks that take the user query as a parameter)? |
I think I prefer the second approach, because it opens up the possibility to do other interesting things with the user’s query. For example, you could implement a simple calculator as a callback which never needs to hit the network. |
main
HEAD
Details
First of all, thanks for the amazing work you've put in this repo! It served me as a solid base to customize my SurfingKeys experience to the next level.
There's a feature I miss quite a bit though, and that's the ability to make HTTP requests other than
GET
insearch_engines.js
.I'm not sure if I missed some polymorphic logic on
completions.<search-engine>.search
andcompletions.<search-engine>.compl
, but it seems to me that it only supports string parameters (i.e. it only supportsGET
requests to the URL provided as a template).That probably works in >90% of the cases, but recently I've implemented on my fork the support for ChatGPT results, and their API only supports
POST
for the queries.My workaround has been to spin up my own little service that proxies
GET
requests toPOST
requests to the ChatGPT API, and then use that URL for the completions, but this definitely isn't scalable.I also see it as a problem if somebody wants to implement search results from (x)RPC or GraphQL APIs, since those are likely to take
POST
/PUT
requests.I may work on a PR for it if there's enough interest. I have two possible approaches in mind:
compl
andsearch
can be either strings or objects containing the static configuration of an HTTP request to be passed to e.g. axios. Example:compl
andsearch
can be callbacks. Example:The text was updated successfully, but these errors were encountered: