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

Iris: Add chatbot to code editor page for exercise creation assistance #7368

Closed
wants to merge 155 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
838dfd8
Add IrisExerciseSession.java, add automatic IrisSession creation time
Sep 26, 2023
bb01746
Add IrisExerciseSession as Jackson subtype of IrisSession
Sep 26, 2023
022a8ae
Rework IrisMessage hierarchy for the introduction of a new message co…
Sep 26, 2023
2eeffb8
add updatePlanContent() endpoint
RY997 Sep 26, 2023
c5ac86f
Merge branch 'feature/iris-exercise-creation' of https://github.com/l…
RY997 Sep 26, 2023
5c1ac62
adjust according to domain settings
RY997 Sep 26, 2023
c283243
add the endpoint for updating component plan content
RY997 Sep 26, 2023
31d4e3c
Add new session type IrisCodeEditorSession
Sep 27, 2023
8c6241b
Update IrisCodeEditorSessionService to send initial request to Pyris
Sep 28, 2023
a009fac
Merge branch 'feature/iris-exercise-creation' into feature/iris-updat…
RY997 Sep 28, 2023
a8a2f27
Add IrisCodeEditorSessionResource.java
Sep 28, 2023
ad8d220
Add elseThrow method, fix query to use correct table
Sep 28, 2023
73b1570
Add documentation
Sep 28, 2023
925457f
Add initial prompt as constant
Sep 28, 2023
b14088d
Update IrisMessageIntegrationTest.java to additionally test new messa…
Sep 28, 2023
39388c1
Create new session integration test, rename old one
Sep 28, 2023
24fff19
Implemented rest api endpoints of code editor session
RY997 Sep 28, 2023
12ae546
Implement change requests part 1
Sep 29, 2023
a5f35a6
Add database migration
Oct 2, 2023
25105c8
Implemented rest api endpoints of code editor session messages
RY997 Oct 2, 2023
dd622cf
Use camelCase instead of snake_case in IrisCodeEditorSessionService f…
Oct 2, 2023
759fe7a
Merge branch 'feature/iris-exercise-creation' into feature/iris-updat…
RY997 Oct 2, 2023
0d8ea49
update uri
RY997 Oct 2, 2023
affd557
Merge branch 'feature/iris-exercise-creation' into feature/iris-updat…
RY997 Oct 2, 2023
f56c33e
fix as the return of getContent() is a list
RY997 Oct 2, 2023
0e5acf1
Redesign domain object model
Oct 2, 2023
4f73461
update the executePlan()
RY997 Oct 3, 2023
7a6c971
remove optional for test build
RY997 Oct 3, 2023
1f57c31
Merge branch 'feature/iris-exercise-creation' into feature/iris-updat…
RY997 Oct 3, 2023
389565b
Remove new resources (they will be added in another PR)
Oct 3, 2023
91c2b59
Remove test for new resource
Oct 3, 2023
9ca6859
Add IrisExercisePlanComponentRepository
Oct 3, 2023
a4a77b4
update updatePlanContent() based on new planComponent structure
RY997 Oct 3, 2023
2a17185
Merge branch 'feature/iris-exercise-creation' into feature/iris-updat…
RY997 Oct 3, 2023
840ac50
Update liquibase changeset
Oct 3, 2023
9afe5cd
updated updateComponentPlan()
RY997 Oct 3, 2023
b2b6bca
Rename ExercisePlanComponent to IrisExercisePlanComponent
Oct 3, 2023
9ef7c81
Change @Column to @JoinColumn on ManyToOne association
Oct 3, 2023
967661b
comment setting related code as it's not complete
RY997 Oct 5, 2023
2ed6c9d
Merge branch 'feature/iris-exercise-creation' into feature/iris-updat…
RY997 Oct 5, 2023
9e88bf1
update methods according to new implemented service
RY997 Oct 5, 2023
f35cd9e
add necessary annotation for distinguish between concrete implementat…
RY997 Oct 5, 2023
6e15bc6
added unit tests for IrisCodeEditorMessageResource
RY997 Oct 5, 2023
4c44e85
Add new IrisWebsocketService type
Oct 5, 2023
46d34c4
Fix typo
Oct 5, 2023
605098e
Move IrisWebsocketService to websocket package
Oct 5, 2023
f0edb09
Merge branch 'feature/iris-exercise-creation' into feature/iris-updat…
RY997 Oct 5, 2023
3fc6c26
remove unused code
RY997 Oct 5, 2023
c53944f
fix build failed with new websocket name
RY997 Oct 5, 2023
29b46ab
update Iris message content model
RY997 Oct 7, 2023
0581f0a
add exercise plan component model
RY997 Oct 7, 2023
834e44e
add http service of new session and message
RY997 Oct 8, 2023
e1cc4f8
add tests of new http services
RY997 Oct 8, 2023
984b965
update sample data of test
RY997 Oct 8, 2023
c67538f
fix client test failure issue
RY997 Oct 8, 2023
ee8088c
adjust according to new content type
RY997 Oct 8, 2023
cc1dc5d
Merge branch 'develop' into feature/iris-exercise-creation
Oct 9, 2023
f4ac236
Fix merge conflicts
Oct 9, 2023
6038913
Add migration to master.xml
Oct 9, 2023
9bc8796
Merge branch 'feature/iris-exercise-creation' into feature/iris-updat…
RY997 Oct 9, 2023
4fabc0e
fix database issue to make IrisMessageIntegration succeed
RY997 Oct 9, 2023
1195134
Add @JsonIgnore to break the cycle
RY997 Oct 9, 2023
8fbd0d8
Merge branch 'feature/iris-update-component-plan-content-endpoint' in…
RY997 Oct 10, 2023
e9d12d3
add setupSolution and setupTest method
RY997 Oct 10, 2023
52ac07f
add one TODO
RY997 Oct 10, 2023
16010c6
update tests
RY997 Oct 10, 2023
0a41315
add code-editor-session service
RY997 Oct 10, 2023
5de41ea
Merge branch 'feature/iris-client-model' of https://github.com/ls1int…
RY997 Oct 10, 2023
cfc7c76
fix testNoJunitJupiterAssertions() failed
RY997 Oct 10, 2023
628dc4d
Merge branch 'feature/iris-update-component-plan-content-endpoint' in…
RY997 Oct 10, 2023
1c3f16c
Change Pyris response type
Oct 10, 2023
33781c9
refactor message resource
RY997 Oct 11, 2023
bd7f979
fix tests failed issue
RY997 Oct 11, 2023
79c80fa
remove unused methods
RY997 Oct 11, 2023
cf2223c
Merge branch 'feature/iris-update-component-plan-content-endpoint' in…
RY997 Oct 11, 2023
10f8f96
add code editor websocket
RY997 Oct 11, 2023
47ce629
refactoring
RY997 Oct 11, 2023
92f03f8
fix client tests failure
RY997 Oct 11, 2023
45073ae
Redesign websocket hierarchy
Oct 11, 2023
2ce6961
fix client tests failure
RY997 Oct 11, 2023
97f43b4
added iris chatbot to code editor page
RY997 Oct 12, 2023
6bb7fbd
fix websocket service test failure
RY997 Oct 12, 2023
362147c
Merge branch 'feature/iris-client-model' into feature/iris-code-edito…
RY997 Oct 12, 2023
bd74f89
Merge branch 'feature/iris-code-editor-client' into feature/iris-code…
RY997 Oct 12, 2023
5d6fc80
add iris chatbot ui in code editor
RY997 Oct 13, 2023
e92f7ec
fix send message bad request issue
RY997 Oct 13, 2023
b1d6f18
Restore v1 pyris communication behavior, add v2 alternative DTO
Oct 13, 2023
c694734
Revert variable names
Oct 13, 2023
4264b4e
check server side message
RY997 Oct 13, 2023
67cfe26
check server side message
RY997 Oct 13, 2023
9bccdd6
Add IrisExerciseSession.java, add automatic IrisSession creation time
Sep 26, 2023
4175499
Add IrisExerciseSession as Jackson subtype of IrisSession
Sep 26, 2023
4d56cba
Rework IrisMessage hierarchy for the introduction of a new message co…
Sep 26, 2023
8886163
Add new session type IrisCodeEditorSession
Sep 27, 2023
0f7e7b0
Update IrisCodeEditorSessionService to send initial request to Pyris
Sep 28, 2023
a1b2a78
Add IrisCodeEditorSessionResource.java
Sep 28, 2023
e23ddd2
Add elseThrow method, fix query to use correct table
Sep 28, 2023
b236104
Add documentation
Sep 28, 2023
8a4c61f
Add initial prompt as constant
Sep 28, 2023
3af65f8
Update IrisMessageIntegrationTest.java to additionally test new messa…
Sep 28, 2023
d008755
Create new session integration test, rename old one
Sep 28, 2023
7ffc1b2
Implement change requests part 1
Sep 29, 2023
43cb952
Add database migration
Oct 2, 2023
321622b
Use camelCase instead of snake_case in IrisCodeEditorSessionService f…
Oct 2, 2023
302a14e
Redesign domain object model
Oct 2, 2023
056dc0d
Remove new resources (they will be added in another PR)
Oct 3, 2023
c9f65fb
Remove test for new resource
Oct 3, 2023
156b0ea
Add IrisExercisePlanComponentRepository
Oct 3, 2023
b4a7d1b
Update liquibase changeset
Oct 3, 2023
484bec2
Rename ExercisePlanComponent to IrisExercisePlanComponent
Oct 3, 2023
c4c9171
Change @Column to @JoinColumn on ManyToOne association
Oct 3, 2023
8e67cf7
Add new IrisWebsocketService type
Oct 5, 2023
a18a390
Fix typo
Oct 5, 2023
f42c321
Move IrisWebsocketService to websocket package
Oct 5, 2023
ce2d8cb
Fix merge conflicts
Oct 9, 2023
c2d1c56
Add migration to master.xml
Oct 9, 2023
6c19bea
observe iris websocket in code editor
RY997 Oct 14, 2023
2ad22e1
Merge remote-tracking branch 'origin/feature/iris-exercise-creation' …
Oct 14, 2023
2a1c422
Merge branch 'fix/iris-response-type' into feature/iris-code-editor-ui
RY997 Oct 14, 2023
c598a63
Merge changes
Oct 14, 2023
b72cf1e
Update IrisWebsocketService, implement Pyris response parsing
Oct 14, 2023
ed5ecc5
inject changes of ps and solution
RY997 Oct 14, 2023
dbc3825
Merge branch 'feature/iris-exercise-creation' into feature/iris-code-…
RY997 Oct 14, 2023
36e7cd6
Merge branch 'develop' into feature/iris-code-editor-ui
RY997 Oct 14, 2023
b1ff604
rename selector name
RY997 Oct 14, 2023
31ab37e
update tests
RY997 Oct 14, 2023
3dfa717
Implement Pyris change parsing
Oct 14, 2023
d684eac
add inject changes of four components
RY997 Oct 14, 2023
e4f1f31
fix NullInjectorError
RY997 Oct 14, 2023
8593f24
test
RY997 Oct 14, 2023
044433e
Add tests
Oct 14, 2023
d848ec5
fix message can not be shown correctly issue
RY997 Oct 14, 2023
15df6e5
fix build failure
RY997 Oct 14, 2023
689408e
fixed NullInjectorError of code editor page
RY997 Oct 14, 2023
75de52b
update first message of different chat session
RY997 Oct 15, 2023
2df7f11
Merge branch 'develop' into feature/iris-code-editor-ui
RY997 Oct 15, 2023
0f2bed2
update according to develop branch changes
RY997 Oct 15, 2023
a19801b
fix client-test failure
RY997 Oct 15, 2023
061e03a
fix build failure
RY997 Oct 15, 2023
7f5b19e
update inject changes between repos (in progress)
RY997 Oct 15, 2023
db60836
Simplify logic
Oct 15, 2023
5c93677
Apply buffered changes upon repository change
Oct 15, 2023
2027105
removed todo comment as the task is done
RY997 Oct 15, 2023
0c9eb00
Update model
Oct 15, 2023
60f9be2
Update model again
Oct 15, 2023
bbc0dec
import IrisModule in codeEditorTest and add tooltip for iris-button
RY997 Oct 15, 2023
6603253
Merge remote-tracking branch 'origin/feature/iris-code-editor-ui' int…
RY997 Oct 15, 2023
6061358
Merge branch 'feature/iris-exercise-creation' into feature/iris-code-…
RY997 Oct 15, 2023
89937a8
check preferred model available
RY997 Oct 16, 2023
3d28a66
Merge branch 'develop' into feature/iris-code-editor-ui
RY997 Oct 16, 2023
1cc1c06
check if preferred model available
RY997 Oct 16, 2023
3356b50
Merge remote-tracking branch 'origin/feature/iris-code-editor-ui' int…
RY997 Oct 16, 2023
b8058e7
Fixes after debugging session
Hialus Oct 16, 2023
d965c62
chores
RY997 Oct 16, 2023
de53209
remove some file from repository content to limit the token consumption
RY997 Oct 16, 2023
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 .idea/runConfigurations/_template__of_Gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

