GPT 3.5 from OpenAI and neoGPT plugin. - Page 2 - Forum

Forum Navigation
You need to log in to create posts and topics.

GPT 3.5 from OpenAI and neoGPT plugin.

PreviousPage 2 of 2
Quote from tonyspacex on June 14, 2023, 10:37 pm
Quote from emo on June 14, 2023, 4:37 pm

Gracias @luishp funciona perfecto generando primero el AES con neoCryptoEncrypt de la api y utilizando neoCryptoDecrypt después en la aplicación.
Para mi ésta solución es perfectamente válida ya que no necesito servidor php y proporciona seguridad a la apikey.

Thanks @luishp it works perfect generating first the AES with neoCryptoEncrypt from the api and then using neoCryptoDecrypt in the application.
For me this solution is perfectly valid since I don't need a php server and provides security to the apikey.

¿La contraseña para desencriptar la API no queda facilmente localizable y visible dentro de la aplicacion?
Is the password to decrypt the API not easily locatable and visible within the application?

Este es un tema realmente interesante @luishp . La idea de añadir al archivo php las funciones para la api de chatgpt, creo que es realmente buena, y seguramente sea la manera mas segura de trabajar con la api. Como sugerencia, se podría dejar el plugin tal como está para quien no necesite esta función y añadir comandos extra para la conexión del plugin con  el archivo php.

This is a really interesting topic @luishp . The idea of adding to the php file the functions for the chatgpt api, I think is really good, and surely the safest way to work with the api. As a suggestion, you could leave the plugin as it is for those who don't need this function and add extra commands for the plugin connection with the php file.

luishp has reacted to this post.
luishp

@emmanuel-fernandez @tonyspacex @ivanes82 if we use neoCryptoEncrypt and a password to encrypt / decrypt that is necessary for the app user to enter before start using it, we decrease the possibilities to get the original API Key. Anyway this method is obviously not bullet proof.
Regarding neoPhp I think there's no point in creating a function for every possible API out there, but a proxy function to call any generic API would make sense, just as neoAjax plugin does from the client side but on the server, with the possibility to store API keys in config.php file within an Array and using name aliases for each one.

What do you think?

Darbdenral has reacted to this post.
Darbdenral

@luishp , la idea de una función genérica para guardar las apis en el config me parece bien y segura, aunque también estoy con @ivanes82 de preservar la opción actual. Personalmente utilizo muchas app embebidas en un webview sin la necesidad de un servidor php.

The idea of a generic function to save the apis in the config seems good and safe to me, although I am also with @ivanes82 to preserve the current option. I personally use many apps embedded in a webview without the need for a php server.

Me gustaría consultar si alguien sabe cómo hacer para que las respuestas que recibes del modelo no se reciban como texto plano sin formato, sino que la respuesta se visualice con los saltos de linea y estructura correcta. He probado a solicitar al modelo que me de la respuesta en HTML o que añada etiquetas <br /> pero no sirve y la respuesta se sigue mostrando con todo el texto amontonado. Muchas gracias.

I would like to ask if anyone knows how to make the responses you receive from the model not be received as plain text without formatting, but rather the response is displayed with the correct line breaks and structure. I have tried asking the model to give me the response in HTML or to add <br /> tags but it doesn't work and the response is still displayed with all the text piled up. Thank you so much.

@tonyspacex , add the html tag <pre> before the response var and </pre> after

<pre>[respuesta]</pre>

You can define your own style in project->application propierties->styles

for example:

pre { color:white;background:black; }

luishp has reacted to this post.
luishp
Cita de emo en junio 15, 2023, 4:32 pm

@tonyspacex , agregue la etiqueta HTML <pre> antes de la respuesta var y </pre> después

 

Efectivamente al añadir la eqiqueta <pre> ya se muestra correctamente la respuesta del modelo GPT repetando los saltos de linea y la estructura. Muchas gracias, @emmanuel-Fernández

