chore: clean up
This commit is contained in:
parent
1de98873c1
commit
8cc24df902
@ -108,7 +108,7 @@ export const test = base.extend<
|
||||
})
|
||||
|
||||
test.beforeAll(async () => {
|
||||
await rmSync(path.join(__dirname, '../../test-data'), {
|
||||
rmSync(path.join(__dirname, '../../test-data'), {
|
||||
recursive: true,
|
||||
force: true,
|
||||
})
|
||||
@ -122,5 +122,5 @@ test.beforeAll(async () => {
|
||||
})
|
||||
|
||||
test.afterAll(async () => {
|
||||
teardownElectron()
|
||||
// teardownElectron()
|
||||
})
|
||||
|
||||
@ -2,11 +2,8 @@ import { expect } from '@playwright/test'
|
||||
import { page, test, TIMEOUT } from '../config/fixtures'
|
||||
|
||||
test('renders left navigation panel', async () => {
|
||||
const settingsBtn = await page
|
||||
.getByTestId('Thread')
|
||||
.first()
|
||||
.isEnabled({ timeout: TIMEOUT })
|
||||
expect([settingsBtn].filter((e) => !e).length).toBe(0)
|
||||
const threadBtn = page.getByTestId('Thread').first()
|
||||
await expect(threadBtn).toBeVisible({ timeout: TIMEOUT })
|
||||
// Chat section should be there
|
||||
await page.getByTestId('Local API Server').first().click({
|
||||
timeout: TIMEOUT,
|
||||
|
||||
@ -158,7 +158,7 @@ export const useCreateNewThread = () => {
|
||||
//TODO: Why do we have thread list then thread states? Should combine them
|
||||
try {
|
||||
const createdThread = await persistNewThread(thread, assistantInfo)
|
||||
if (!createdThread) throw 'Thread creation failed'
|
||||
if (!createdThread) throw 'Thread created failed.'
|
||||
createNewThread(createdThread)
|
||||
|
||||
setSelectedModel(defaultModel)
|
||||
|
||||
@ -33,7 +33,7 @@ const nextConfig = {
|
||||
ANALYTICS_ID: JSON.stringify(process.env.ANALYTICS_ID),
|
||||
ANALYTICS_HOST: JSON.stringify(process.env.ANALYTICS_HOST),
|
||||
API_BASE_URL: JSON.stringify(
|
||||
process.env.API_BASE_URL ?? 'http://localhost:1337'
|
||||
process.env.API_BASE_URL ?? 'http://127.0.0.1:39291'
|
||||
),
|
||||
isMac: process.platform === 'darwin',
|
||||
isWindows: process.platform === 'win32',
|
||||
|
||||
@ -55,7 +55,7 @@ const MessageToolbar = ({ message }: { message: ThreadMessage }) => {
|
||||
.slice(-1)[0]
|
||||
|
||||
if (thread) {
|
||||
// Should also delete error messages to clear out the error state
|
||||
// TODO: Should also delete error messages to clear out the error state
|
||||
await extensionManager
|
||||
.get<ConversationalExtension>(ExtensionTypeEnum.Conversational)
|
||||
?.deleteMessage(thread.id, message.id)
|
||||
|
||||
@ -81,10 +81,7 @@ const ThreadLeftPanel = () => {
|
||||
)
|
||||
const selectedModel = model[0] || recommendedModel
|
||||
requestCreateNewThread(
|
||||
{
|
||||
...assistants[0],
|
||||
...activeAssistant,
|
||||
},
|
||||
{ ...assistants[0], ...activeAssistant },
|
||||
selectedModel
|
||||
)
|
||||
} else if (threadDataReady && !activeThreadId) {
|
||||
|
||||
@ -176,9 +176,7 @@ const ThreadRightPanel = () => {
|
||||
|
||||
const onValueChanged = useCallback(
|
||||
(key: string, value: string | number | boolean | string[]) => {
|
||||
if (!activeThread || !activeAssistant) {
|
||||
return
|
||||
}
|
||||
if (!activeThread || !activeAssistant) return
|
||||
|
||||
setEngineParamsUpdate(true)
|
||||
resetModel()
|
||||
|
||||
@ -30,9 +30,13 @@ export const getFileInfoFromFile = async (
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* This function creates an Uppy instance with XHR plugin for file upload to the server.
|
||||
* @returns Uppy instance
|
||||
*/
|
||||
export const uploader = () => {
|
||||
const uppy = new Uppy().use(XHR, {
|
||||
endpoint: 'http://127.0.0.1:39291/v1/files',
|
||||
endpoint: `${API_BASE_URL}/v1/files`,
|
||||
method: 'POST',
|
||||
fieldName: 'file',
|
||||
formData: true,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user