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>
|
<artifactId>lm-lib</artifactId>
|
||||||
<groupId>de.extio</groupId>
|
<groupId>de.extio</groupId>
|
||||||
<name>lm-lib</name>
|
<name>lm-lib</name>
|
||||||
<version>1.8.4</version>
|
<version>1.8.5</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>21</java.version>
|
<java.version>21</java.version>
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ public interface BaseAgent {
|
|||||||
final var responseHandler = this.responseHandler();
|
final var responseHandler = this.responseHandler();
|
||||||
final var modelProfile = this.modelProfile(split.context());
|
final var modelProfile = this.modelProfile(split.context());
|
||||||
Completion completion = null;
|
Completion completion = null;
|
||||||
|
final var requestStart = System.currentTimeMillis();
|
||||||
if (split.context().isStreaming()) {
|
if (split.context().isStreaming()) {
|
||||||
if (responseHandler instanceof final StreamedAgentResponseHandler streamedResponseHandler) {
|
if (responseHandler instanceof final StreamedAgentResponseHandler streamedResponseHandler) {
|
||||||
streamedResponseHandler.beforeStream(split.context());
|
streamedResponseHandler.beforeStream(split.context());
|
||||||
@@ -138,6 +139,8 @@ public interface BaseAgent {
|
|||||||
completion = client.conversation(this.modelCategory(split.context()), conversation);
|
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().setLastCompletion(completion);
|
||||||
split.context().getRequestStatistic().add(completion);
|
split.context().getRequestStatistic().add(completion);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user