spring-ai
spring-ai copied to clipboard
UTF-8 issue on ChatClientTitan
trafficstars
Hi, it seems that response of chatClientTitan is not in UTF-8:
Can you make a local change in AbstractBedrockApi and see if it solves your problem.
from
try {
logger.debug("Received chunk: " + chunk.bytes().asString(StandardCharsets.UTF_8));
SO response = this.objectMapper.readValue(chunk.bytes().asByteArray(), clazz);
this.eventSink.tryEmitNext(response);
}
to
try {
logger.debug("Received chunk: " + chunk.bytes().asString(StandardCharsets.UTF_8));
SO response = this.objectMapper.readValue(chunk.bytes().asString(StandardCharsets.UTF_8), clazz);
this.eventSink.tryEmitNext(response);
}
Same issue, I also tried with chunk.bytes().asUtf8String() The issue is only with "stream" method, with "call" it works. I'll try to do some test to understand if it's an issue on awssdk side. You can try with something like this: "Chi è Bill Gates?".