Skip to content

Commit

Permalink
fea: add ChatRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
astappiev committed Aug 13, 2024
1 parent 92cd269 commit 0a76f0a
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package de.l3s.interweb.server.features.requests;

import com.fasterxml.jackson.annotation.JsonIgnore;

import de.l3s.interweb.server.features.user.ApiKey;

import de.l3s.interweb.server.features.user.User;

import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;

import org.hibernate.annotations.CreationTimestamp;

import java.time.Instant;

public class ChatRequest {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long id;

@NotNull
@JsonIgnore
@ManyToOne(optional = false, fetch = FetchType.EAGER)
public User user;

@JsonIgnore
@ManyToOne(optional = false, fetch = FetchType.LAZY)
public ApiKey apikey;

@NotNull
public String model;

@NotNull
@Column(name = "input_tokens")
public Integer inputTokens = 0;

@NotNull
@Column(name = "output_tokens")
public Integer outputTokens = 0;

@NotNull
@Column(name = "est_cost")
public Double estimatedCost = 0d;

@CreationTimestamp
public Instant created;
}
5 changes: 2 additions & 3 deletions interweb-server/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
interweb.admin.email=
interweb.auto-approve.pattern=[email protected]$

quarkus.http.port=8080
quarkus.http.cors=true
quarkus.http.cors.origins=/.*/
quarkus.http.cors.access-control-allow-credentials=true

quarkus.ssl.native=true
quarkus.http.port=8080

quarkus.analytics.disabled=true
quarkus.log.level=INFO

quarkus.cache.caffeine.initial-capacity=100
Expand Down

0 comments on commit 0a76f0a

Please sign in to comment.