/**
* An IrisTemplate represents a handlebars template for Iris.
* It is send to the Iris Python server to generate a response.
* It is sent to the Iris Python server to generate a response.
*/
@Entity
@Table(name = "iris_template")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package de.tum.in.www1.artemis.domain.iris.message;

public enum ExerciseComponent {

Check warning on line 3 in src/main/java/de/tum/in/www1/artemis/domain/iris/message/ExerciseComponent.java

View check run for this annotation

Teamscale / teamscale-findings

src/main/java/de/tum/in/www1/artemis/domain/iris/message/ExerciseComponent.java#L3

Interface comment missing https://teamscale.io/findings.html#details/GitHub-ls1intum-Artemis?t=feature%2Firis-code-editor-ui%3AHEAD&id=1F1258561F65F402257EBA464A386893
PROBLEM_STATEMENT, SOLUTION_REPOSITORY, TEMPLATE_REPOSITORY, TEST_REPOSITORY
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package de.tum.in.www1.artemis.domain.iris.message;

import javax.persistence.*;

Check warning on line 3 in src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisExercisePlanComponent.java

View check run for this annotation

Teamscale / teamscale-findings

src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisExercisePlanComponent.java#L3

Star import of `javax.persistence.*` should not be used https://teamscale.io/findings.html#details/GitHub-ls1intum-Artemis?t=feature%2Firis-code-editor-ui%3AHEAD&id=590D4496B1E9FAB27AC577A746C3A996
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;

import de.tum.in.www1.artemis.domain.DomainObject;

@Entity
@Table(name = "iris_exercise_plan_component")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class IrisExercisePlanComponent extends DomainObject {

Check warning on line 14 in src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisExercisePlanComponent.java

View check run for this annotation

Teamscale / teamscale-findings

src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisExercisePlanComponent.java#L14

Interface comment missing https://teamscale.io/findings.html#details/GitHub-ls1intum-Artemis?t=feature%2Firis-code-editor-ui%3AHEAD&id=562632C441A1B89B7C8139F07443073E

@ManyToOne
@JoinColumn(name = "exercise_plan_id")
@JsonIgnore
private IrisExercisePlanMessageContent exercisePlan;

@NotNull
@Enumerated(value = EnumType.STRING)
@Column(name = "exercise_component")
private ExerciseComponent component;

@NotNull
@Column(name = "instructions")
private String instructions;

public IrisExercisePlanComponent() {
}

Check warning on line 31 in src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisExercisePlanComponent.java

View check run for this annotation

Teamscale / teamscale-findings

src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisExercisePlanComponent.java#L30-L31

Interface comment missing https://teamscale.io/findings.html#details/GitHub-ls1intum-Artemis?t=feature%2Firis-code-editor-ui%3AHEAD&id=3498D9B0624096C552D55331122D30D4

Check warning on line 31 in src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisExercisePlanComponent.java

View check run for this annotation

Teamscale / teamscale-findings

src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisExercisePlanComponent.java#L30-L31

Empty block: constructor https://teamscale.io/findings.html#details/GitHub-ls1intum-Artemis?t=feature%2Firis-code-editor-ui%3AHEAD&id=D523CCC10F6DF9F1C5CAD4461A423A6A

public IrisExercisePlanComponent(IrisExercisePlanMessageContent exercisePlan, ExerciseComponent component, String instructions) {

Check warning on line 33 in src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisExercisePlanComponent.java

View check run for this annotation

Teamscale / teamscale-findings

src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisExercisePlanComponent.java#L33

Interface comment missing https://teamscale.io/findings.html#details/GitHub-ls1intum-Artemis?t=feature%2Firis-code-editor-ui%3AHEAD&id=F1B540EDEBC883DDB8AE197E820A267B
this.exercisePlan = exercisePlan;
this.component = component;
this.instructions = instructions;
}

public IrisExercisePlanMessageContent getExercisePlan() {
return exercisePlan;
}

public void setExercisePlan(IrisExercisePlanMessageContent plan) {
this.exercisePlan = plan;
}

public ExerciseComponent getComponent() {
return component;
}

public void setComponent(ExerciseComponent component) {
this.component = component;
}

public String getInstructions() {
return instructions;
}

public void setInstructions(String instructions) {
this.instructions = instructions;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
package de.tum.in.www1.artemis.domain.iris.message;

import java.util.Iterator;
import java.util.List;

import javax.persistence.*;

Check warning on line 6 in src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisExercisePlanMessageContent.java

View check run for this annotation

Teamscale / teamscale-findings

src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisExercisePlanMessageContent.java#L6

Star import of `javax.persistence.*` should not be used https://teamscale.io/findings.html#details/GitHub-ls1intum-Artemis?t=feature%2Firis-code-editor-ui%3AHEAD&id=17ADA26DA9EA9CBDD03ACE7E17E4EE41

import com.fasterxml.jackson.annotation.JsonInclude;

/**
* An IrisExercisePlanMessageContent represents an Iris-generated plan to make changes to an exercise.
* The plans may or may not have been edited by the user before execution.
*/
@Entity
@Table(name = "iris_exercise_plan_message_content")
@DiscriminatorValue(value = "EXERCISE_PLAN")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class IrisExercisePlanMessageContent extends IrisMessageContent implements Iterator<IrisExercisePlanComponent> {

@OneToMany(mappedBy = "exercisePlan", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER)
private List<IrisExercisePlanComponent> components;

@Column(name = "current_component_index")
private short currentComponentIndex = 0;

@Transient
private boolean executing = false;

public List<IrisExercisePlanComponent> getComponents() {
return components;
}

public void setComponents(List<IrisExercisePlanComponent> components) {
this.components = components;
}

public short getCurrentComponentIndex() {
return currentComponentIndex;
}

public void setCurrentComponentIndex(short currentInstructionIndex) {
this.currentComponentIndex = currentInstructionIndex;
}

public boolean isExecuting() {
return executing;
}

public void setExecuting(boolean executing) {
this.executing = executing;
}

@Override
public boolean hasNext() {
return currentComponentIndex < components.size();
}

@Override
public IrisExercisePlanComponent next() {
if (!hasNext()) {
throw new IllegalStateException("No more instructions available");
}
return components.get(currentComponentIndex++);
}

@Override
public String getContentAsString() {
var sb = new StringBuilder("Exercise plan:\n");
for (var entry : components) {
sb.append(entry.getComponent().toString()).append(": \"").append(entry.getInstructions()).append("\"\n");
}
return sb.toString();
}

@Override
public String toString() {
return "IrisExercisePlanMessageContent{" + "message=" + (message == null ? "null" : message.getId()) + ", components=" + components + ", currentInstructionIndex="

Check warning on line 77 in src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisExercisePlanMessageContent.java

View check run for this annotation

Teamscale / teamscale-findings

src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisExercisePlanMessageContent.java#L77

Avoid using ternary operators https://teamscale.io/findings.html#details/GitHub-ls1intum-Artemis?t=feature%2Firis-code-editor-ui%3AHEAD&id=D093778399C019BA58832DF32576DB51
+ currentComponentIndex + '}';
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.tum.in.www1.artemis.domain.iris;
package de.tum.in.www1.artemis.domain.iris.message;

import java.time.ZonedDateTime;
import java.util.ArrayList;
Expand All @@ -19,8 +19,7 @@

/**
* An IrisMessage represents a single message in an IrisSession.
* A message can be created by either the user, an LLM, or Artemis.
* Artemis messages are used to give commands to the bot and are not displayed to the user.
* The message may contain multiple pieces of content with different types.
*/
@Entity
@Table(name = "iris_message")
Expand All @@ -34,7 +33,7 @@

@Nullable
@Column(name = "sent_at")
private ZonedDateTime sentAt;
private ZonedDateTime sentAt = ZonedDateTime.now();

@Nullable
@Column(name = "helpful")
Expand All @@ -44,13 +43,13 @@
@Enumerated(EnumType.STRING)
private IrisMessageSender sender;

@Transient
private Integer messageDifferentiator; // is supposed to be only a part of the dto and helps the client application to differentiate messages it should add to the message store

@OrderColumn(name = "iris_message_content_order")
@OneToMany(mappedBy = "message", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)
@OneToMany(mappedBy = "message", fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
private List<IrisMessageContent> content = new ArrayList<>();

@Transient
private Integer messageDifferentiator; // is supposed to be only a part of the dto and helps the client application to differentiate messages it should add to the message store

public IrisSession getSession() {
return session;
}
Expand Down Expand Up @@ -93,6 +92,10 @@
this.content = content;
}

public void addContent(IrisMessageContent content) {

Check warning on line 95 in src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisMessage.java

View check run for this annotation

Teamscale / teamscale-findings

src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisMessage.java#L95

Interface comment missing https://teamscale.io/findings.html#details/GitHub-ls1intum-Artemis?t=feature%2Firis-code-editor-ui%3AHEAD&id=129433E92EDE222FC5C4EE64298E222A
this.content.add(content);
}

@JsonProperty
public Integer getMessageDifferentiator() {
return messageDifferentiator;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package de.tum.in.www1.artemis.domain.iris.message;

import javax.annotation.Nullable;
import javax.persistence.*;

Check warning on line 4 in src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisMessageContent.java

View check run for this annotation

Teamscale / teamscale-findings

src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisMessageContent.java#L4

Star import of `javax.persistence.*` should not be used https://teamscale.io/findings.html#details/GitHub-ls1intum-Artemis?t=feature%2Firis-code-editor-ui%3AHEAD&id=B47F798F69B999D249DA096FB211C245

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.fasterxml.jackson.annotation.*;

Check warning on line 9 in src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisMessageContent.java

View check run for this annotation

Teamscale / teamscale-findings

src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisMessageContent.java#L9

Star import of `com.fasterxml.jackson.annotation.*` should not be used https://teamscale.io/findings.html#details/GitHub-ls1intum-Artemis?t=feature%2Firis-code-editor-ui%3AHEAD&id=831777F87000A1E23FE99F9D1F8AF3AA

import de.tum.in.www1.artemis.domain.*;

Check warning on line 11 in src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisMessageContent.java

View check run for this annotation

Teamscale / teamscale-findings

src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisMessageContent.java#L11

Star import of `de.tum.in.www1.artemis.domain.*` should not be used https://teamscale.io/findings.html#details/GitHub-ls1intum-Artemis?t=feature%2Firis-code-editor-ui%3AHEAD&id=CBCEA3367BBE37626C2097984B66CBC6

@Entity
@Table(name = "iris_message_content")
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(name = "discriminator")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
@JsonSubTypes({ @JsonSubTypes.Type(value = IrisTextMessageContent.class, name = "text"),
@JsonSubTypes.Type(value = IrisExercisePlanMessageContent.class, name = "exercise-plan"), })
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public abstract class IrisMessageContent extends DomainObject {

Check warning on line 22 in src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisMessageContent.java

View check run for this annotation

Teamscale / teamscale-findings

src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisMessageContent.java#L22

In this file 4 interface comments are missing. Consider adding explanatory comments or restricting the visibility. View in Teamscale: Line 22: https://teamscale.io/findings.html#details/GitHub-ls1intum-Artemis?t=feature%2Firis-code-editor-ui%3AHEAD&id=A5E7A87DDE1D3064045462B002C44463 Line 29: https://teamscale.io/findings.html#details/GitHub-ls1intum-Artemis?t=feature%2Firis-code-editor-ui%3AHEAD&id=21B16736528C09839398830DCE1F8DB2 Line 32: https://teamscale.io/findings.html#details/GitHub-ls1intum-Artemis?t=feature%2Firis-code-editor-ui%3AHEAD&id=8DAF3E60407F809C0DA3D65A5996975F Line 45: https://teamscale.io/findings.html#details/GitHub-ls1intum-Artemis?t=feature%2Firis-code-editor-ui%3AHEAD&id=A989C6EFC0B510871967CE7BEA9309D0

@ManyToOne
@JsonIgnore
IrisMessage message;

// Required by JPA
public IrisMessageContent() {
}

Check warning on line 30 in src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisMessageContent.java

View check run for this annotation

Teamscale / teamscale-findings

src/main/java/de/tum/in/www1/artemis/domain/iris/message/IrisMessageContent.java#L29-L30

Empty block: constructor https://teamscale.io/findings.html#details/GitHub-ls1intum-Artemis?t=feature%2Firis-code-editor-ui%3AHEAD&id=D6D99D9452E8A35B981EC81D80B301BE

public IrisMessageContent(IrisMessage irisMessage) {
this.message = irisMessage;
}

public IrisMessage getMessage() {
return message;
}

public void setMessage(IrisMessage message) {
this.message = message;
}

@Nullable
public abstract String getContentAsString();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package de.tum.in.www1.artemis.domain.iris.message;

/**
* This enum represents the different senders of Iris messages.
* USER: A message sent by a user of the system
* LLM: A message generated by a large language model
* ARTEMIS: A message generated by the system itself
*/
public enum IrisMessageSender {
USER, LLM, ARTEMIS
}
Loading
Loading