0

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

null
    • Tomasz_Winiarski
    • 5 mths ago
    • Reported - view

    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 :(

    • szormpas
    • 5 mths ago
    • Reported - view

    Hi, it sounds interesting to connect Ninox with chatGPT!

    Take a look at this post: Connecting to external REST API (complete example)

    • Tomasz_Winiarski
    • 5 mths ago
    • Reported - view

    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)

      • szormpas
      • 5 mths ago
      • Reported - view

       

      So, you have successfully connected to chatGPT on the web app but you are unable to do this on Mac app, is it the case?

      I am not using the Mac app, I don’t known whether it connects to external APIs.

      Can anyone clarify this?

      • Fred
      • 5 mths ago
      • Reported - view

      that is pretty cool.

      According to Ninox, the MacApp can not do any API work. That is why it is free.

    • szormpas
    • 5 mths ago
    • Reported - view

    If sharing your code with us is convenient, we would appreciate it!

    • Tomasz_Winiarski
    • 5 mths ago
    • Reported - view

    I made a new topic with script :) thanks for all responses here!

Content aside

  • Status Answered
  • 5 mths agoLast active
  • 7Replies
  • 149Views
  • 3 Following