How to run chatgpt or Claude…
Hi
is it possible? I’m not a programmer. I understand ninox script, I can write some simple things but still: it’s far from REAL PROGRAMMING :))
I want to achieve simple things, I have text field with my notes and button with script which is sending notes to OpenAI API with prompt (nothing fancy: clear gramma), result lands in second text field.
I try this: xxxxxxxxxx but it looks like solid outdated, bad url, different parameters format.
Second: I build ;))) something like this, still no success at all.
let promptToComplete := Notes;
let url := "https://api.openai.com/v1/chat/completions";
let maxTokens := 1024;
let apiKey := "sk-proj-xxxxxxxxxxxxxxxxx";
let requestBody := "{
"model": "gpt-3.5-turbo",
"messages": [{
"role": "system",
"content": "You are a helpful assistant."
}]
}";
let response := do as server
http("POST", url, {
'Content-Type': "application/json",
Authorization: "Bearer " + apiKey
}, requestBody)
end;
let responseText := first(response.result.choices);
let responseTextWithWhitespaceRemoved := replacex(text(responseText.text), "^\s+", "");
Ready := text(responseTextWithWhitespaceRemoved)
At the end: I simply took from documentation example how to use http post, fill with proper url and api key and stil nothing.
Is there any way to implement OpenAI in my Ninox app? Maybe this above is totally stupid, don’t know… Maybe there is another way… don’t know…
Any help?
Warm regards from Poland
7 replies
-
I forget to change xxxxxxxxxxxxxx for proper address. Here is: https://www.linkedin.com/pulse/tutorial-automate-business-email-responses-ninox-openai-treppmann/
This is some tutorial made by Tobias Treppmann. But as I said: this one is very outdated :( -
Hi, it sounds interesting to connect Ninox with chatGPT!
Take a look at this post: Connecting to external REST API (complete example)
-
Yes! I figure-out this... I have working ChatGPT in Ninox app.
But... Yes there is a huge BUT.I can't connect to API from standalone app - for me is a crucial, because I have made a beautiful app for managing patients for my beautiful wife, and this database should be stored only local.
So now, the question is: how to connect to OpenAI API (or any?!) from standalone app???
(today I'm tired :) I will post script with explanation how to connect with chatgpt or Claude in one or two days)
-
If sharing your code with us is convenient, we would appreciate it!
-
I made a new topic with script :) thanks for all responses here!
Content aside
- Status Answered
- 5 mths agoLast active
- 7Replies
- 149Views
-
3
Following