Skip to content

Commit

Permalink
chore: fix openai tests and upgrade quarkus minor
Browse files Browse the repository at this point in the history
  • Loading branch information
astappiev committed Apr 30, 2024
1 parent 127fc9c commit 3c43939
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import java.util.List;

import com.fasterxml.jackson.annotation.JsonProperty;

import io.quarkus.runtime.annotations.RegisterForReflection;

import de.l3s.interweb.core.completion.CompletionQuery;
Expand All @@ -13,12 +15,16 @@ public final class CompletionBody {

private Double temperature;

@JsonProperty("top_p")
private Double topP;

@JsonProperty("frequency_penalty")
private Double frequencyPenalty;

@JsonProperty("presence_penalty")
private Double presencePenalty;

@JsonProperty("max_tokens")
private Integer maxTokens;

public CompletionBody(CompletionQuery query) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package de.l3s.interweb.connector.openai.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;

import io.quarkus.runtime.annotations.RegisterForReflection;

import de.l3s.interweb.core.completion.Message;

@RegisterForReflection
public final class CompletionMessage {
private String role;
@JsonIgnore
private String name;
private String content;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public Class<ApiKeyAuthenticationRequest> getRequestType() {
public Uni<SecurityIdentity> authenticate(ApiKeyAuthenticationRequest request, AuthenticationRequestContext authenticationRequestContext) {
return Token.findByApiKey(request.getValue())
.onItem().ifNotNull()
.transform(consumer -> QuarkusSecurityIdentity.builder()
.setPrincipal(consumer.user)
.addCredential(consumer)
.transform(token -> QuarkusSecurityIdentity.builder()
.setPrincipal(token.user)
.addCredential(token)
.setAnonymous(false)
.addRole(Roles.SERVICE)
.build());
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>3.8.2</quarkus.platform.version>
<quarkus.platform.version>3.8.4</quarkus.platform.version>

<surefire-plugin.version>3.2.5</surefire-plugin.version>
<enforcer-plugin.version>3.4.1</enforcer-plugin.version>
Expand Down

0 comments on commit 3c43939

Please sign in to comment.