mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-10-12 12:39:52 +08:00
feat(settings): reorganize the settings dialog and the model settings
Tabs Models, General, Drawing and About, each with a fixed title row. The models tab becomes three pages: the user's providers with one status each and the server's models; a searchable picker of all 24 providers in four groups; and a provider page in three steps (connection, models, test). A new provider gets its first suggested model, and a passing test offers to use the model in the chat. Bedrock asks for one way of signing in, with an optional session token for temporary access keys. The composer's model picker lists every model, marking untested and failed ones, and can open the provider picker. A chat error that offers model settings opens the provider the request went to.
This commit is contained in:
@@ -51,14 +51,14 @@ test("the Test button checks all models at once and shows each result", async ({
|
||||
await page.getByTestId("model-selector").click()
|
||||
await page.getByText("Configure Models...").click()
|
||||
const dialog = page.locator('[role="dialog"]')
|
||||
await dialog.getByText("GLM (Zhipu)").first().click()
|
||||
await dialog.getByRole("button", { name: "Test", exact: true }).click()
|
||||
await dialog.getByTestId("provider-row-p1").click()
|
||||
await dialog.getByTestId("test-models").click()
|
||||
|
||||
await expect(
|
||||
dialog.getByText("answered without calling a tool"),
|
||||
).toBeVisible({ timeout: 15000 })
|
||||
await expect(dialog.getByText("Model not found")).toBeVisible()
|
||||
await expect(dialog.locator('[title="1.2 s"]')).toBeVisible()
|
||||
await expect(dialog.getByText("Works · 1.2 s")).toBeVisible()
|
||||
expect(started.sort()).toEqual([
|
||||
"model-broken",
|
||||
"model-no-tools",
|
||||
@@ -78,7 +78,7 @@ test("the key link and the base URL cleanup", async ({ page }) => {
|
||||
await page.getByTestId("model-selector").click()
|
||||
await page.getByText("Configure Models...").click()
|
||||
const dialog = page.locator('[role="dialog"]')
|
||||
await dialog.getByText("GLM (Zhipu)").first().click()
|
||||
await dialog.getByTestId("provider-row-p1").click()
|
||||
|
||||
await expect(
|
||||
dialog.getByRole("link", { name: "Get API key" }),
|
||||
@@ -86,6 +86,8 @@ test("the key link and the base URL cleanup", async ({ page }) => {
|
||||
"href",
|
||||
"https://open.bigmodel.cn/usercenter/proj-mgmt/apikeys",
|
||||
)
|
||||
// The base URL is under "More options"
|
||||
await dialog.getByRole("button", { name: /^More options/ }).click()
|
||||
const baseUrl = dialog.locator("#base-url")
|
||||
await baseUrl.fill("https://proxy.example.com/v4/chat/completions/")
|
||||
await baseUrl.blur()
|
||||
|
||||
Reference in New Issue
Block a user