Skip to content

Commit

Permalink
fixes for linter and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswilty committed Feb 1, 2024
1 parent 1b96d76 commit 6b2a707
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion backend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
NODE_ENV: ${NODE_ENV:-development}
OPENAI_API_KEY: ${OPENAI_API_KEY}
SESSION_SECRET: ${SESSION_SECRET}
CORS_ALLOW_ORIGIN: "${CORS_ALLOW_ORIGIN:-*}"
CORS_ALLOW_ORIGIN: '${CORS_ALLOW_ORIGIN:-*}'
PORT: 3001
build: .
image: 'scottlogic/prompt-injection-api'
Expand Down
7 changes: 1 addition & 6 deletions backend/src/models/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,4 @@ export type {
FunctionCallResponse,
ToolCallResponse,
};
export {
CHAT_MODELS,
CHAT_MESSAGE_TYPE,
MODEL_CONFIG,
defaultChatModel,
};
export { CHAT_MODELS, CHAT_MESSAGE_TYPE, MODEL_CONFIG, defaultChatModel };
1 change: 0 additions & 1 deletion backend/src/nonSessionRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ router.get('/health', handleHealthCheck);
router.get('/systemRoles', handleGetSystemRoles);

export default router;

4 changes: 2 additions & 2 deletions backend/src/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ function getChatCompletionsFromHistory(
const completions: ChatCompletionMessageParam[] =
chatHistory.length > 0
? (chatHistory
.filter((message) => message.completion !== null)
.map((message) => message.completion) as ChatCompletionMessageParam[])
.filter((message) => message.completion !== null)
.map((message) => message.completion) as ChatCompletionMessageParam[])
: [];

console.debug(
Expand Down
6 changes: 4 additions & 2 deletions backend/src/sessionRoutes.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dotenv/config';
import express from 'express';
import session from 'express-session';
import memoryStoreFactory from 'memorystore';
import 'dotenv/config';

import {
handleChatToGPT,
Expand Down Expand Up @@ -40,7 +40,9 @@ declare module 'express-session' {

const sessionSigningSecret = process.env.SESSION_SECRET;
if (!sessionSigningSecret) {
console.error("SESSION_SECRET not found in environment vars, cannot continue!");
console.error(
'SESSION_SECRET not found in environment vars, cannot continue!'
);
process.exit(1);
}

Expand Down

0 comments on commit 6b2a707

Please sign in to comment.