Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI Mentor memory integration #220

Draft
wants to merge 17 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"generate:api:application-server": "npm run generate:api:application-server:specs && npm run generate:api:application-server:clean && npm run generate:api:application-server:client",
"generate:api:intelligence-service:clean": "shx rm -rf server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceservice",
"generate:api:intelligence-service:specs": "python -m server.intelligence-service.app.generate_openapi_yaml",
"generate:api:intelligence-service:client": "npx openapi-generator-cli generate -i server/intelligence-service/openapi.yaml -g java --library resttemplate --api-package de.tum.in.www1.hephaestus.intelligenceservice.api --model-package de.tum.in.www1.hephaestus.intelligenceservice.model --invoker-package de.tum.in.www1.hephaestus.intelligenceservice --model-name-prefix IS --additional-properties useJakartaEe=true,performBeanValidation=true,hideGenerationTimestamp=true --package-name de.tum.in.www1.hephaestus.intelligenceservice -o tmp/java-client && shx cp -r tmp/java-client/src/main/java/de/tum/in/www1/hephaestus/intelligenceservice server/application-server/src/main/java/de/tum/in/www1/hephaestus && shx rm -rf tmp",
"generate:api:intelligence-service:client": "npx openapi-generator-cli generate -i server/intelligence-service/openapi.yaml -g java --library resttemplate --api-package de.tum.in.www1.hephaestus.intelligenceservice.api --model-package de.tum.in.www1.hephaestus.intelligenceservice.model --invoker-package de.tum.in.www1.hephaestus.intelligenceservice --additional-properties useJakartaEe=true,performBeanValidation=true,hideGenerationTimestamp=true --package-name de.tum.in.www1.hephaestus.intelligenceservice -o tmp/java-client && shx cp -r tmp/java-client/src/main/java/de/tum/in/www1/hephaestus/intelligenceservice server/application-server/src/main/java/de/tum/in/www1/hephaestus && shx rm -rf tmp",
"generate:api:intelligence-service": "npm run generate:api:intelligence-service:clean && npm run generate:api:intelligence-service:specs && npm run generate:api:intelligence-service:client",
"generate:api": "npm run generate:api:intelligence-service && npm run generate:api:application-server",
"format:java:check": "prettier --check server/application-server/src/**/*.java --config-precedence prefer-file --config server/application-server/.prettierrc.yaml --ignore-path server/application-server/.prettierignore",
Expand Down
3 changes: 3 additions & 0 deletions server/application-server/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@ components:
required:
- createdAt
- id
- isClosed
type: object
properties:
id:
Expand All @@ -797,3 +798,5 @@ components:
createdAt:
type: string
format: date-time
isClosed:
type: boolean
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import de.tum.in.www1.hephaestus.intelligenceservice.ApiClient;
import de.tum.in.www1.hephaestus.intelligenceservice.BaseApi;

import de.tum.in.www1.hephaestus.intelligenceservice.model.ISHealthCheck;
import de.tum.in.www1.hephaestus.intelligenceservice.model.HealthCheck;

import java.util.Collections;
import java.util.HashMap;
Expand Down Expand Up @@ -41,21 +41,21 @@ public HealthcheckApi(ApiClient apiClient) {
* Perform a Health Check
* ## Perform a Health Check Endpoint to perform a healthcheck on. This endpoint can primarily be used Docker to ensure a robust container orchestration and management is in place. Other services which rely on proper functioning of the API service will not deploy if this endpoint returns any other HTTP status code except 200 (OK). Returns: HealthCheck: Returns a JSON response with the health status
* <p><b>200</b> - Return HTTP Status Code 200 (OK)
* @return ISHealthCheck
* @return HealthCheck
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public ISHealthCheck getHealthHealthGet() throws RestClientException {
public HealthCheck getHealthHealthGet() throws RestClientException {
return getHealthHealthGetWithHttpInfo().getBody();
}

/**
* Perform a Health Check
* ## Perform a Health Check Endpoint to perform a healthcheck on. This endpoint can primarily be used Docker to ensure a robust container orchestration and management is in place. Other services which rely on proper functioning of the API service will not deploy if this endpoint returns any other HTTP status code except 200 (OK). Returns: HealthCheck: Returns a JSON response with the health status
* <p><b>200</b> - Return HTTP Status Code 200 (OK)
* @return ResponseEntity&lt;ISHealthCheck&gt;
* @return ResponseEntity&lt;HealthCheck&gt;
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public ResponseEntity<ISHealthCheck> getHealthHealthGetWithHttpInfo() throws RestClientException {
public ResponseEntity<HealthCheck> getHealthHealthGetWithHttpInfo() throws RestClientException {
Object localVarPostBody = null;


Expand All @@ -73,7 +73,7 @@ public ResponseEntity<ISHealthCheck> getHealthHealthGetWithHttpInfo() throws Res

String[] localVarAuthNames = new String[] { };

ParameterizedTypeReference<ISHealthCheck> localReturnType = new ParameterizedTypeReference<ISHealthCheck>() {};
ParameterizedTypeReference<HealthCheck> localReturnType = new ParameterizedTypeReference<HealthCheck>() {};
return apiClient.invokeAPI("/health", HttpMethod.GET, Collections.<String, Object>emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import de.tum.in.www1.hephaestus.intelligenceservice.ApiClient;
import de.tum.in.www1.hephaestus.intelligenceservice.BaseApi;

import de.tum.in.www1.hephaestus.intelligenceservice.model.ISHTTPValidationError;
import de.tum.in.www1.hephaestus.intelligenceservice.model.ISMentorMessage;
import de.tum.in.www1.hephaestus.intelligenceservice.model.ISMessageHistory;
import de.tum.in.www1.hephaestus.intelligenceservice.model.HTTPValidationError;
import de.tum.in.www1.hephaestus.intelligenceservice.model.MentorRequest;
import de.tum.in.www1.hephaestus.intelligenceservice.model.MentorResponce;
import de.tum.in.www1.hephaestus.intelligenceservice.model.MentorStartRequest;

import java.util.Collections;
import java.util.HashMap;
Expand Down Expand Up @@ -40,33 +41,33 @@ public MentorApi(ApiClient apiClient) {
}

/**
* Start and continue a chat session with an LLM.
* Continue a chat session with an LLM.
*
* <p><b>200</b> - Successful Response
* <p><b>422</b> - Validation Error
* @param isMessageHistory (required)
* @return ISMentorMessage
* @param mentorRequest (required)
* @return MentorResponce
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public ISMentorMessage generateMentorPost(ISMessageHistory isMessageHistory) throws RestClientException {
return generateMentorPostWithHttpInfo(isMessageHistory).getBody();
public MentorResponce generateMentorPost(MentorRequest mentorRequest) throws RestClientException {
return generateMentorPostWithHttpInfo(mentorRequest).getBody();
}

/**
* Start and continue a chat session with an LLM.
* Continue a chat session with an LLM.
*
* <p><b>200</b> - Successful Response
* <p><b>422</b> - Validation Error
* @param isMessageHistory (required)
* @return ResponseEntity&lt;ISMentorMessage&gt;
* @param mentorRequest (required)
* @return ResponseEntity&lt;MentorResponce&gt;
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public ResponseEntity<ISMentorMessage> generateMentorPostWithHttpInfo(ISMessageHistory isMessageHistory) throws RestClientException {
Object localVarPostBody = isMessageHistory;
public ResponseEntity<MentorResponce> generateMentorPostWithHttpInfo(MentorRequest mentorRequest) throws RestClientException {
Object localVarPostBody = mentorRequest;

// verify the required parameter 'isMessageHistory' is set
if (isMessageHistory == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'isMessageHistory' when calling generateMentorPost");
// verify the required parameter 'mentorRequest' is set
if (mentorRequest == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'mentorRequest' when calling generateMentorPost");
}


Expand All @@ -86,9 +87,59 @@ public ResponseEntity<ISMentorMessage> generateMentorPostWithHttpInfo(ISMessageH

String[] localVarAuthNames = new String[] { };

ParameterizedTypeReference<ISMentorMessage> localReturnType = new ParameterizedTypeReference<ISMentorMessage>() {};
ParameterizedTypeReference<MentorResponce> localReturnType = new ParameterizedTypeReference<MentorResponce>() {};
return apiClient.invokeAPI("/mentor/", HttpMethod.POST, Collections.<String, Object>emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
}
/**
* Start a chat session with an LLM.
*
* <p><b>200</b> - Successful Response
* <p><b>422</b> - Validation Error
* @param mentorStartRequest (required)
* @return MentorResponce
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public MentorResponce startMentorStartPost(MentorStartRequest mentorStartRequest) throws RestClientException {
return startMentorStartPostWithHttpInfo(mentorStartRequest).getBody();
}

/**
* Start a chat session with an LLM.
*
* <p><b>200</b> - Successful Response
* <p><b>422</b> - Validation Error
* @param mentorStartRequest (required)
* @return ResponseEntity&lt;MentorResponce&gt;
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public ResponseEntity<MentorResponce> startMentorStartPostWithHttpInfo(MentorStartRequest mentorStartRequest) throws RestClientException {
Object localVarPostBody = mentorStartRequest;

// verify the required parameter 'mentorStartRequest' is set
if (mentorStartRequest == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'mentorStartRequest' when calling startMentorStartPost");
}


final MultiValueMap<String, String> localVarQueryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders localVarHeaderParams = new HttpHeaders();
final MultiValueMap<String, String> localVarCookieParams = new LinkedMultiValueMap<String, String>();
final MultiValueMap<String, Object> localVarFormParams = new LinkedMultiValueMap<String, Object>();

final String[] localVarAccepts = {
"application/json"
};
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

String[] localVarAuthNames = new String[] { };

ParameterizedTypeReference<MentorResponce> localReturnType = new ParameterizedTypeReference<MentorResponce>() {};
return apiClient.invokeAPI("/mentor/start", HttpMethod.POST, Collections.<String, Object>emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
}

@Override
public <T> ResponseEntity<T> invokeAPI(String url, HttpMethod method, Object request, ParameterizedTypeReference<T> returnType) throws RestClientException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import de.tum.in.www1.hephaestus.intelligenceservice.model.ISValidationError;
import de.tum.in.www1.hephaestus.intelligenceservice.model.ValidationError;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
Expand All @@ -29,27 +29,26 @@
import org.hibernate.validator.constraints.*;

/**
* ISHTTPValidationError
* HTTPValidationError
*/
@JsonPropertyOrder({
ISHTTPValidationError.JSON_PROPERTY_DETAIL
HTTPValidationError.JSON_PROPERTY_DETAIL
})
@JsonTypeName("HTTPValidationError")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0")
public class ISHTTPValidationError {
public class HTTPValidationError {
public static final String JSON_PROPERTY_DETAIL = "detail";
private List<ISValidationError> detail = new ArrayList<>();
private List<ValidationError> detail = new ArrayList<>();

public ISHTTPValidationError() {
public HTTPValidationError() {
}

public ISHTTPValidationError detail(List<ISValidationError> detail) {
public HTTPValidationError detail(List<ValidationError> detail) {

this.detail = detail;
return this;
}

public ISHTTPValidationError addDetailItem(ISValidationError detailItem) {
public HTTPValidationError addDetailItem(ValidationError detailItem) {
if (this.detail == null) {
this.detail = new ArrayList<>();
}
Expand All @@ -65,14 +64,14 @@ public ISHTTPValidationError addDetailItem(ISValidationError detailItem) {
@JsonProperty(JSON_PROPERTY_DETAIL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public List<ISValidationError> getDetail() {
public List<ValidationError> getDetail() {
return detail;
}


@JsonProperty(JSON_PROPERTY_DETAIL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setDetail(List<ISValidationError> detail) {
public void setDetail(List<ValidationError> detail) {
this.detail = detail;
}

Expand All @@ -84,7 +83,7 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
ISHTTPValidationError htTPValidationError = (ISHTTPValidationError) o;
HTTPValidationError htTPValidationError = (HTTPValidationError) o;
return Objects.equals(this.detail, htTPValidationError.detail);
}

Expand All @@ -96,7 +95,7 @@ public int hashCode() {
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ISHTTPValidationError {\n");
sb.append("class HTTPValidationError {\n");
sb.append(" detail: ").append(toIndentedString(detail)).append("\n");
sb.append("}");
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,17 @@
* Response model to validate and return when performing a health check.
*/
@JsonPropertyOrder({
ISHealthCheck.JSON_PROPERTY_STATUS
HealthCheck.JSON_PROPERTY_STATUS
})
@JsonTypeName("HealthCheck")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0")
public class ISHealthCheck {
public class HealthCheck {
public static final String JSON_PROPERTY_STATUS = "status";
private String status = "OK";

public ISHealthCheck() {
public HealthCheck() {
}

public ISHealthCheck status(String status) {
public HealthCheck status(String status) {

this.status = status;
return this;
Expand Down Expand Up @@ -72,7 +71,7 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
ISHealthCheck healthCheck = (ISHealthCheck) o;
HealthCheck healthCheck = (HealthCheck) o;
return Objects.equals(this.status, healthCheck.status);
}

Expand All @@ -84,7 +83,7 @@ public int hashCode() {
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ISHealthCheck {\n");
sb.append("class HealthCheck {\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append("}");
return sb.toString();
Expand Down
Loading
Loading