Skip to content

Commit 6af2d52

Browse files
committed
remove isError.ts
1 parent 97c9886 commit 6af2d52

File tree

3 files changed

+2
-11
lines changed

3 files changed

+2
-11
lines changed

src/server/routes/ai/v1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ import express from 'express'
22
import { DEFAULT_TOKEN_LIMIT, FREE_MODEL, inProduction } from '../../../config'
33
import { ChatInstance, Discussion, UserChatInstanceUsage } from '../../db/models'
44
import { calculateUsage, checkCourseUsage, checkUsage, incrementCourseUsage, incrementUsage } from '../../services/chatInstances/usage'
5-
import type { RequestWithUser } from '../../types'
5+
import type { APIError, RequestWithUser } from '../../types'
66
import { getCompletionEvents, streamCompletion } from '../../util/azure/client'
77
import logger from '../../util/logger'
8-
import { isError } from '../../util/isError'
98
import getEncoding from '../../util/tiktoken'
109
import { getMessageContext, getModelContextLimit } from '../../util/util'
1110
import { ApplicationError } from '../../util/ApplicationError'
@@ -86,6 +85,7 @@ router.post('/stream', upload.single('file'), async (r, res) => {
8685

8786
const events = await getCompletionEvents(options)
8887

88+
const isError = (events: any): events is APIError => 'error' in events
8989
if (isError(events)) {
9090
throw new ApplicationError('Error creating a response stream', 424)
9191
}

src/server/util/config.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,3 @@ const grandFunded = 'hy-grant-funded-researchers'
6262
export const accessIams = [basicUserIam, powerUserIam, employeeIam, grandFunded]
6363

6464
export const tikeIam = 'hy-tike-allstaff'
65-
66-
export const DEFAULT_RAG_SYSTEM_PROMPT = `
67-
You are a helpful AI assistant designed to answer questions related to the course material, which you can access using the file search tool. Your responses should be concise, relevant, and based on the provided course files.
68-
If you cannot find the answer in the files, you should indicate that you do not have enough information to answer the question.
69-
You can still give your best guess based on your training, but make it clear that the answer is not based on the course material.
70-
`

src/server/util/isError.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)