RemainSoftware / AiChat

Issue tracker for the Remain Ai Chat Client
4 stars 0 forks source link

Error parsing: Server returned HTTP response code: 400 #14

Open ibmiiste opened 1 year ago

ibmiiste commented 1 year ago

Hi, When I tried your plugin, I got this message: Error parsing: Server returned HTTP response code: 400 for URL: https://api.openai.com/v1/chat/completions

Why? Regards, Olivier.

wimjongman commented 1 year ago

Did you set the API key in the settings?

wimjongman commented 1 year ago

See documentation: https://github.com/RemainSoftware/AiChat

ibmiiste commented 1 year ago

Hi, Yes I read the manual and set the API key and Organization token. And I also paid for ChatGPT. And when I press Enter, I just go next line. And as you can see, I have 0 token. image

Regards, Olivier.

ibmiiste commented 1 year ago

I continue to test and sometimes it answers:

Vous êtes un développeur expérimenté de RPG IV et vous écrivez votre code en RPG Free

Error parsing: Server returned HTTP response code: 400 for URL: https://api.openai.com/v1/chat/completions

Vous êtes un développeur expérimenté de RPG IV et vous écrivez votre code en RPG Free

Error parsing: Server returned HTTP response code: 400 for URL: https://api.openai.com/v1/chat/completions

Vous êtes un développeur expérimenté de RPG IV et vous écrivez votre code en RPG Free

Error parsing: Server returned HTTP response code: 400 for URL: https://api.openai.com/v1/chat/completions

CREATE OR REPLACE TABLE

To create or replace a table in SQL, you can use the following syntax:

CREATE OR REPLACE TABLE table_name (
   column1 datatype constraint,
   column2 datatype constraint,
   ...
);

Here's an example of creating a table called "employees" with columns for ID, name, and age:

CREATE OR REPLACE TABLE employees (
   id INT PRIMARY KEY,
   name VARCHAR(50) NOT NULL,
   age INT
);

Note that the exact syntax may vary depending on the SQL database management system you are using.

Vous êtes un développeur expérimenté de RPG IV et vous écrivez votre code en RPG Free

Error parsing: Server returned HTTP response code: 400 for URL: https://api.openai.com/v1/chat/completions

   Dcl-proc aleatoire export;
     Dcl-pi aleatoire packed(15:0);
        mult packed(15:0) const;
     End-Pi;

     Dcl-pr CEERAN0;
       seed int(10);
       ranno float(8);
       fc char(12) options(*omit);
     end-pr;

     Dcl-s seed int(10) inz(0);
     Dcl-s rand Float(8);
     Dcl-s result packed(15:0);

     CEERAN0( seed : rand : *omit );
     result = %inth(rand * mult);
     // "result" now contains a number between 1 and mult.
     return result;
   End-proc;          

Que fait cette sous-procédure?

Error parsing: Server returned HTTP response code: 400 for URL: https://api.openai.com/v1/chat/completions

   Dcl-proc aleatoire export;
     Dcl-pi aleatoire packed(15:0);
        mult packed(15:0) const;
     End-Pi;

     Dcl-pr CEERAN0;
       seed int(10);
       ranno float(8);
       fc char(12) options(*omit);
     end-pr;

     Dcl-s seed int(10) inz(0);
     Dcl-s rand Float(8);
     Dcl-s result packed(15:0);

     CEERAN0( seed : rand : *omit );
     result = %inth(rand * mult);
     // "result" now contains a number between 1 and mult.
     return result;
   End-proc;     

Que fait cette sous-procédure?

Error parsing: Server returned HTTP response code: 400 for URL: https://api.openai.com/v1/chat/completions

  Dcl-proc aleatoire export;
     Dcl-pi aleatoire packed(15:0);
        mult packed(15:0) const;
     End-Pi;

     Dcl-pr CEERAN0;
       seed int(10);
       ranno float(8);
       fc char(12) options(*omit);
     end-pr;

     Dcl-s seed int(10) inz(0);
     Dcl-s rand Float(8);
     Dcl-s result packed(15:0);

     CEERAN0( seed : rand : *omit );
     result = %inth(rand * mult);
     // "result" now contains a number between 1 and mult.
     return result;
   End-proc;     

Que fait cette sous-procédure?

Error parsing: Server returned HTTP response code: 400 for URL: https://api.openai.com/v1/chat/completions

CREATE OR REPLACE TABLE

CREATE OR REPLACE TABLE is a statement used in SQL to create a new table or replace an existing table with a new definition.

Here is the syntax for creating or replacing a table:

