Copilot commented on code in PR #1343: URL: https://github.com/apache/dubbo-admin/pull/1343#discussion_r2507680952
########## ui-vue3/vite.config.ts: ########## @@ -22,36 +22,36 @@ import vueJsx from '@vitejs/plugin-vue-jsx' // https://vitejs.dev/config/ export default defineConfig({ - base: '/admin', - build: { - outDir: './dist/admin', + base: '/admin', + build: { + outDir: './dist/admin' + }, + server: { + port: 8881, Review Comment: [nitpick] Missing space after colon in port configuration. Should be `port: 8881,` for consistency with the rest of the codebase. ########## ai/utils/utils_test.go: ########## @@ -0,0 +1,89 @@ +package utils_test + +import ( + "context" + "dubbo-admin-ai/config" + "dubbo-admin-ai/manager" + "dubbo-admin-ai/plugins/dashscope" + "dubbo-admin-ai/tools" + "dubbo-admin-ai/utils" + "fmt" + "testing" + + "github.com/tmc/langchaingo/textsplitter" +) + +func TestMdCleaner(t *testing.T) { + mdPath := "/Users/liwener/programming/ospp/dubbo-admin/ai/reference/k8s_docs/concepts/overview/kubernetes-api.md" + cleaned, err := utils.CleanMarkdownFile(mdPath) + if err != nil { + t.Fatalf("err: %v\n", err) + } + fmt.Printf("清洗后的内容:\n%s\n", cleaned) +} + +func TestMdChunks(t *testing.T) { + mdPath := "/Users/liwener/programming/ospp/dubbo-admin/ai/reference/k8s_docs/concepts/overview/kubernetes-api.md" + cleaned, err := utils.CleanMarkdownFile(mdPath) + if err != nil { + t.Fatalf("err: %v\n", err) + } + splitter := textsplitter.NewRecursiveCharacter( + textsplitter.WithChunkSize(1000), + textsplitter.WithChunkOverlap(100), + textsplitter.WithSeparators([]string{"\r\n\r\n", "\n\n", "\r\n", "\n", " ", ""}), + ) + + chunks, err := splitter.SplitText(cleaned) + if err != nil { + t.Fatalf("err: %v\n", err) + } + for i, chunk := range chunks { + fmt.Printf("第 %d 个chunk:\n%s\n\n", i+1, chunk) + } +} + +func TestMdChunksInDir(t *testing.T) { + mdDir := "/Users/liwener/programming/ospp/dubbo-admin/ai/reference/k8s_docs/concepts/overview" Review Comment: The hardcoded absolute path in test files should be replaced with a relative path or environment variable to make tests portable across different development environments. ########## ui-vue3/src/main.ts: ########## @@ -28,6 +28,7 @@ import './api/mock/index' import Vue3ColorPicker from 'vue3-colorpicker' import 'vue3-colorpicker/style.css' import 'nprogress/nprogress.css' +import './style.css' Review Comment: [nitpick] Extra space before import statement. This import should align with other imports without leading space. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
