Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fc25791

Browse files
clean up test code
1 parent 93e942e commit fc25791

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

‎src/test/java/JavaTest.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ public static void doCompletion(boolean stream, boolean async) throws OpenAIErro
8787
// Loads the API key from the .env file in the root directory.
8888
String key = Dotenv.load().get("OPENAI_TOKEN");
8989
OpenAI openai = new OpenAI(key);
90-
9190
System.out.println(RESET + "Generating Response" + PURPLE);
91+
92+
// Generate a print the message
9293
if (stream) {
9394
if (async)
9495
openai.streamCompletionAsync(request, response -> System.out.print(response.get(0).getText()));

‎src/test/kotlin/KotlinTest.kt‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ const val PURPLE = "\u001b[0;35m"
2121
const val CYAN = "\u001b[0;36m"
2222
const val WHITE = "\u001b[0;37m"
2323

24-
@Throws(OpenAIError::class)
25-
fun main(args: Array<String>) {
24+
fun main() {
2625
val scanner = Scanner(System.`in`)
2726

2827
// Print out the menu of options
@@ -69,6 +68,8 @@ fun doCompletion(stream: Boolean, async: Boolean) {
6968
val key = dotenv()["OPENAI_TOKEN"]
7069
val openai = OpenAI(key)
7170
println(RESET + "Generating Response" + PURPLE)
71+
72+
// Generate a print the completion
7273
if (stream) {
7374
if (async) {
7475
openai.streamCompletionAsync(request, { print(it[0].text) })
@@ -91,7 +92,7 @@ fun doChat(stream: Boolean, async: Boolean) {
9192
val scan = Scanner(System.`in`)
9293

9394
// This is the prompt that the bot will refer back to for every message.
94-
val prompt = "You are a customer support chat-bot. Write brief summaries of the user's questions so that agents can easily find the answer in a database.".toSystemMessage()
95+
val prompt = "Be helpful ChatBot".toSystemMessage()
9596

9697
// Use a mutable (modifiable) list! Always! You should be reusing the
9798
// ChatRequest variable, so in order for a conversation to continue

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /