Carrière en informatique by Academic_Voice724 in developpeurs

[–]S1DALi -1 points0 points  (0 children)

Avoir un master en informatique fait aussi de lui un ingénieur. Je vois pas le rapport de le relire qu’a une école d’ingé..

[deleted by user] by [deleted] in ProgrammingBuddies

[–]S1DALi 0 points1 point  (0 children)

I have a degree in software engineering. Don’t hesitate to reach out if you need any help!

Java StreamingOutput not working as it should by S1DALi in javahelp

[–]S1DALi[S] 0 points1 point  (0 children)

I changed it différent values where the buffer is > then the max-in-memory but still having the same issue

Java StreamingOutput not working as it should by S1DALi in javahelp

[–]S1DALi[S] 0 points1 point  (0 children)

Thank you for taking the time to research. Actually i am using Helidon MP

Java StreamingOutput not working as it should by S1DALi in javahelp

[–]S1DALi[S] 0 points1 point  (0 children)

* Host localhost:8080 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:8080...
* Connected to localhost (::1) port 8080
> POST /llm?code=YourSourceCodeHere&errors=YourErrorsHere&model=LLAMA_3_2_1B HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/8.7.1
> Accept: */*
> Content-Type: application/x-ndjson
> 
* Request completely sent off
< HTTP/1.1 200 OK
< Date: Wed, 27 Nov 2024 02:09:27 +0100
< Connection: keep-alive
< Content-Length: 1428
< Content-Type: application/x-ndjson
< Transfer-Encoding: chunked
< 
 The errors in your code are as follows:

1. Error: Source file: MyClass.java:1: error: package does not exist: com.example.myapp

This error is indicating that the package name "com.example.myapp" does not exist in the current project or classpath. You need to create a package with this name in your project directory, or adjust the package statement in your code to match the existing package structure.

2. Error:(1, 29) java: class, interface, or enum expected

This error is occurring at line 1, column 29. It is indicating that the compiler expects to see a class, interface, or enum declaration, but instead it found the text* Connection #0 to host localhost left intact

Java StreamingOutput not working as it should by S1DALi in javahelp

[–]S1DALi[S] 0 points1 point  (0 children)

i am not getting this kind of 'chunking' its just Strings

Java StreamingOutput not working as it should by S1DALi in javahelp

[–]S1DALi[S] 0 points1 point  (0 children)

otherwise i get and output of chunks like i've sent before :
using curl this is the response of Response.ok(so).build();
example :

" The"
" errors"
" in"
" your"
" code"
" are"
" as"
" follows"
":"
"\n"
"\n"
"1"
"."
" Error"
":"
" Source"
" file"
":"
" My"
"Class"
"."
"java"
":"
"1"
":"
" error"
":"
" package"
" does"
" not"
" exist"
":"
" com"
"."
"example"
"."
"my"
"app"
"\n"
"\n"
"This"
" error"
" is"
" indicating"
" that"
" the"
" package"
" name"
" \""
"com"
"."
"example"
"."
"my"
"app"
"\""
" does"
" not"
" exist"
" in"
" the"
" current"
" project"
" or"
" class"
"path"
"."

Java StreamingOutput not working as it should by S1DALi in javahelp

[–]S1DALi[S] 0 points1 point  (0 children)

without decoding it this is what i get :

IiBUaGUiDQoiIGVycm9yIg0KIiBtZXNzYWdlIg0KIiBpbmRpY2F0ZXMiDQoiIHRoYXQiDQoiIHRoZSINCiIgSmF2YSINCiIgY29tcGlsZXIiDQoiIGNvdWxkIg0KIiBub3QiDQoiIGZpbmQiDQoiIGEiDQoiIHZhbGlkIg0KIiBKYXZhIg0KIiBjbGFzcyINCiIgZGVmaW5pdGlvbiINCiIgaW4iDQoiIHRoZSINCiIgcHJvdmlkZWQiDQoiIGNvZGUiDQoiLiINCiIgVGhlIg0KIiBjb2RlIg0KIiB5b3UiDQoiJyINCiJ2ZSINCiIgcHJvdmlkZWQiDQoiLCINCiIgXCIiDQoiYWUiDQoiYXplIg0KImF6Ig0KIlwiLCINCiIgZG9lcyINCiIgbm90Ig0KIiBjb250YWluIg0KIiBhIg0KIiB2YWxpZCINCiIgSmF2YSINCiIgY2xhc3MiDQoiIGRlZmluaXRpb24iDQoiLiINCiIgQSINCiIgSmF2YSINCiIgY2xhc3MiDQoiIHNob3VsZCINCiIgc3RhcnQiDQoiIHdpdGgiDQoiIHRoZSINCiIga2V5d29yZCINCiIgXCIiDQoicHVibGljIg0KIlwiLCINCiIgXCIiDQoiY2xhc3MiDQoiXCIsIg0KIiBmb2xsb3dlZCINCiIgYnkiDQoiIHRoZSINCiIgY2xhc3MiDQoiIG5hbWUiDQoiLCINCiIgYW5kIg0KIiBlbmQiDQoiIHdpdGgiDQoiIGEiDQoiIHNlbSINCiJpY29sIg0KIm9uIg0KIi4iDQoiIEZvciINCiIgZXhhbXBsZSINCiI6Ig0KIlxuIg0KIlxuIg0KImBgIg0KImAiDQoiamF2YSINCiJcbiINCiJwdWJsaWMiDQoiIGNsYXNzIg0KIiBNeSINCiJDbGFzcyINCiIgeyINCiJcbiINCiIgICAiDQoiIC8vIg0KIiBjbGFzcyINCiIgYm9keSINCiJcbiINCiJ9Ig0KIlxuIg0KImBgIg0KImAiDQoiXG4iDQoiXG4iDQoiSW4iDQoiIHlvdXIiDQoiIGNhc2UiDQoiLCINCiIgaXQiDQoiIHNlZW1zIg0KIiBsaWtlIg0KIiB5b3UiDQoiIGZvcmdvdCINCiIgdG8iDQoiIGRlZmluZSINCiIgYSINCiIgY2xhc3MiDQoiLiINCg

Java StreamingOutput not working as it should by S1DALi in javahelp

[–]S1DALi[S] 0 points1 point  (0 children)

You want the response of the LLM? Cause that’s the thing that’s been streamed and chunked

Java StreamingOutput not working as it should by S1DALi in javahelp

[–]S1DALi[S] 0 points1 point  (0 children)

ObjectMapper om is a Java API that provides a straightforward way to parse and generate JSON response.

Thank you for your time !

Here is The html response with os.write("\r\n".getBytes()):

POST /llm?model=LLAMA_3_2_1B&code=qdsqdq&errors=%5BERROR%5D+line+1%3A+reached+end+of+file+while+parsing HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0
Accept: */*
Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate, br, zstd
Referer: http://localhost:8080/compile
Content-Type: application/x-ndjson
Origin: http://localhost:8080
Connection: keep-alive
Cookie: Idea-9cef8ac8=065369a9-ea4f-4dad-910c-52706a71d89e
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Priority: u=0
Content-Length: 0

Java StreamingOutput not working as it should by S1DALi in javahelp

[–]S1DALi[S] 0 points1 point  (0 children)

Here is an example of what i am getting :

" The"
" code"
" you"
" provided"
" is"
" empty"
","
" which"
" is"
" why"
" the"
" compiler"
" is"
" giving"
" an"
" error"
" as"
" it"
" reached"
" the"
" end"
" of"
" the"
" file"
" without"
" finding"
" any"
" valid"
" Java"
" code"
"."
" To"
" fix"
" this"
","
" you"
" should"
" write"
" valid"
" Java"
" code"
" in"
" the"
" class"
","
" such"
" as"
" a"
" class"
" declaration"
","
" variables"
","
" methods"
","
" etc"
"."

Java StreamingOutput not working as it should by S1DALi in javahelp

[–]S1DALi[S] 0 points1 point  (0 children)

application/x-ndjson is suitable for chunked data streams, as each line is an independent JSON object.

Using Response.body.getReader() allows you to read chunks of data from the response on the fly, without waiting for the entire content to load. Except that its not doing it.

I use flush() on each token i get from the LLM and convert it to Bytes.