Skip to content

Commit

Permalink
api test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mumu-kun committed Oct 7, 2024
1 parent c7a9d2d commit 735e720
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 20 deletions.
11 changes: 11 additions & 0 deletions .env.test2
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
RECOMBEE_PRIVATE_TOKEN = ui0bb5rWDix4IUaQQAr6PzWqeddguXPXIclHuyLMYarPH2n85aturUXh76C0NRvk
RECOMBEE_DATABASE_ID = pathphindr-dev

GROQ_API_KEY = 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

MAILGUN_DOMAIN = mg.pathphindr.com
MAILGUN_API_KEY = 2c9117ed3960408e855767a23c6e3563-2b755df8-02d6f02b

ZOOM_CLIENT_ID = qobjTiSqmMlsmLYUW8nA
ZOOM_CLIENT_SECRET = HM7dixYtHEJIKNI26ADljnQ2z87yP5yI
ZOOM_ISSUER = https://zoom.us/oauth
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ RUN ./mvnw package -DskipTests -Dcheckstyle.skip=true
# Runtime stage
FROM openjdk:17-jdk-slim
WORKDIR /app
COPY .env.test .env
COPY .env.test2 .env
COPY --from=build target/*.jar app.jar
ENTRYPOINT ["java", "-jar", "app.jar"]
37 changes: 18 additions & 19 deletions src/main/java/com/amplifiers/pathfinder/openAI/OpenAIService.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,24 @@ public class OpenAIService {
private final Integer chatMaxTokens = 300;

public String suggestion(String message) {
// var chatRequest = ChatRequest.builder()
// .model("llama3-8b-8192")
// .message(
// ChatMessage.SystemMessage.of(
// "You will give a very short description, roadmap and a few resources on how to learn the given topic." +
// "Generate a response within a maximum 500 tokens."
// )
// )
// .message(ChatMessage.UserMessage.of(message))
// .temperature(0.0)
// .maxTokens(suggestionMaxTokens)
// .build();
//
// var futureChat = openAI.chatCompletions().create(chatRequest);
// var chatResponse = futureChat.join();

// System.out.println(chatResponse.firstContent());
// return chatResponse.firstContent();
return apiKey;
var chatRequest = ChatRequest.builder()
.model("llama3-8b-8192")
.message(
ChatMessage.SystemMessage.of(
"You will give a very short description, roadmap and a few resources on how to learn the given topic." +
"Generate a response within a maximum 500 tokens."
)
)
.message(ChatMessage.UserMessage.of(message))
.temperature(0.0)
.maxTokens(suggestionMaxTokens)
.build();

var futureChat = openAI.chatCompletions().create(chatRequest);
var chatResponse = futureChat.join();

System.out.println(chatResponse.firstContent());
return chatResponse.firstContent();
}

public String chat(String message) {
Expand Down

0 comments on commit 735e720

Please sign in to comment.