bump version to 1.8.5 in pom.xml and add request duration tracking in BaseAgent
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
||||
<artifactId>lm-lib</artifactId>
|
||||
<groupId>de.extio</groupId>
|
||||
<name>lm-lib</name>
|
||||
<version>1.8.4</version>
|
||||
<version>1.8.5</version>
|
||||
|
||||
<properties>
|
||||
<java.version>21</java.version>
|
||||
|
||||
@@ -112,6 +112,7 @@ public interface BaseAgent {
|
||||
final var responseHandler = this.responseHandler();
|
||||
final var modelProfile = this.modelProfile(split.context());
|
||||
Completion completion = null;
|
||||
final var requestStart = System.currentTimeMillis();
|
||||
if (split.context().isStreaming()) {
|
||||
if (responseHandler instanceof final StreamedAgentResponseHandler streamedResponseHandler) {
|
||||
streamedResponseHandler.beforeStream(split.context());
|
||||
@@ -138,6 +139,8 @@ public interface BaseAgent {
|
||||
completion = client.conversation(this.modelCategory(split.context()), conversation);
|
||||
}
|
||||
}
|
||||
final var durationMs = System.currentTimeMillis() - requestStart;
|
||||
split.context().getGraph().add("(" + durationMs + " ms)");
|
||||
split.context().setLastCompletion(completion);
|
||||
split.context().getRequestStatistic().add(completion);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user