-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2525 from Tharsanan1/ai-analytics
Add AI Analytics
- Loading branch information
Showing
7 changed files
with
348 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
...mons/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/AIMetadata.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
package org.wso2.apk.enforcer.commons.analytics.publishers.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* AI metadata in analytics event. | ||
*/ | ||
public class AIMetadata { | ||
@JsonProperty("model") | ||
private String model; | ||
|
||
@JsonProperty("vendor_name") | ||
private String vendorName; | ||
|
||
@JsonProperty("vendor_version") | ||
private String vendorVersion; | ||
|
||
public String getModel() { | ||
|
||
return model; | ||
} | ||
|
||
public void setModel(String model) { | ||
|
||
this.model = model; | ||
} | ||
|
||
public String getVendorName() { | ||
|
||
return vendorName; | ||
} | ||
|
||
public void setVendorName(String vendorName) { | ||
|
||
this.vendorName = vendorName; | ||
} | ||
|
||
public String getVendorVersion() { | ||
|
||
return vendorVersion; | ||
} | ||
|
||
public void setVendorVersion(String vendorVersion) { | ||
|
||
this.vendorVersion = vendorVersion; | ||
} | ||
} |
77 changes: 77 additions & 0 deletions
77
...ns/src/main/java/org/wso2/apk/enforcer/commons/analytics/publishers/dto/AITokenUsage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
package org.wso2.apk.enforcer.commons.analytics.publishers.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* AI token usage in analytics event. | ||
*/ | ||
public class AITokenUsage { | ||
@JsonProperty("totalTokens") | ||
private Double totalTokens; | ||
|
||
@JsonProperty("promptTokens") | ||
private Double promptTokens; | ||
|
||
@JsonProperty("completionTokens") | ||
private Double completionTokens; | ||
|
||
@JsonProperty("hour") | ||
private Integer hour; | ||
|
||
public Double getTotalTokens() { | ||
|
||
return totalTokens; | ||
} | ||
|
||
public Integer getHour() { | ||
|
||
return hour; | ||
} | ||
|
||
public void setHour(Integer hour) { | ||
|
||
this.hour = hour; | ||
} | ||
|
||
public void setTotalTokens(Double totalTokens) { | ||
|
||
this.totalTokens = totalTokens; | ||
} | ||
|
||
public Double getPromptTokens() { | ||
|
||
return promptTokens; | ||
} | ||
|
||
public void setPromptTokens(Double promptTokens) { | ||
|
||
this.promptTokens = promptTokens; | ||
} | ||
|
||
public Double getCompletionTokens() { | ||
|
||
return completionTokens; | ||
} | ||
|
||
public void setCompletionTokens(Double completionTokens) { | ||
|
||
this.completionTokens = completionTokens; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.