-
Notifications
You must be signed in to change notification settings - Fork 2
Add LLM Assistant Functionality for Scoring #39
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
Open
rnichi1
wants to merge
8
commits into
mp-access:main
Choose a base branch
from
rnichi1:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b861e47
Add llm correction
rnichi1 ebaef49
Merge branch 'main' of https://github.com/rnichi1/Access-LLM-Backend
rnichi1 4dc25c4
Add missin Bean to SecurityConfig
rnichi1 7a9cd39
Add llm family as replacement for model
rnichi1 8093e6d
change example format and take correct submission for llm
rnichi1 3d9cd71
Add a guard to not always run assistant scoring
rnichi1 60d48b0
fix: import of courses
rnichi1 9158284
fix: send example points as string
rnichi1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
80 changes: 80 additions & 0 deletions
80
src/main/kotlin/ch/uzh/ifi/access/model/dto/AssistantDTO.kt
This file contains hidden or 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,80 @@ | ||
| package ch.uzh.ifi.access.model.dto | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty | ||
| import lombok.Data | ||
|
|
||
|
|
||
| enum class LLMType { | ||
| gpt, | ||
| claude | ||
| } | ||
|
|
||
| @Data | ||
| class RubricDTO ( | ||
| @JsonProperty("id") | ||
| var id: String, | ||
|
|
||
| @JsonProperty("title") | ||
| var title: String, | ||
|
|
||
| @JsonProperty("points") | ||
| var points: Double | ||
| ) | ||
|
|
||
| @Data | ||
| class FewShotExampleDTO ( | ||
| @JsonProperty("answer") | ||
| var answer: String, | ||
|
|
||
| @JsonProperty("points") | ||
| var points: String // Stringified JSON for flexibility | ||
| ) | ||
|
|
||
| @Data | ||
| class AssistantDTO ( | ||
| @JsonProperty("question") | ||
| var question: String, | ||
|
|
||
| @JsonProperty("answer") | ||
| var answer: String, | ||
|
|
||
| @JsonProperty("rubrics") | ||
| var rubrics: List<RubricDTO>? = null, | ||
|
|
||
| @JsonProperty("modelSolution") | ||
| var modelSolution: String? = null, | ||
|
|
||
| @JsonProperty("maxPoints") | ||
| var maxPoints: Double? = 1.0, | ||
|
|
||
| @JsonProperty("minPoints") | ||
| var minPoints: Double? = 0.0, | ||
|
|
||
| @JsonProperty("pointStep") | ||
| var pointStep: Double? = 0.5, | ||
|
|
||
| @JsonProperty("chainOfThought") | ||
| var chainOfThought: Boolean? = true, | ||
|
|
||
| @JsonProperty("votingCount") | ||
| var votingCount: Int? = 1, | ||
|
|
||
| @JsonProperty("temperature") | ||
| var temperature: Double? = 0.2, | ||
|
|
||
| @JsonProperty("fewShotExamples") | ||
| var fewShotExamples: List<FewShotExampleDTO>? = null, | ||
|
|
||
| @JsonProperty("prePrompt") | ||
| var prePrompt: String? = null, | ||
|
|
||
| @JsonProperty("prompt") | ||
| var prompt: String? = null, | ||
|
|
||
| @JsonProperty("postPrompt") | ||
| var postPrompt: String? = null, | ||
|
|
||
| @JsonProperty("llmType") | ||
| var llmType: LLMType? = null | ||
|
|
||
| ) |
45 changes: 45 additions & 0 deletions
45
src/main/kotlin/ch/uzh/ifi/access/model/dto/AssistantResponseDTO.kt
This file contains hidden or 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,45 @@ | ||
| package ch.uzh.ifi.access.model.dto | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties | ||
| import com.fasterxml.jackson.annotation.JsonProperty | ||
| import lombok.Data | ||
|
|
||
| enum class Status { | ||
| correct, | ||
| incorrect, | ||
| incomplete | ||
| } | ||
|
|
||
| @JsonIgnoreProperties(ignoreUnknown = true) | ||
| @Data | ||
| class AssistantResponseDTO ( | ||
| @JsonProperty("status") | ||
| var status: Status, | ||
|
|
||
| @JsonProperty("feedback") | ||
| var feedback: String, | ||
|
|
||
| @JsonProperty("hint") | ||
| var hint: String? = null, | ||
|
|
||
| @JsonProperty("points") | ||
| var points: Double, | ||
|
|
||
| @JsonProperty("votingResult") | ||
| var votingResult: String | ||
| ) | ||
|
|
||
| @JsonIgnoreProperties(ignoreUnknown = true) | ||
| @Data | ||
| class AssistantEvaluationResponseDTO ( | ||
| @JsonProperty("status") | ||
| var status: String, | ||
|
|
||
| @JsonProperty("result") | ||
| var result: AssistantResponseDTO? | ||
| ) | ||
|
|
||
| class TaskIdDTO( | ||
| @JsonProperty("jobId") | ||
| var jobId: String | ||
| ) |
16 changes: 16 additions & 0 deletions
16
src/main/kotlin/ch/uzh/ifi/access/model/dto/LLMConfigDTO.kt
This file contains hidden or 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,16 @@ | ||
| package ch.uzh.ifi.access.model.dto | ||
|
|
||
| data class LLMConfigDTO( | ||
| var submission: String? = null, | ||
| var solution: String? = null, | ||
| var rubrics: String? = null, | ||
| var cot: Boolean = false, | ||
| var voting: Int = 1, | ||
| var examples: String? = null, | ||
| var prompt: String? = null, | ||
| var pre: String? = null, | ||
| var post: String? = null, | ||
| var temperature: Double? = null, | ||
| var model: String? = null, | ||
| var maxPoints: Double? = null | ||
| ) |
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why was it necessary to skip all these? Normally, CourseConfigImporter can rely on the ModelMapper to take care of most fields, but you manually implemented the mapping in CourseConfigImporter instead. Is that necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because the Task.class contains each field separately while the TaskDTO contains the llm config in one single DTO object.