Skip to content

Commit

Permalink
feat(#88): model ref
Browse files Browse the repository at this point in the history
  • Loading branch information
h1alexbel committed Jun 7, 2024
1 parent 6d61c61 commit e600dca
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ SOFTWARE.
<dependency>
<groupId>com.jcabi</groupId>
<artifactId>jcabi-github</artifactId>
<version>${jcabi-github.version}</version>
<version>${jcabi-github.version}</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void exec(final Pull pull, final String model) throws Exception {
credential = System.getProperty(platf);
}
final Model analysis = new AutoModel(
credential, this.platform, system, prompt
credential, this.platform, system, prompt, model
).value();
final String score = analysis.completion();
if (score.toLowerCase(Locale.ROOT).contains("excellent")) {
Expand Down Expand Up @@ -127,7 +127,8 @@ public void exec(final Pull pull, final String model) throws Exception {
new PullChanges(pull)
)
)
).asString()
).asString(),
model
).value().completion(),
model
),
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/git/tracehub/codereview/action/AutoModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ public final class AutoModel implements Scalar<Model> {
*/
private final String prompt;

/**
* Model ref.
*/
private final String ref;

@Override
public Model value() throws Exception {
final String platf = this.platform.value();
Expand All @@ -70,7 +75,7 @@ public Model value() throws Exception {
this.credential,
new CompleteJson(
new Simple(
System.getenv().get("INPUT_DEEPINFRA_MODEL"),
this.ref,
0.7,
512
),
Expand All @@ -85,7 +90,7 @@ public Model value() throws Exception {
this.credential,
new OpenJson(
new Simple(
System.getenv().get("INPUT_OPENAI_MODEL"),
this.ref,
0.7,
512
),
Expand Down

0 comments on commit e600dca

Please sign in to comment.