@tonyspacex En mis pruebas, a mi me sale la respuesta de chatgpt  bien sin tener que poner <pre> y con retornos...

In my tests, I get the chatgpt answer well without having to put <pre> and with line breaks

Uploaded files:
  • You need to login to have access to uploads.
Quote from emo on June 15, 2023, 7:13 pm

@tonyspacex En mis pruebas, a mi me sale la respuesta de chatgpt  bien sin tener que poner <pre> y con retornos...

In my tests, I get the chatgpt answer well without having to put <pre> and with line breaks

Efectivamente @emmanuel-fernandez, si creas un objeto area de texto para mostrar la respuesta del modelo gpt sí respeta los saltos de línea. Yo estaba utilizando contenedores y ahí es donde se perdia el formato de salto de linea de la respuesta del modelo GPT.

Indeed, if you create a textarea object to display the gpt model's response, it does respect line breaks. I was using containers and that's where the newline formatting of the GPT model response was lost.

Quote from luishp on June 14, 2023, 12:00 pm

Thanks for the plugin!
My question is related to the OpenAI API Key. If we use our own key in the app, is it secure in the compiled app, or can it be easily accessed or hacked by someone?Best regards,

@tonyspacex @emmanuel-fernandez I encrypt the API key using neoCryptoEncrypt so it's not included in the code as it's. And it's decrypted just before use.
For better security you can use a Password as the "Secret Key" for both encrypting and decrypting your API Key.

Anyway I'm currently thinking about a way to include API calls in neoPhp plugin so all the API keys are stored within config.php file (never sent to the client web browser).

Hola @luishp, gracias por la propuesta de encriptar la clave API. He utilizado el plugin neoCryptoEncryp para encriptar mi OpenAI API key, adicional he utilizado un obfuscator javascript. He subido mi app a Google Play pero lamentablemente mi clave API sigue expuesta, siendo facilmente accesible, desofuscada y desencriptada.

Hello Luis, thanks for the proposal to encrypt the API key. I have used the neoCryptoEncrypt plugin to encrypt my OpenAI API key, additionally I have used a javascript obfuscator. I have uploaded my app to Google Play but unfortunately my API key is still exposed, being easily accessible, deobfuscated and decrypted.

@tonyspacex , todo depende de dónde vayas a utilizar tu desarrollo. Si por ejemplo lo utilizas en un totem en un museo o exposición en una pantalla tactil, pues sin problema. Si como en tu caso es una app en google play, pues cualquier método que solo utilice javascript va a ser expuesto si alguien se empeña en descubrirlo.

Lo mismo pasa en otros lenguajes como python o java si no tienen un lado en el servidor

it all depends on where you are going to use your development. If, for example, you use it in a totem in a museum or an exhibition on a touch screen, well, no problem. If, as in your case, it is an app on google play, well, any method that only uses javascript will be exposed if someone insists on discovering it.

The same thing happens in other languages like python or java if they don't have a server side.

luishp has reacted to this post.
luishp
Quote from emo on June 17, 2023, 10:45 am

@tonyspacex , todo depende de dónde vayas a utilizar tu desarrollo. Si por ejemplo lo utilizas en un totem en un museo o exposición en una pantalla tactil, pues sin problema. Si como en tu caso es una app en google play, pues cualquier método que solo utilice javascript va a ser expuesto si alguien se empeña en descubrirlo.

Lo mismo pasa en otros lenguajes como python o java si no tienen un lado en el servidor

it all depends on where you are going to use your development. If, for example, you use it in a totem in a museum or an exhibition on a touch screen, well, no problem. If, as in your case, it is an app on google play, well, any method that only uses javascript will be exposed if someone insists on discovering it.

The same thing happens in other languages like python or java if they don't have a server side.

Entiendo, muchas gracias @emmanuel-fernandez

PreviousPage 2 of 2
Open chat
1
Do you need more info?
Hi, do you have any doubt?