quarkiverse / quarkus-langchain4j

Quarkus Langchain4j extension
https://docs.quarkiverse.io/quarkus-langchain4j/dev/index.html
Apache License 2.0
121 stars 66 forks source link

Add integration module with quarkus-websockets-next #487

Closed geoand closed 2 months ago

geoand commented 3 months ago

This module allows for automatic use of memoryId when no object is specified

TODO: add tests, fix for native image and add documentation

jmartisk commented 2 months ago

Are you also going to update the samples that use websockets?

geoand commented 2 months ago

I will after this, yes

jmartisk commented 2 months ago

Hm, one inconvenience that I now noticed is that by making the AI service session-scoped, I can no longer call it from a REST endpoint. I don't quite understand why we need to make it session-scoped? Isn't the service in itself stateless and only controlled by what the memory contains?

geoand commented 2 months ago

I don't quite understand why we need to make it session-scoped?

By making it @SessionsScoped we are able to automatically remove all memory when the websocket session closes.

Isn't the service in itself stateless and only controlled by what the memory contains?

It is, but it integrates with memory and can thus be used for automatic memory management.

I can no longer call it from a REST endpoint

I suggest using different AI services.