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