CREATE OR REPLACE TABLE table_name (
   column1 datatype1 constraint,
   column2 datatype2 constraint,
   ...
   columnN datatypeN constraint
);

The table_name is the name of the table you want to create or replace. The column1, column2, ..., columnN are the names of the columns in the table, and datatype1, datatype2, ..., datatypeN are the data types of the respective columns. You can also specify constraints for the columns if needed.

If the table with the specified name already exists, the CREATE OR REPLACE TABLE statement will drop the existing table and create a new one with the specified definition.

Note that not all database management systems support the CREATE OR REPLACE TABLE syntax. In some systems, you may need to use different statements or a combination of statements to achieve the same result.

CODE_AGENCE_EXPLOITATION FOR COLUMN CAGEXP NUMERIC(2, 0) NOT NULL DEFAULT 0

CREATE OR REPLACE TABLE TABLE_NAME ( COLUMN_NAME DATA_TYPE CONSTRAINTS );

Regards,

wimjongman commented 1 year ago

Hey Olivier, that is strange. So sometimes it answers, and sometimes it does not.

Can you please save the conversation and attach it here? I can then import it and replay it.

Please also take a screenshot of your configuration screen.

ibmiiste commented 1 year ago

Hi,

Here you go.

Voustes_un_d_veloppeur_exp_rimentde_RPG_IV_et_vouscrivez_votre_code_en_RPG_FreeWed_Sep_20_13_50_02_CEST_2023.txt

image

Regards,

wimjongman commented 1 year ago

Thanks. You can put that message "Vous êtes un développeur expérimenté de RPG IV et vous écrivez votre code en RPG Free" in the "System Message" box in the configuration. That is what is used for.

I do not see any strange things in your conversation.

Maybe you can try to generate a new API key in your paid plan.

wimjongman commented 1 year ago

Here are some hints to try. Could it be the special accent characters you use in the request? I tried this myself but it answers correctly.

https://community.openai.com/t/error-retrieving-completions-400-bad-request/34004/3

Hello! How can I assist you today?
Vous êtes un développeur expérimenté de RPG IV et vous écrivez votre code en RPG Free
En tant que développeur expérimenté de RPG IV, je préfère écrire mon code en RPG Free. RPG Free est une version plus récente de RPG IV qui permet une syntaxe plus moderne et flexible, ce qui facilite le développement et la maintenance du code.

L'une des principales différences entre RPG IV traditionnel et RPG Free est l'utilisation de spécifications fixes. Dans RPG Free, les spécifications fixes sont remplacées par des directives à base de mots-clés, ce qui permet une meilleure lisibilité du code.

Par exemple, voici comment nous pouvons déclarer une variable en RPG Free :

Dcl-S MonVariable Int(10);

Dans cet exemple, nous déclarons une variable MonVariable de type entier et de longueur 10.

La syntaxe RPG Free offre également des fonctionnalités avancées telles que les structures de contrôle améliorées, les instructions SQL intégrées et les opérations de chaîne de caractères améliorées.

Voici un exemple d'une boucle FOR en RPG Free :

For I = 1 to 10;
    // Instructions
EndFor;

Dans cet exemple, nous utilisons la boucle FOR pour itérer de 1 à 10 et exécuter les instructions à l'intérieur de la boucle.

En utilisant RPG Free, je peux développer des applications RPG IV plus efficacement en tirant parti des fonctionnalités avancées et de la syntaxe plus moderne. Cela me permet de créer du code plus propre, plus lisible et plus maintenable.
wimjongman commented 1 year ago

Are you up to date?

image

ibmiiste commented 1 year ago

Hi, Yes I am. Regards,

wimjongman commented 11 months ago

I have found that some models return this message. Please try and select another model if you see this error.

Models that work for me are gpt-3.5-turbo-16k and gpt4

If this does not resolve it and since the underlying issue cannot be pinpointed maybe you want to try to debug the communication.

For this, go the rdi or eclipse command line and use:

 eclipsec.exe -consoleLog -vmargs -Djavax.net.debug=all

Then inspect the output of the chat.

opcoach commented 11 months ago

Hi Wim ! How are you ! ;)

Nice plugin, but like the other Olivier, I hava a problem with this message :

Error parsing: Server returned HTTP response code: 429 for URL: https://api.openai.com/v1/chat/completions

I just asked with this prompt : "generate an hello world java class"...

I join the chat generate_an_hello_world__java_classTue_Oct_17_19_59_56_CEST_2023.json

I put the required parameters, generated an api key corresponding to my company but I have also 0 token and this error above...

Is there another set up to do ?

wimjongman commented 10 months ago

I improved the logging. 1.3.1 should be available soon.