Skip to content

Commit

Permalink
Fixed missing publicity message error
Browse files Browse the repository at this point in the history
  • Loading branch information
Catrovitch committed Aug 30, 2024
1 parent caa9088 commit 683bfcf
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions src/server/routes/llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,18 @@ llmRouter.post('/validation', async (req, res) => {
})

llmRouter.post('/step1', async (req, res) => {
const { inventiveMessage, industrialMessage, publicMessage } = req.body
const { inventiveMessage, industrialMessage, publicityMessage } = req.body

if (!inventiveMessage || !industrialMessage || !publicMessage) {
return res
.status(400)
.json({
error: 'Missing inventiveMessage, industrialMessage, or publicMessage',
})
if (!inventiveMessage || !industrialMessage || !publicityMessage) {
return res.status(400).json({
error: 'Missing inventiveMessage, industrialMessage, or publicMessage',
})
}

const messages: Message[] = []

const userMessage = createUserMessage(
`The idea is: ${inventiveMessage} *** Novelty for critical analysis: ${publicMessage} *** Industry relevance: ${industrialMessage}`,
`The idea is: ${inventiveMessage} *** Novelty for critical analysis: ${publicityMessage} *** Industry relevance: ${industrialMessage}`,
3
)

Expand Down Expand Up @@ -129,11 +127,9 @@ llmRouter.post('/step4', async (req, res) => {
const { aiResponse1, aiResponse2, aiResponse3, messages } = req.body

if (!aiResponse1 || !aiResponse2 || !aiResponse3 || !messages) {
return res
.status(400)
.json({
error: 'Missing aiResponse1, aiResponse2, aiResponse3, or messages',
})
return res.status(400).json({
error: 'Missing aiResponse1, aiResponse2, aiResponse3, or messages',
})
}

const finalPrompt = `${aiResponse1} \nINDUSTRY APPLICABILITY: ${aiResponse2} \nCLAIMS: ${aiResponse3}`
Expand Down

0 comments on commit 683bfcf

Please sign in to comment.