Skip to content

Commit b9be65f

Browse files
committed
Commented out in-progress prompts, resolved gpt controller test conflicts
1 parent 6841711 commit b9be65f

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

server/src/gpt-controller.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ export class GPTController {
4545
//console.log(`Thread Message: ${threadMessage}`)
4646
// Create the three threads for each paper
4747
let threadResults: GPTData[] = [];
48-
const loopPromises = Array.from({ length: 1 }, async (_) => { // FOR TESTING
49-
//const loopPromises = Array.from({ length: 3 }, async (_) => {
48+
//const loopPromises = Array.from({ length: 1 }, async (_) => { // FOR TESTING
49+
const loopPromises = Array.from({ length: 3 }, async (_) => {
5050
const assistant = await this.createAssistant(assistantParams);
5151
const thread = await this.createThread(threadMessage);
5252

@@ -58,11 +58,11 @@ export class GPTController {
5858
},
5959
);
6060
if (run.status == "completed") {
61-
console.log("Tokens used: ", run.usage)
6261
const messages =
6362
await GPTController.client.beta.threads.messages.list(
6463
run.thread_id,
6564
);
65+
// console.log("Tokens used: ", run.usage)
6666
var n = 1;
6767
for (const message of messages.data.reverse()) {
6868
if (message.content[0].type == "text") { // Need to check if the message content is text before parsing it

server/src/prompts.data.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
export const questions = [
22
"What is the title of the paper",
33
"Which year was the paper published",
4-
"What are all of the author's names, in the format (J. Doe) in a \"¶\" separated list. Reply N/A if authors are not found",
5-
"What is the part no. of the part studied by the paper. If there is more than one, list in a \";\" separated list", // There can be more than one part no. in a paper
6-
"What is the type of part or parts (eg. switching regulator) mentioned in the paper. If there is more than one, list in a \";\" separated list",
7-
"Who is the manufacturer. If there is more than one, list in a \";\" separated list", // There can be more than one manufacturer in a paper if multiple parts are mentioned
4+
"What are all of the author's names, in the format (J. Doe) in a \"¶\" separated list",
5+
"What is the part no. of the part studied by the paper. If there is more than one, list them", // There can be more than one part no. in a paper
6+
"What is the type of part or parts (eg. switching regulator) mentioned in the paper. If there is more than one, list them",
7+
"Who is the manufacturer. If there is more than one, list them", // There can be more than one manufacturer in a paper if multiple parts are mentioned
88
"What is the type of testing location: Respond to this question with \"Terrestrial\" for a terrestial testing location, or \"Flight\" for a flight testing location",
99
"What type of testing was done: Respond to this question with \"TID\" for Total Ionizing Dose testing, \"SEE\" for heavy ion, proton, laser, or neutron testing, \"DD\" for displacement damage testing, or \"OTHER\" if you are not completely 100% sure",
1010
// In-progress prompts, bad results
11-
"If Total Ionizing Dose testing was performed, then list which of the following tests were done in a \"¶\" separated list: Co60, ELDRS, Protons, Electrons. Otherwise, reply N/A",
12-
"If single event effects testing using heavy ion, proton, laser, or neutron was done, then list which of the following tests were done in a \"¶\" separated list: Reply SEU for single event upset, SET for single event transient, SEFI for single event functional interrupt, SEL for single event latchup, SEB for single event burnout, SEGR for gate rupture, Dose rate for dose rate. Otherwise, reply N/A",
13-
"If displacement damage testing was performed, then list which of the following tests were conducted in a \"¶\" separated list: Reply \"Protons\" for proton damage, \"Neutrons\" for neutron damage. Otherwise, reply N/A",
11+
// "If Total Ionizing Dose testing was performed, then list which of the following tests were done in a \"¶\" separated list: Co60, ELDRS, Protons, Electrons. Otherwise, reply N/A",
12+
// "If single event effects testing using heavy ion, proton, laser, or neutron was done, then list which of the following tests were done in a \"¶\" separated list: Reply SEU for single event upset, SET for single event transient, SEFI for single event functional interrupt, SEL for single event latchup, SEB for single event burnout, SEGR for gate rupture, Dose rate for dose rate. Otherwise, reply N/A",
13+
// "If displacement damage testing was performed, then list which of the following tests were conducted in a \"¶\" separated list: Reply \"Protons\" for proton damage, \"Neutrons\" for neutron damage. Otherwise, reply N/A",
1414

15-
"Summarize the paper's test results with a strong emphasis on the data collected from the tests",
16-
"Reference the page number for each answer for the above questions in a \"¶\" separated list. If you are unable to give a page number or the answer is N/A, provide the answer N/A"
15+
"Summarize the paper's test results in 3 lines",
16+
// "Reference the page number for each answer for the above questions in a \"¶\" separated list. If you are unable to give a page number or the answer is N/A, provide the answer N/A"
1717
];
1818

1919
export const prompt = `Please answer the following questions, as concisely as possible, and with a heavy emphasis on numbers instead of words.\n
20-
Use standard text.
20+
Use standard text and do not provide citations for any answer.
2121
If you are unable to answer the question accurately, provide the answer N/A.
2222
Answer each question, and separate the answers with a "ø" character as a delimiter.\n`;
2323

server/test/gpt-controller.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ test("Insertion of a paper with one author", async () => {
3333
await expect(testGPT.runGPTAnalysis([paper])).resolves.not.toThrow();
3434
}, 60000);
3535

36-
test('Insertion of a paper with five authors', async () => {
37-
const paper: string = path.resolve(__dirname,
38-
'./testfiles/SEE_in-flight_data_for_two_static_32KB_memories_on_high_earth_orbit.pdf');
39-
fs.readFileSync(paper);
36+
// test('Insertion of a paper with five authors', async () => {
37+
// const paper: string = path.resolve(__dirname,
38+
// './testfiles/SEE_in-flight_data_for_two_static_32KB_memories_on_high_earth_orbit.pdf');
39+
// fs.readFileSync(paper);
4040

41-
await expect(testGPT.runGPTAnalysis([paper])).resolves.not.toThrow();
42-
}, 60000);
41+
// await expect(testGPT.runGPTAnalysis([paper])).resolves.not.toThrow();
42+
// }, 60000);
4343

4444
// Below gpt tests commented out to reduce token usage during testing
4545

0 commit comments

Comments
 (0)