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

Intelligence Service MVP Java Spring Boot setup #168

Merged
merged 81 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
1dcc346
Add message entity and logic
milesha Nov 18, 2024
ddcca98
Change step model
milesha Nov 18, 2024
19bcd9f
Update chat logic
milesha Nov 18, 2024
6bea3b5
Merge branch 'develop' into feature/java-chat-mvp-intelligence-service
milesha Nov 18, 2024
811800f
Fix openai generation error
milesha Nov 19, 2024
7ac6de2
Delete unused imports
milesha Nov 19, 2024
945bc30
Add chat and message
milesha Nov 19, 2024
4a5c287
Rename chat to session
milesha Nov 19, 2024
918ade5
#124 bug fix
milesha Nov 19, 2024
a7a7130
Add new specs for chat
milesha Nov 19, 2024
246bd3b
Change placement of sesion
milesha Nov 19, 2024
12acb52
Delete unused imports
milesha Nov 19, 2024
0f8f5a0
Uodate chat logic
milesha Nov 21, 2024
c9b05bc
Merge branch 'develop' into feature/java-chat-mvp-intelligence-service
milesha Nov 21, 2024
52b1b0f
Update message params
milesha Nov 21, 2024
edc4dee
Change DTO params
milesha Nov 21, 2024
3233344
Update api
milesha Nov 21, 2024
68dfb80
Change id generation
milesha Nov 21, 2024
6bf4061
Merge branch 'develop' into feature/java-chat-mvp-intelligence-service
milesha Nov 22, 2024
2bbd8c8
Change ZonedDateTime to Offset
milesha Nov 22, 2024
d956490
Change creation prop
milesha Nov 22, 2024
cb11c80
Update saving process
milesha Nov 22, 2024
042da81
Fix repository bug
milesha Nov 23, 2024
25941cb
Fix database bugs
milesha Nov 23, 2024
bcf8b0a
Fix database updates
milesha Nov 23, 2024
cece4a2
Add fastapi connection
milesha Nov 23, 2024
c504570
Update FastAPI connection
milesha Nov 24, 2024
e7a137e
Folrmating
milesha Nov 24, 2024
82d283c
Formating
milesha Nov 24, 2024
6451e5d
Merge branch 'develop' into feature/java-chat-mvp-intelligence-service
milesha Nov 24, 2024
8ad3fae
Merge branch 'develop' into feature/java-chat-mvp-intelligence-service
milesha Nov 25, 2024
f7809df
Add autowired to messageservice
milesha Nov 25, 2024
1561023
Resolve teams pr conflicts
milesha Nov 25, 2024
61e0210
Add error handling
milesha Nov 25, 2024
470755a
Improve code styling
milesha Nov 25, 2024
5372aa6
Fix coding conventions violiations
milesha Nov 25, 2024
25c63d4
SImpllify code
milesha Nov 25, 2024
de37ad9
Update content col length
milesha Nov 25, 2024
91f7040
Update prompt
milesha Nov 25, 2024
ad053a4
Update naming
milesha Nov 25, 2024
bf74fdd
Fix bug
milesha Nov 25, 2024
b63a9df
Update column type
milesha Nov 26, 2024
13b80c5
fix chat generation
milesha Nov 27, 2024
0e43a7d
change naming
milesha Nov 27, 2024
ddca852
update packages
milesha Nov 28, 2024
e468492
update mentor logic
milesha Nov 28, 2024
eda63de
Update bot logic
milesha Dec 1, 2024
12673c9
Format
milesha Dec 1, 2024
24ee85b
Change prompt
milesha Dec 1, 2024
3bbb6c0
Merge branch 'develop' into feature/java-chat-mvp-intelligence-service
FelixTJDietrich Dec 4, 2024
dd53b38
Intelligence Service MVP Chat Interface (#169)
milesha Dec 4, 2024
b5b589a
move to correct package
FelixTJDietrich Dec 4, 2024
39a774c
format realm config
FelixTJDietrich Dec 4, 2024
7bc3cf9
add mentor_access to keycloak
FelixTJDietrich Dec 4, 2024
cfb80c0
fix mentor access
FelixTJDietrich Dec 4, 2024
80a24bd
move stuff around
FelixTJDietrich Dec 4, 2024
fb80e0b
restructure client code
FelixTJDietrich Dec 5, 2024
5729200
fix naming
FelixTJDietrich Dec 5, 2024
bb2c8a4
prompt fix
milesha Dec 8, 2024
5a52636
add optimistic updates
milesha Dec 8, 2024
194de29
Merge branch 'feature/java-chat-mvp-intelligence-service' of https://…
milesha Dec 8, 2024
3cc30d1
Merge branch 'develop' into feature/java-chat-mvp-intelligence-service
milesha Dec 8, 2024
317727a
fix responsiveness
FelixTJDietrich Dec 8, 2024
69666fc
fix mobile
FelixTJDietrich Dec 8, 2024
ac05872
add optimistic update and scroll to bottom
FelixTJDietrich Dec 8, 2024
02901b9
fix button
FelixTJDietrich Dec 8, 2024
16af99e
fix client qa
FelixTJDietrich Dec 8, 2024
f3e200b
add skeleton start-session
milesha Dec 8, 2024
eb2904e
change layout
milesha Dec 8, 2024
b969125
fix layout for multuple sessions
milesha Dec 8, 2024
a008a21
add intelligence service config and prefix api models
FelixTJDietrich Dec 8, 2024
88040bd
Merge branch 'develop' into feature/java-chat-mvp-intelligence-service
FelixTJDietrich Dec 8, 2024
cbff9f5
fix loading state
milesha Dec 8, 2024
89aef02
Merge branch 'feature/java-chat-mvp-intelligence-service' of https://…
milesha Dec 8, 2024
ae154dc
fix eslint
milesha Dec 8, 2024
0277cd3
add intelligence service to compose
FelixTJDietrich Dec 8, 2024
617c107
Merge branch 'feature/java-chat-mvp-intelligence-service' of github.c…
FelixTJDietrich Dec 8, 2024
9599ed4
connect application server to intelligence service
FelixTJDietrich Dec 8, 2024
2e60767
add migration
FelixTJDietrich Dec 8, 2024
2d827cb
restructure intelligence service
FelixTJDietrich Dec 8, 2024
316eefc
format
FelixTJDietrich Dec 8, 2024
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
245 changes: 186 additions & 59 deletions server/application-server/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,88 @@ paths:
responses:
"200":
description: OK
/session:
get:
tags:
- session
operationId: getSessions
parameters:
- name: login
in: query
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Session"
post:
tags:
- session
operationId: createSession
requestBody:
content:
application/json:
schema:
type: string
required: true
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/Session"
/message/{sessionId}:
get:
tags:
- message
operationId: getMessages
parameters:
- name: sessionId
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Message"
post:
tags:
- message
operationId: createMessage
parameters:
- name: sessionId
in: path
required: true
schema:
type: integer
format: int64
requestBody:
content:
application/json:
schema:
type: string
required: true
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/Message"
/workspace/users:
get:
tags:
Expand Down Expand Up @@ -434,22 +516,31 @@ components:
updatedAt:
type: string
format: date-time
LabelInfo:
Message:
required:
- color
- content
- id
- name
- sender
- sentAt
- sessionId
type: object
properties:
id:
type: integer
format: int64
name:
sentAt:
type: string
color:
format: date-time
sender:
type: string
repository:
$ref: "#/components/schemas/RepositoryInfo"
enum:
- SYSTEM
- USER
content:
type: string
sessionId:
type: integer
format: int64
UserProfile:
required:
- contributedRepositories
Expand Down Expand Up @@ -493,58 +584,6 @@ components:
type: string
htmlUrl:
type: string
PullRequestReviewInfo:
required:
- codeComments
- htmlUrl
- id
- isDismissed
- score
- state
type: object
properties:
id:
type: integer
format: int64
isDismissed:
type: boolean
state:
type: string
enum:
- COMMENTED
- APPROVED
- CHANGES_REQUESTED
- UNKNOWN
codeComments:
type: integer
format: int32
author:
$ref: "#/components/schemas/UserInfo"
pullRequest:
$ref: "#/components/schemas/PullRequestBaseInfo"
htmlUrl:
type: string
score:
type: integer
format: int32
submittedAt:
type: string
format: date-time
MetaData:
required:
- scheduledDay
- scheduledTime
- teams
type: object
properties:
teams:
type: array
items:
$ref: "#/components/schemas/TeamInfo"
scheduledDay:
type: string
scheduledTime:
type: string
UserTeams:
required:
- id
Expand Down Expand Up @@ -646,6 +685,74 @@ components:
type: array
items:
$ref: "#/components/schemas/LabelInfo"
LabelInfo:
required:
- color
- id
- name
type: object
properties:
id:
type: integer
format: int64
name:
type: string
color:
type: string
repository:
$ref: "#/components/schemas/RepositoryInfo"
PullRequestReviewInfo:
required:
- codeComments
- htmlUrl
- id
- isDismissed
- score
- state
type: object
properties:
id:
type: integer
format: int64
isDismissed:
type: boolean
state:
type: string
enum:
- COMMENTED
- APPROVED
- CHANGES_REQUESTED
- UNKNOWN
codeComments:
type: integer
format: int32
author:
$ref: "#/components/schemas/UserInfo"
pullRequest:
$ref: "#/components/schemas/PullRequestBaseInfo"
htmlUrl:
type: string
score:
type: integer
format: int32
submittedAt:
type: string
format: date-time
MetaData:
required:
- scheduledDay
- scheduledTime
- teams
type: object
properties:
teams:
type: array
items:
$ref: "#/components/schemas/TeamInfo"
scheduledDay:
type: string
scheduledTime:
type: string
LeaderboardEntry:
required:
- numberOfApprovals
Expand Down Expand Up @@ -690,3 +797,23 @@ components:
numberOfCodeComments:
type: integer
format: int32
Session:
required:
- createdAt
- id
- messages
- userLogin
type: object
properties:
id:
type: integer
format: int64
messages:
type: array
items:
$ref: "#/components/schemas/Message"
userLogin:
type: string
createdAt:
type: string
format: date-time
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import de.tum.in.www1.hephaestus.gitprovider.repository.RepositoryInfoDTO;
import de.tum.in.www1.hephaestus.gitprovider.team.TeamInfoDTO;
import de.tum.in.www1.hephaestus.gitprovider.user.UserInfoDTO;
import de.tum.in.www1.hephaestus.chat.message.MessageDTO;
import de.tum.in.www1.hephaestus.chat.session.SessionDTO;
import io.hypersistence.utils.hibernate.type.util.ClassImportIntegrator;

public class ClassImportIntegratorIntegratorProvider implements IntegratorProvider {
Expand All @@ -33,6 +35,8 @@ public List<Integrator> getIntegrators() {
classes.add(IssueCommentInfoDTO.class);
classes.add(PullRequestReviewInfoDTO.class);
classes.add(RepositoryInfoDTO.class);
classes.add(MessageDTO.class);
classes.add(SessionDTO.class);

return List.of(new ClassImportIntegrator(classes));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ private void removeDTOSuffixesFromSchemaRecursively(Schema<?> schema) {
removeDTOSuffixesFromSchemaRecursively(schema.getItems());
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package de.tum.in.www1.hephaestus.chat.message;

import jakarta.persistence.*;
import java.time.OffsetDateTime;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.Length;
import org.springframework.lang.NonNull;
import de.tum.in.www1.hephaestus.chat.session.Session;

@Entity
@Table(name = "message")
@Getter
@Setter
@ToString
@NoArgsConstructor
public class Message {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@NonNull
private OffsetDateTime sentAt = OffsetDateTime.now();

@NonNull
@Enumerated(EnumType.STRING)
private MessageSender sender;

@Lob
FelixTJDietrich marked this conversation as resolved.
Show resolved Hide resolved
@NonNull
private String content;

@NonNull
@ManyToOne(optional = false, fetch = FetchType.LAZY)
@JoinColumn(name = "session_id")
private Session session;

public enum MessageSender {
SYSTEM, USER
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package de.tum.in.www1.hephaestus.chat.message;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping("/message")
public class MessageController {

@Autowired
private MessageService messageService;

@GetMapping("/{sessionId}")
public ResponseEntity<List<MessageDTO>> getMessages(@PathVariable Long sessionId) {
List<MessageDTO> messages = messageService.getMessagesBySessionId(sessionId);
return ResponseEntity.ok(messages);
}

@PostMapping("/{sessionId}")
public ResponseEntity<MessageDTO> createMessage(@RequestBody String message, @PathVariable Long sessionId) {
MessageDTO createdMessage = messageService.sendMessage(message, sessionId);
return ResponseEntity.ok(createdMessage);
}
}
Loading
Loading