├── docker └── middleware │ ├── kibana │ └── data │ │ └── .gitkeep │ ├── elasticsearch │ └── data │ │ └── .gitkeep │ ├── conf │ ├── rocketmq │ │ └── rmq-proxy.json │ ├── mysql │ │ └── my.cnf │ └── loongcollector │ │ └── otlp_pipeline.yaml │ ├── stop.sh │ ├── mysql.env │ ├── env.template │ └── run.sh ├── frontend ├── .husky │ └── pre-commit ├── packages │ ├── spark-flow │ │ ├── docs │ │ │ └── .gitkeep │ │ ├── src │ │ │ ├── index.less │ │ │ ├── demos │ │ │ │ └── flow-demo │ │ │ │ │ ├── nodes │ │ │ │ │ ├── IteratorEnd │ │ │ │ │ │ ├── panel.tsx │ │ │ │ │ │ ├── node.tsx │ │ │ │ │ │ └── schema.tsx │ │ │ │ │ ├── IteratorStart │ │ │ │ │ │ ├── panel.tsx │ │ │ │ │ │ ├── node.tsx │ │ │ │ │ │ └── schema.tsx │ │ │ │ │ ├── Iterator │ │ │ │ │ │ ├── panel.tsx │ │ │ │ │ │ └── node.tsx │ │ │ │ │ ├── End │ │ │ │ │ │ └── node.tsx │ │ │ │ │ ├── Output │ │ │ │ │ │ └── node.tsx │ │ │ │ │ ├── VariableAssign │ │ │ │ │ │ └── node.tsx │ │ │ │ │ ├── Judge │ │ │ │ │ │ └── panel.tsx │ │ │ │ │ ├── Start │ │ │ │ │ │ ├── node.tsx │ │ │ │ │ │ └── schema.tsx │ │ │ │ │ ├── VariableHandle │ │ │ │ │ │ └── node.tsx │ │ │ │ │ ├── ParameterExtractor │ │ │ │ │ │ └── node.tsx │ │ │ │ │ ├── Api │ │ │ │ │ │ └── node.tsx │ │ │ │ │ ├── LLM │ │ │ │ │ │ └── node.tsx │ │ │ │ │ └── Script │ │ │ │ │ │ └── node.tsx │ │ │ │ │ ├── index.less │ │ │ │ │ ├── components │ │ │ │ │ ├── Icon │ │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── InfoIcon │ │ │ │ │ │ ├── index.less │ │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── ModelConfigForm │ │ │ │ │ │ └── index.less │ │ │ │ │ ├── ExtractParamEditModal │ │ │ │ │ │ └── index.less │ │ │ │ │ ├── WorkFlowHeader │ │ │ │ │ │ └── index.less │ │ │ │ │ ├── RetryForm │ │ │ │ │ │ └── index.less │ │ │ │ │ ├── TestPanel │ │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── GroupVariableForm │ │ │ │ │ │ └── index.less │ │ │ │ │ ├── ExtractParamItem │ │ │ │ │ │ └── index.less │ │ │ │ │ └── SingleNodeDrawer │ │ │ │ │ │ └── index.less │ │ │ │ │ └── index.md │ │ │ ├── flow │ │ │ │ └── animate.css │ │ │ ├── components │ │ │ │ ├── CustomIcon │ │ │ │ │ └── index.tsx │ │ │ │ ├── BranchTitleHeader │ │ │ │ │ └── index.less │ │ │ │ ├── JudgeForm │ │ │ │ │ └── index.less │ │ │ │ ├── ScriptCodeMirror │ │ │ │ │ └── index.less │ │ │ │ ├── NodeResizer │ │ │ │ │ └── index.less │ │ │ │ ├── SelectWithDesc │ │ │ │ │ ├── index.less │ │ │ │ │ └── index.tsx │ │ │ │ ├── VariableInput │ │ │ │ │ └── index.less │ │ │ │ ├── FlowMiniMap │ │ │ │ │ ├── index.less │ │ │ │ │ └── index.tsx │ │ │ │ ├── FlowPanel │ │ │ │ │ └── index.tsx │ │ │ │ ├── DraggableWithHandle │ │ │ │ │ └── index.less │ │ │ │ ├── DragPanel │ │ │ │ │ └── index.less │ │ │ │ ├── ScriptEditModal │ │ │ │ │ └── index.less │ │ │ │ ├── FlowIcon │ │ │ │ │ └── index.less │ │ │ │ ├── CustomInputsControl │ │ │ │ │ └── index.less │ │ │ │ ├── ConditionItem │ │ │ │ │ └── index.less │ │ │ │ ├── VarTypePrefix │ │ │ │ │ └── index.tsx │ │ │ │ ├── FlowBaseEdge │ │ │ │ │ └── index.less │ │ │ │ ├── OutputParamsTree │ │ │ │ │ └── index.less │ │ │ │ ├── InputTextArea │ │ │ │ │ └── index.less │ │ │ │ └── CustomHandle │ │ │ │ │ └── TargetHandle.tsx │ │ │ ├── i18n │ │ │ │ └── index.ts │ │ │ ├── hooks │ │ │ │ ├── index.ts │ │ │ │ ├── useFlowDebugInteraction.tsx │ │ │ │ └── useWorkFlow.tsx │ │ │ └── utils │ │ │ │ └── defaultValues.ts │ │ ├── postcss.config.js │ │ ├── .gitignore │ │ ├── .fatherrc.ts │ │ ├── tailwind.config.js │ │ ├── tailwind.css │ │ ├── tsconfig.json │ │ └── .dumirc.ts │ ├── main │ │ ├── src │ │ │ ├── legacy │ │ │ │ ├── utils │ │ │ │ │ └── .gitkeep │ │ │ │ ├── components │ │ │ │ │ └── .gitkeep │ │ │ │ ├── context │ │ │ │ │ ├── .gitkeep │ │ │ │ │ └── models.ts │ │ │ │ ├── services │ │ │ │ │ ├── .gitkeep │ │ │ │ │ ├── const.ts │ │ │ │ │ ├── model │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── typing.ts │ │ │ │ │ └── index.ts │ │ │ │ ├── pages │ │ │ │ │ ├── evaluation │ │ │ │ │ │ └── evaluator │ │ │ │ │ │ │ ├── evaluator-debug │ │ │ │ │ │ │ └── doc.md │ │ │ │ │ │ │ └── evaluator-detail │ │ │ │ │ │ │ ├── index.css │ │ │ │ │ │ │ └── doc.md │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── prompts │ │ │ │ │ │ └── prompt-detail │ │ │ │ │ │ └── hooks │ │ │ │ │ │ └── useFunctions.ts │ │ │ │ └── index.jsx │ │ │ ├── request │ │ │ │ ├── index.ts │ │ │ │ ├── index.module.less │ │ │ │ └── download.ts │ │ │ ├── components │ │ │ │ ├── Search │ │ │ │ │ └── index.module.less │ │ │ │ ├── Icon │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── IconFile.tsx │ │ │ │ ├── ModelConfigForm │ │ │ │ │ └── index.module.less │ │ │ │ ├── ExpandBtn │ │ │ │ │ ├── index.module.less │ │ │ │ │ └── index.tsx │ │ │ │ ├── Tag │ │ │ │ │ ├── FileTag.module.less │ │ │ │ │ └── StatusTag.module.less │ │ │ │ ├── SliderInput │ │ │ │ │ └── index.module.less │ │ │ │ ├── Table │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── index.module.less │ │ │ │ ├── Filter │ │ │ │ │ ├── index.module.less │ │ │ │ │ └── index.tsx │ │ │ │ ├── AccountModal │ │ │ │ │ └── index.module.less │ │ │ │ └── ScrollMenu │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── index.module.less │ │ │ ├── pages │ │ │ │ ├── MCP │ │ │ │ │ ├── Manage.module.less │ │ │ │ │ ├── Detail.module.less │ │ │ │ │ ├── components │ │ │ │ │ │ ├── McpTools │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ └── McpCard │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ └── index.tsx │ │ │ │ ├── Setting │ │ │ │ │ ├── ModelService │ │ │ │ │ │ ├── index.module.less │ │ │ │ │ │ └── components │ │ │ │ │ │ │ ├── ModelConfigModal │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ └── ProviderAvatar │ │ │ │ │ │ │ ├── index.module.less │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── Account │ │ │ │ │ │ ├── components │ │ │ │ │ │ │ └── UserEditModal │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ └── index.module.less │ │ │ │ │ └── APIKeys │ │ │ │ │ │ └── index.module.less │ │ │ │ ├── App │ │ │ │ │ ├── Workflow │ │ │ │ │ │ ├── nodes │ │ │ │ │ │ │ ├── Judge │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ ├── Script │ │ │ │ │ │ │ │ ├── index.module.less │ │ │ │ │ │ │ │ └── node.tsx │ │ │ │ │ │ │ ├── Iterator │ │ │ │ │ │ │ │ └── node.tsx │ │ │ │ │ │ │ ├── MCP │ │ │ │ │ │ │ │ └── node.tsx │ │ │ │ │ │ │ ├── Output │ │ │ │ │ │ │ │ └── node.tsx │ │ │ │ │ │ │ ├── Parallel │ │ │ │ │ │ │ │ └── node.tsx │ │ │ │ │ │ │ ├── InputNode │ │ │ │ │ │ │ │ └── node.tsx │ │ │ │ │ │ │ ├── Retrieval │ │ │ │ │ │ │ │ ├── node.tsx │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ ├── AppComponent │ │ │ │ │ │ │ │ ├── index.module.less │ │ │ │ │ │ │ │ └── node.tsx │ │ │ │ │ │ │ ├── VariableAssign │ │ │ │ │ │ │ │ └── node.tsx │ │ │ │ │ │ │ ├── End │ │ │ │ │ │ │ │ └── node.tsx │ │ │ │ │ │ │ ├── Start │ │ │ │ │ │ │ │ ├── node.tsx │ │ │ │ │ │ │ │ └── schema.tsx │ │ │ │ │ │ │ ├── VariableHandle │ │ │ │ │ │ │ │ └── node.tsx │ │ │ │ │ │ │ ├── IteratorEnd │ │ │ │ │ │ │ │ ├── node.tsx │ │ │ │ │ │ │ │ └── schema.tsx │ │ │ │ │ │ │ ├── ParallelEnd │ │ │ │ │ │ │ │ ├── node.tsx │ │ │ │ │ │ │ │ └── schema.tsx │ │ │ │ │ │ │ ├── ParameterExtractor │ │ │ │ │ │ │ │ └── node.tsx │ │ │ │ │ │ │ ├── IteratorStart │ │ │ │ │ │ │ │ ├── node.tsx │ │ │ │ │ │ │ │ └── schema.tsx │ │ │ │ │ │ │ ├── ParallelStart │ │ │ │ │ │ │ │ ├── node.tsx │ │ │ │ │ │ │ │ └── schema.tsx │ │ │ │ │ │ │ ├── LLM │ │ │ │ │ │ │ │ └── node.tsx │ │ │ │ │ │ │ ├── APINode │ │ │ │ │ │ │ │ └── node.tsx │ │ │ │ │ │ │ └── PluginNode │ │ │ │ │ │ │ │ └── node.tsx │ │ │ │ │ │ ├── components │ │ │ │ │ │ │ ├── ShortMemoryForm │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ ├── HistoryConfigModal │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ ├── InfoIcon │ │ │ │ │ │ │ │ ├── index.module.less │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── UserInputForm │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ ├── TestPanel │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ ├── ChatTestPanel │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ ├── ExtractParamEditModal │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ ├── AuthConfigFormModal │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ ├── ParallelConfigForm │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ ├── GlobalVariableFormModal │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ ├── RetryForm │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ ├── GroupVariableForm │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ ├── ExtractParamItem │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ └── TaskResultShowBtn │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ └── hooks │ │ │ │ │ │ │ └── useInitDebug.ts │ │ │ │ │ ├── components │ │ │ │ │ │ ├── Card │ │ │ │ │ │ │ ├── index.module.less │ │ │ │ │ │ │ └── Status.module.less │ │ │ │ │ │ └── PluginSelector │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ └── AssistantAppEdit │ │ │ │ │ │ └── components │ │ │ │ │ │ ├── VarConfigDrawer │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ ├── AssistantPromptEditor │ │ │ │ │ │ ├── eventBus.ts │ │ │ │ │ │ └── Variables │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ ├── AgentCompSelector │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ ├── MCPSelectorComp │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ ├── WorkFlowSelectorComp │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ ├── SparkChat │ │ │ │ │ │ └── components │ │ │ │ │ │ │ ├── Steps │ │ │ │ │ │ │ ├── Reasoning │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ └── Plugin │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ └── Welcome │ │ │ │ │ │ │ └── index.less │ │ │ │ │ │ ├── ExperienceConfigDrawer │ │ │ │ │ │ └── components │ │ │ │ │ │ │ ├── common.module.less │ │ │ │ │ │ │ └── guideText │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ ├── AppStatus │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ ├── AppConfigDiffModal │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ └── KnowledgeSelectorComp │ │ │ │ │ │ └── index.module.less │ │ │ │ ├── Knowledge │ │ │ │ │ ├── Detail │ │ │ │ │ │ ├── components │ │ │ │ │ │ │ ├── ChunkItem │ │ │ │ │ │ │ │ └── type.ts │ │ │ │ │ │ │ ├── FileList │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ ├── ChunkEditDrawer │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ ├── ChunkViewDrawer │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ └── Search │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ ├── index.module.less │ │ │ │ │ │ ├── SliceConfiguration │ │ │ │ │ │ │ ├── index.module.less │ │ │ │ │ │ │ └── components │ │ │ │ │ │ │ │ └── Form │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ └── SliceEditing │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ ├── Test │ │ │ │ │ │ ├── index.module.less │ │ │ │ │ │ └── components │ │ │ │ │ │ │ ├── ChunkList │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ └── Form │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ ├── components │ │ │ │ │ │ ├── ModelSelector │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ ├── StepThree │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ └── StepOne │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ ├── utils │ │ │ │ │ │ └── constant.ts │ │ │ │ │ ├── List │ │ │ │ │ │ ├── index.module.less │ │ │ │ │ │ └── components │ │ │ │ │ │ │ └── Card │ │ │ │ │ │ │ └── type.ts │ │ │ │ │ └── Editor │ │ │ │ │ │ └── index.module.less │ │ │ │ ├── Component │ │ │ │ │ ├── Plugin │ │ │ │ │ │ ├── Info │ │ │ │ │ │ │ ├── Create.tsx │ │ │ │ │ │ │ ├── index.module.less │ │ │ │ │ │ │ └── Edit.tsx │ │ │ │ │ │ ├── components │ │ │ │ │ │ │ ├── OutputParamsConfig │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ ├── ExpandBtn │ │ │ │ │ │ │ │ ├── index.module.less │ │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ │ ├── InputParamsConfig │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ ├── HeadersEditForm │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ │ └── ExampleConfigForm │ │ │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ ├── List │ │ │ │ │ │ │ ├── index.module.less │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ │ └── Tools │ │ │ │ │ │ │ └── Field.tsx │ │ │ │ │ └── AppComponent │ │ │ │ │ │ └── components │ │ │ │ │ │ ├── OutputParamsComp │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ ├── Card │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ ├── DetailDrawer │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ ├── EditDrawer │ │ │ │ │ │ └── index.module.less │ │ │ │ │ │ └── InputParamsComp │ │ │ │ │ │ └── index.module.less │ │ │ │ ├── Login │ │ │ │ │ ├── components │ │ │ │ │ │ ├── Form │ │ │ │ │ │ │ ├── Email.module.less │ │ │ │ │ │ │ ├── Password.module.less │ │ │ │ │ │ │ ├── Email.tsx │ │ │ │ │ │ │ └── Password.tsx │ │ │ │ │ │ └── Login │ │ │ │ │ │ │ └── GithubLogin.tsx │ │ │ │ │ └── index.module.less │ │ │ │ └── Debug │ │ │ │ │ └── components │ │ │ │ │ └── ChatInterface.tsx │ │ │ ├── types │ │ │ │ ├── common.ts │ │ │ │ ├── base.ts │ │ │ │ ├── apiKey.ts │ │ │ │ └── workflow.ts │ │ │ ├── layouts │ │ │ │ ├── index.tsx │ │ │ │ ├── LoginProvider.tsx │ │ │ │ └── Header.tsx │ │ │ ├── services │ │ │ │ ├── globalConfig.ts │ │ │ │ ├── login.ts │ │ │ │ └── difyConverter.ts │ │ │ ├── i18n │ │ │ │ └── index.ts │ │ │ ├── typings.d.ts │ │ │ ├── defaultSettings.ts │ │ │ └── utils │ │ │ │ └── uniqueId.ts │ │ ├── typings.d.ts │ │ ├── public │ │ │ └── images │ │ │ │ ├── SSE.png │ │ │ │ ├── txt.png │ │ │ │ ├── word.png │ │ │ │ ├── avatar.png │ │ │ │ ├── enlarge.png │ │ │ │ ├── general.png │ │ │ │ ├── loginBg.png │ │ │ │ ├── logoBlack.png │ │ │ │ ├── logoWhite.png │ │ │ │ ├── moreIcon.png │ │ │ │ ├── createAgent.png │ │ │ │ ├── createFlow.png │ │ │ │ ├── createFlowDark.png │ │ │ │ ├── defaultAvatar.png │ │ │ │ ├── logoBlack.png.bak │ │ │ │ ├── congratulations.png │ │ │ │ ├── createAgentDark.png │ │ │ │ ├── suggestQuestion.png │ │ │ │ ├── require.svg │ │ │ │ └── panelResizeHandle.svg │ │ ├── .gitignore │ │ ├── tsconfig.json │ │ ├── tailwind.config.js │ │ ├── .env.example │ │ └── tailwind.css │ └── spark-i18n │ │ ├── tsconfig.json │ │ ├── src │ │ └── config │ │ │ ├── work-station-app.js │ │ │ └── spark-flow.js │ │ └── package.json ├── .npmrc ├── .gitignore ├── .npmignore ├── .prettierignore ├── .dockerignore ├── .editorconfig ├── .eslintrc.js ├── .prettierrc.js ├── .stylelintrc.js └── Dockerfile ├── spring-ai-alibaba-admin-server-start ├── model-config.yml ├── .dockerignore ├── src │ └── main │ │ ├── resources │ │ ├── static │ │ │ ├── favicon.ico │ │ │ └── index.html │ │ ├── META-INF │ │ │ └── spring.factories │ │ ├── templates │ │ │ ├── GraphBuilder.java.mustache │ │ │ └── AgentBuilder.java.mustache │ │ ├── elasticsearch.yml │ │ └── application-dev.yml.example │ │ └── java │ │ └── com │ │ └── alibaba │ │ └── cloud │ │ └── ai │ │ └── studio │ │ └── admin │ │ ├── dto │ │ ├── EvaluatorDebugResult.java │ │ ├── EvaluationObjectConfig.java │ │ ├── VariableMapItem.java │ │ ├── TraceDetailDTO.java │ │ ├── EvaluationPromptConfigVariableMap.java │ │ ├── ServicesResponseDTO.java │ │ ├── ServiceInfoDTO.java │ │ ├── MockToolDefinition.java │ │ ├── SpanEventDTO.java │ │ ├── EvaluationPromptConfig.java │ │ ├── SpanLinkDTO.java │ │ ├── EvaluatorConfig.java │ │ ├── request │ │ │ ├── EvaluatorTemplateListRequest.java │ │ │ ├── OverviewQueryRequest.java │ │ │ ├── ServicesQueryRequest.java │ │ │ ├── EvaluatorTestRequest.java │ │ │ ├── DatasetExperimentsListRequest.java │ │ │ ├── EvaluatorCreateRequest.java │ │ │ ├── EvaluatorVersionUpdateRequest.java │ │ │ ├── ExperimentListRequest.java │ │ │ ├── EvaluatorUpdateRequest.java │ │ │ ├── DatasetVersionListRequest.java │ │ │ ├── EvaluatorListRequest.java │ │ │ ├── DatasetListRequest.java │ │ │ ├── EvaluatorExperimentsListRequest.java │ │ │ ├── DatasetItemListRequest.java │ │ │ ├── EvaluatorVersionListRequest.java │ │ │ ├── DatasetItemUpdateRequest.java │ │ │ ├── DatasetVersionUpdateRequest.java │ │ │ ├── ExperimentEvaluatorResultDetailListRequest.java │ │ │ ├── ModelConfigQueryRequest.java │ │ │ ├── DatasetItemCreateRequest.java │ │ │ ├── DatasetCreateRequest.java │ │ │ ├── DatasetUpdateRequest.java │ │ │ ├── DataItemCreateFromTraceRequest.java │ │ │ ├── EvaluatorVersionCreateRequest.java │ │ │ ├── DatasetVersionCreateRequest.java │ │ │ └── TracesQueryRequest.java │ │ ├── MockTool.java │ │ ├── ChatMessageMetrics.java │ │ ├── DatasetColumn.java │ │ ├── ExperimentEvaluatorResult.java │ │ ├── ModelParameterDef.java │ │ ├── OverviewStatsDTO.java │ │ └── TraceSpanDTO.java │ │ ├── entity │ │ ├── EvaluatorTemplateDO.java │ │ ├── EvaluatorDO.java │ │ └── DatasetItemDO.java │ │ ├── service │ │ ├── EvaluatorTemplateService.java │ │ ├── client │ │ │ └── ChatClientFactory.java │ │ ├── PromptRunService.java │ │ └── TracingService.java │ │ ├── mapper │ │ └── EvaluatorTemplateMapper.java │ │ ├── repository │ │ └── ModelConfigRepository.java │ │ ├── config │ │ └── NacosConfig.java │ │ ├── observation │ │ └── IgnoreStudioHttpSpanPredicate.java │ │ ├── builder │ │ └── generator │ │ │ ├── model │ │ │ └── chatbot │ │ │ │ └── ChatBot.java │ │ │ └── service │ │ │ └── runner │ │ │ └── RunnableModel.java │ │ └── exception │ │ └── ExceptionUtils.java ├── model-config-deepseek.yaml ├── model-config-openai.yaml └── model-config-dashscope.yaml ├── docs └── imgs │ └── arch.png ├── deploy ├── namespace.yaml └── kustomization.yaml ├── start.sh ├── spring-ai-alibaba-admin-server-core └── src │ ├── test │ └── resources │ │ └── multimodel │ │ └── dog_and_girl.jpeg │ └── main │ └── resources │ └── keys │ └── public.pem └── spring-ai-alibaba-admin-server-runtime └── src └── main └── java └── com └── alibaba └── cloud └── ai └── studio └── runtime └── domain └── workflow └── ParamSourceEnum.java /docker/middleware/kibana/data/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/.husky/pre-commit: -------------------------------------------------------------------------------- 1 | npx lint-staged -------------------------------------------------------------------------------- /frontend/packages/spark-flow/docs/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docker/middleware/elasticsearch/data/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/packages/main/src/legacy/utils/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/packages/main/src/legacy/components/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/packages/main/src/legacy/context/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/packages/main/src/legacy/services/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/packages/main/typings.d.ts: -------------------------------------------------------------------------------- 1 | import 'umi/typings'; 2 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/model-config.yml: -------------------------------------------------------------------------------- 1 | #请参照模型配置模版更新此文件 -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/index.less: -------------------------------------------------------------------------------- 1 | @ant-prefix: spark-ant; 2 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/nodes/IteratorEnd/panel.tsx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/nodes/IteratorStart/panel.tsx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/packages/main/src/legacy/services/const.ts: -------------------------------------------------------------------------------- 1 | export const API_PATH = "/api"; -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/index.less: -------------------------------------------------------------------------------- 1 | @ant-prefix: spark-ant; 2 | -------------------------------------------------------------------------------- /frontend/packages/main/src/request/index.ts: -------------------------------------------------------------------------------- 1 | export { default as request } from './request'; 2 | -------------------------------------------------------------------------------- /frontend/packages/main/src/components/Search/index.module.less: -------------------------------------------------------------------------------- 1 | .input { 2 | width: 320px; 3 | } 4 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/MCP/Manage.module.less: -------------------------------------------------------------------------------- 1 | .container { 2 | margin: 20px 0; 3 | } 4 | -------------------------------------------------------------------------------- /frontend/.npmrc: -------------------------------------------------------------------------------- 1 | legacy-peer-deps=true 2 | loglevel=error 3 | registry=https://registry.npmmirror.com/ 4 | -------------------------------------------------------------------------------- /frontend/packages/main/src/components/Icon/index.tsx: -------------------------------------------------------------------------------- 1 | export const iconFontUrl = '/iconfonts/index.js'; 2 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/MCP/Detail.module.less: -------------------------------------------------------------------------------- 1 | .tools-content { 2 | padding: 40px 0; 3 | } 4 | -------------------------------------------------------------------------------- /docs/imgs/arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-ai-alibaba/spring-ai-alibaba-admin/HEAD/docs/imgs/arch.png -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Setting/ModelService/index.module.less: -------------------------------------------------------------------------------- 1 | .container { 2 | padding: 20px 0; 3 | } 4 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/Judge/index.module.less: -------------------------------------------------------------------------------- 1 | .judge-label { 2 | font-size: 12px; 3 | } 4 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/components/Icon/index.tsx: -------------------------------------------------------------------------------- 1 | export const iconFontUrl = '/iconfonts/index.js'; 2 | -------------------------------------------------------------------------------- /frontend/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .history 3 | .DS_Store 4 | *.module.css 5 | *.module.css.map 6 | .cursor/** 7 | .env 8 | .vscode -------------------------------------------------------------------------------- /frontend/.npmignore: -------------------------------------------------------------------------------- 1 | **/*.test.* 2 | test/ 3 | .husky 4 | .prettierrc 5 | .npmrc 6 | jest.config.js 7 | tsconfig.json 8 | abc.json 9 | -------------------------------------------------------------------------------- /frontend/packages/main/src/types/common.ts: -------------------------------------------------------------------------------- 1 | export interface IApiResponse { 2 | data: T; 3 | request_id: string; 4 | } 5 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/components/ShortMemoryForm/index.module.less: -------------------------------------------------------------------------------- 1 | .slider-selector { 2 | margin: 0 !important; 3 | } -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Knowledge/Detail/components/ChunkItem/type.ts: -------------------------------------------------------------------------------- 1 | export type ChunkItemMode = 'simple' | 'detail' | 'edit'; 2 | -------------------------------------------------------------------------------- /frontend/packages/main/src/legacy/services/model/index.ts: -------------------------------------------------------------------------------- 1 | import { request } from '../../utils/request'; 2 | import { API_PATH } from '../const'; -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/components/HistoryConfigModal/index.module.less: -------------------------------------------------------------------------------- 1 | .slider-selector { 2 | margin: 0 !important; 3 | } -------------------------------------------------------------------------------- /deploy/namespace.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: spring-ai-admin 5 | labels: 6 | name: spring-ai-admin 7 | 8 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/components/Card/index.module.less: -------------------------------------------------------------------------------- 1 | .logo { 2 | width: 32px; 3 | height: 32px; 4 | border-radius: 6px; 5 | } 6 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/components/InfoIcon/index.less: -------------------------------------------------------------------------------- 1 | .info-icon { 2 | color: var(--ag-ant-color-text-tertiary); 3 | } 4 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/flow/animate.css: -------------------------------------------------------------------------------- 1 | @property --angle { 2 | syntax: ''; 3 | initial-value: 0deg; 4 | inherits: false; 5 | } -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/components/InfoIcon/index.module.less: -------------------------------------------------------------------------------- 1 | .info-icon { 2 | color: var(--ag-ant-color-text-tertiary); 3 | } 4 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Knowledge/Test/index.module.less: -------------------------------------------------------------------------------- 1 | .container { 2 | display: flex; 3 | flex-wrap: nowrap; 4 | height: 100%; 5 | } 6 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | .dumi/tmp 4 | .dumi/tmp-test 5 | .dumi/tmp-production 6 | .DS_Store 7 | design 8 | docs-dist -------------------------------------------------------------------------------- /frontend/.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .umi 3 | .umi-production 4 | dist 5 | .mfsu 6 | *.d.ts 7 | *.js 8 | *.md 9 | *.yaml 10 | *.less 11 | .dumi/tmp -------------------------------------------------------------------------------- /docker/middleware/conf/rocketmq/rmq-proxy.json: -------------------------------------------------------------------------------- 1 | { 2 | "rocketMQClusterName": "DefaultCluster", 3 | "remotingListenPort": 18080, 4 | "grpcServerPort": 18081 5 | } -------------------------------------------------------------------------------- /frontend/packages/main/public/images/SSE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-ai-alibaba/spring-ai-alibaba-admin/HEAD/frontend/packages/main/public/images/SSE.png -------------------------------------------------------------------------------- /frontend/packages/main/public/images/txt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-ai-alibaba/spring-ai-alibaba-admin/HEAD/frontend/packages/main/public/images/txt.png -------------------------------------------------------------------------------- /frontend/packages/main/public/images/word.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-ai-alibaba/spring-ai-alibaba-admin/HEAD/frontend/packages/main/public/images/word.png -------------------------------------------------------------------------------- /docker/middleware/stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Stop containers with docker compose 4 | echo "Stopping containers with docker compose..." 5 | docker compose down 6 | 7 | -------------------------------------------------------------------------------- /frontend/packages/main/public/images/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-ai-alibaba/spring-ai-alibaba-admin/HEAD/frontend/packages/main/public/images/avatar.png -------------------------------------------------------------------------------- /frontend/packages/main/public/images/enlarge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-ai-alibaba/spring-ai-alibaba-admin/HEAD/frontend/packages/main/public/images/enlarge.png -------------------------------------------------------------------------------- /frontend/packages/main/public/images/general.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-ai-alibaba/spring-ai-alibaba-admin/HEAD/frontend/packages/main/public/images/general.png -------------------------------------------------------------------------------- /frontend/packages/main/public/images/loginBg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-ai-alibaba/spring-ai-alibaba-admin/HEAD/frontend/packages/main/public/images/loginBg.png -------------------------------------------------------------------------------- /frontend/packages/main/public/images/logoBlack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-ai-alibaba/spring-ai-alibaba-admin/HEAD/frontend/packages/main/public/images/logoBlack.png -------------------------------------------------------------------------------- /frontend/packages/main/public/images/logoWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-ai-alibaba/spring-ai-alibaba-admin/HEAD/frontend/packages/main/public/images/logoWhite.png -------------------------------------------------------------------------------- /frontend/packages/main/public/images/moreIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-ai-alibaba/spring-ai-alibaba-admin/HEAD/frontend/packages/main/public/images/moreIcon.png -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Component/Plugin/Info/Create.tsx: -------------------------------------------------------------------------------- 1 | import Index from './index'; 2 | 3 | export default function () { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /docker/middleware/mysql.env: -------------------------------------------------------------------------------- 1 | MYSQL_ROOT_PASSWORD=root 2 | MYSQL_DATABASE=admin 3 | MYSQL_USER=admin 4 | MYSQL_PASSWORD=admin 5 | LANG=C.UTF-8 6 | # 设置MySQL容器时区为上海 7 | TZ=Asia/Shanghai -------------------------------------------------------------------------------- /frontend/packages/main/public/images/createAgent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-ai-alibaba/spring-ai-alibaba-admin/HEAD/frontend/packages/main/public/images/createAgent.png -------------------------------------------------------------------------------- /frontend/packages/main/public/images/createFlow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-ai-alibaba/spring-ai-alibaba-admin/HEAD/frontend/packages/main/public/images/createFlow.png -------------------------------------------------------------------------------- /frontend/packages/main/src/types/base.ts: -------------------------------------------------------------------------------- 1 | export type FileType = 'PDF' | 'MD' | 'Excel' | 'PPT'; 2 | export type TaskStatus = 'uploaded' | 'processing' | 'processed' | 'failed'; 3 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/index.md: -------------------------------------------------------------------------------- 1 | # Spark Flow 2 | 3 | ```jsx 4 | import SparkFlowDemo from './'; 5 | 6 | export default () => ; 7 | ``` 8 | -------------------------------------------------------------------------------- /frontend/packages/main/public/images/createFlowDark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-ai-alibaba/spring-ai-alibaba-admin/HEAD/frontend/packages/main/public/images/createFlowDark.png -------------------------------------------------------------------------------- /frontend/packages/main/public/images/defaultAvatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-ai-alibaba/spring-ai-alibaba-admin/HEAD/frontend/packages/main/public/images/defaultAvatar.png -------------------------------------------------------------------------------- /frontend/packages/main/public/images/logoBlack.png.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-ai-alibaba/spring-ai-alibaba-admin/HEAD/frontend/packages/main/public/images/logoBlack.png.bak -------------------------------------------------------------------------------- /frontend/packages/main/src/request/index.module.less: -------------------------------------------------------------------------------- 1 | .error { 2 | :global(.ag-ant-notification-notice-icon-error) { 3 | font-size: 16px !important; 4 | margin: 5px; 5 | } 6 | } -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/components/CustomIcon/index.tsx: -------------------------------------------------------------------------------- 1 | import { IconFont } from '@spark-ai/design'; 2 | import { memo } from 'react'; 3 | 4 | export default memo(IconFont); 5 | -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd docker/middleware/ 3 | docker compose up -d --build 4 | sleep 5 5 | cd ../../spring-ai-alibaba-admin-server-start 6 | mvn clean install -DskipTests 7 | 8 | -------------------------------------------------------------------------------- /frontend/packages/main/public/images/congratulations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-ai-alibaba/spring-ai-alibaba-admin/HEAD/frontend/packages/main/public/images/congratulations.png -------------------------------------------------------------------------------- /frontend/packages/main/public/images/createAgentDark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-ai-alibaba/spring-ai-alibaba-admin/HEAD/frontend/packages/main/public/images/createAgentDark.png -------------------------------------------------------------------------------- /frontend/packages/main/public/images/suggestQuestion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-ai-alibaba/spring-ai-alibaba-admin/HEAD/frontend/packages/main/public/images/suggestQuestion.png -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/.dockerignore: -------------------------------------------------------------------------------- 1 | target 2 | .git 3 | .gitignore 4 | README.md 5 | README-zh.md 6 | .DS_Store 7 | *.log 8 | .idea 9 | .vscode 10 | *.iml 11 | 12 | -------------------------------------------------------------------------------- /frontend/packages/main/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env.local 3 | .umirc.local.ts 4 | config/config.local.ts 5 | src/.umi 6 | src/.umi-production 7 | src/.umi-test 8 | dist 9 | .swc 10 | -------------------------------------------------------------------------------- /docker/middleware/conf/mysql/my.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | character-set-server=utf8mb4 3 | collation-server=utf8mb4_unicode_ci 4 | slow_query_log=1 5 | log_queries_not_using_indexes=1 6 | default-time-zone='+8:00' -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/components/UserInputForm/index.module.less: -------------------------------------------------------------------------------- 1 | .form { 2 | background: var(--ag-ant-color-fill-tertiary); 3 | padding: 16px; 4 | border-radius: 8px; 5 | } 6 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/AssistantAppEdit/components/VarConfigDrawer/index.module.less: -------------------------------------------------------------------------------- 1 | .desc { 2 | font-size: 12px; 3 | color: var(--ag-ant-color-text-description); 4 | line-height: 16px; 5 | } 6 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/Script/index.module.less: -------------------------------------------------------------------------------- 1 | .script-code-mirror-container { 2 | :global { 3 | .cm-theme, 4 | .cm-editor { 5 | height: 240px; 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/components/TestPanel/index.module.less: -------------------------------------------------------------------------------- 1 | .testTypeSelector { 2 | :global { 3 | .ag-ant-select-selector { 4 | padding-left: 0 !important; 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Component/AppComponent/components/OutputParamsComp/index.module.less: -------------------------------------------------------------------------------- 1 | .key-label { 2 | font-size: 12px; 3 | line-height: 20px; 4 | color: var(--ag-ant-color-text-secondary); 5 | } 6 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Knowledge/Detail/components/FileList/index.module.less: -------------------------------------------------------------------------------- 1 | .operation-btn { 2 | padding: 0; 3 | height: 24px; 4 | font-size: 14px; 5 | font-weight: 500; 6 | line-height: 24px; 7 | } 8 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/resources/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-ai-alibaba/spring-ai-alibaba-admin/HEAD/spring-ai-alibaba-admin-server-start/src/main/resources/static/favicon.ico -------------------------------------------------------------------------------- /frontend/packages/main/src/components/ModelConfigForm/index.module.less: -------------------------------------------------------------------------------- 1 | .model-selector-form-label { 2 | color: var(--ag-ant-color-text-secondary); 3 | font-size: 13px; 4 | font-weight: 500; 5 | line-height: 20px; 6 | } 7 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/components/PluginSelector/index.module.less: -------------------------------------------------------------------------------- 1 | 2 | 3 | .topDesc { 4 | margin: 12px 0; 5 | font-size: 12px; 6 | line-height: 20px; 7 | color: var(--ag-ant-color-text-description); 8 | } 9 | -------------------------------------------------------------------------------- /frontend/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | .git 4 | .gitignore 5 | README.md 6 | README.zh-CN.md 7 | .env 8 | .env.local 9 | .DS_Store 10 | *.log 11 | dist 12 | .umi 13 | .husky 14 | .vscode 15 | .idea 16 | 17 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Knowledge/components/ModelSelector/index.module.less: -------------------------------------------------------------------------------- 1 | .opt-item { 2 | display: flex; 3 | align-items: center; 4 | gap: 8px; 5 | .opt-title { 6 | line-height: 20px; 7 | } 8 | } -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-core/src/test/resources/multimodel/dog_and_girl.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-ai-alibaba/spring-ai-alibaba-admin/HEAD/spring-ai-alibaba-admin-server-core/src/test/resources/multimodel/dog_and_girl.jpeg -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/AssistantAppEdit/components/AssistantPromptEditor/eventBus.ts: -------------------------------------------------------------------------------- 1 | import { createEventBus } from '@/pages/App/utils/event-bus'; 2 | 3 | export const promptEventBus = createEventBus('bailian-prompt-editor'); 4 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/AssistantAppEdit/components/AgentCompSelector/index.module.less: -------------------------------------------------------------------------------- 1 | .expandBtn { 2 | color: var(--ag-ant-color-text); 3 | cursor: pointer; 4 | 5 | &.hidden { 6 | transform: rotate(180deg); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/AssistantAppEdit/components/MCPSelectorComp/index.module.less: -------------------------------------------------------------------------------- 1 | .expand-btn { 2 | color: var(--ag-ant-color-text); 3 | cursor: pointer; 4 | 5 | &.hidden { 6 | transform: rotate(180deg); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/AssistantAppEdit/components/WorkFlowSelectorComp/index.module.less: -------------------------------------------------------------------------------- 1 | .expandBtn { 2 | color: var(--ag-ant-color-text); 3 | cursor: pointer; 4 | 5 | &.hidden { 6 | transform: rotate(180deg); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Knowledge/utils/constant.ts: -------------------------------------------------------------------------------- 1 | // @ts-nocheck 2 | export function areIndexStatusesEqual(data) { 3 | const firstStatus = data[0].index_status; 4 | return data.every((item) => item.index_status === firstStatus); 5 | } 6 | -------------------------------------------------------------------------------- /frontend/.editorconfig: -------------------------------------------------------------------------------- 1 | 2 | # 🎨 editorconfig.org 3 | 4 | root = true 5 | 6 | [*] 7 | charset = utf-8 8 | end_of_line = lf 9 | indent_style = space 10 | indent_size = 2 11 | trim_trailing_whitespace = true 12 | insert_final_newline = true 13 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | io.spring.initializr.generator.project.ProjectGenerationConfiguration=\ 2 | com.alibaba.cloud.ai.studio.admin.builder.generator.config.GraphProjectGenerationConfiguration 3 | -------------------------------------------------------------------------------- /frontend/packages/main/src/legacy/services/model/typing.ts: -------------------------------------------------------------------------------- 1 | declare namespace ModelAPI { 2 | interface GetModelListResult { 3 | id: string 4 | provider: string, 5 | maxTokens: number, 6 | capabilities: string[], 7 | name: string 8 | } 9 | } -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Component/Plugin/components/OutputParamsConfig/index.module.less: -------------------------------------------------------------------------------- 1 | .label { 2 | color: var(--ag-ant-color-text-secondary); 3 | } 4 | 5 | .error-tip { 6 | white-space: nowrap; 7 | color: var(--ag-ant-color-error); 8 | } 9 | -------------------------------------------------------------------------------- /frontend/packages/main/src/components/ExpandBtn/index.module.less: -------------------------------------------------------------------------------- 1 | .expandBtn { 2 | transition-duration: 0.2s; 3 | 4 | &.expand { 5 | transform: rotate(90deg); 6 | } 7 | 8 | &.top.expand { 9 | transform: rotate(180deg); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/.fatherrc.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'father'; 2 | 3 | export default defineConfig({ 4 | // more father config: https://github.com/umijs/father/blob/master/docs/config.md 5 | esm: { 6 | output: 'dist', 7 | }, 8 | }); 9 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Login/components/Form/Email.module.less: -------------------------------------------------------------------------------- 1 | .prefix-icon { 2 | font-size: 20px; 3 | color: var(--ag-ant-color-text-tertiary); 4 | margin-right: 8px; 5 | } 6 | 7 | .email { 8 | height: 48px; 9 | border-radius: 6px 6px 0 0; 10 | } 11 | -------------------------------------------------------------------------------- /frontend/packages/main/src/layouts/index.tsx: -------------------------------------------------------------------------------- 1 | import { Outlet } from 'umi'; 2 | import SideMenuLayout from './SideMenuLayout'; 3 | 4 | export default function Layout() { 5 | return ( 6 | 7 | 8 | 9 | ); 10 | } 11 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Component/Plugin/components/ExpandBtn/index.module.less: -------------------------------------------------------------------------------- 1 | .expandBtn { 2 | transition-duration: 0.2s; 3 | 4 | &.expand { 5 | transform: rotate(90deg); 6 | } 7 | 8 | &.top.expand { 9 | transform: rotate(180deg); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Login/index.module.less: -------------------------------------------------------------------------------- 1 | .container { 2 | display: flex; 3 | justify-content: center; 4 | width: 863px; 5 | height: 796px; 6 | margin: 56px auto 0 auto; 7 | background-image: url("/images/loginBg.png"); 8 | background-size: cover; 9 | } 10 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/components/BranchTitleHeader/index.less: -------------------------------------------------------------------------------- 1 | .spark-flow-logic-selector { 2 | width: 66px; 3 | } 4 | 5 | .spark-flow-name-input-ok-btn { 6 | color: var(--ag-ant-color-teal); 7 | 8 | &:hover { 9 | color: var(--ag-ant-color-teal); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/AssistantAppEdit/components/SparkChat/components/Steps/Reasoning/index.tsx: -------------------------------------------------------------------------------- 1 | import { Markdown } from '@spark-ai/chat'; 2 | 3 | export default (props: { reasoning: string }) => { 4 | return ; 5 | }; 6 | -------------------------------------------------------------------------------- /frontend/packages/main/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./src/.umi/tsconfig.json", 3 | "compilerOptions": { 4 | "allowJs": true, 5 | "baseUrl": ".", 6 | "paths": { 7 | "@/*": ["src/*"], 8 | "@src/*": ["src/*"] 9 | } 10 | }, 11 | "include": ["src"] 12 | } 13 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/components/JudgeForm/index.less: -------------------------------------------------------------------------------- 1 | .spark-flow-judge-form-add-branch-btn { 2 | width: 100%; 3 | background: var(--ag-ant-color-bg-layout); 4 | } 5 | 6 | .spark-flow-judge-form-delete-btn-wrap { 7 | line-height: 1; 8 | align-self: flex-start; 9 | } 10 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/components/ModelConfigForm/index.less: -------------------------------------------------------------------------------- 1 | @import '../../index.less'; 2 | 3 | .spark-model-selector-form-label { 4 | color: e('var(--@{ant-prefix}-color-text-secondary)'); 5 | font-size: 13px; 6 | font-weight: 500; 7 | line-height: 20px; 8 | } 9 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/AssistantAppEdit/components/ExperienceConfigDrawer/components/common.module.less: -------------------------------------------------------------------------------- 1 | .section { 2 | margin-bottom: 24px; 3 | } 4 | 5 | .sectionTitle { 6 | font-size: 13px; 7 | font-weight: 500; 8 | line-height: 24px; 9 | margin-bottom: 12px; 10 | } 11 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Component/AppComponent/components/Card/index.module.less: -------------------------------------------------------------------------------- 1 | .bottom { 2 | font-size: 12px; 3 | line-height: 20px; 4 | color: var(--ag-ant-color-text-secondary); 5 | } 6 | 7 | .logo { 8 | width: 32px; 9 | height: 32px; 10 | border-radius: 6px; 11 | } 12 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/components/ScriptCodeMirror/index.less: -------------------------------------------------------------------------------- 1 | .script-code-mirror { 2 | border-radius: 6px; 3 | 4 | :global { 5 | .cm-editor { 6 | border-radius: 6px; 7 | } 8 | 9 | .cm-gutters { 10 | border-radius: 6px 0 0 6px; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/nodes/Iterator/panel.tsx: -------------------------------------------------------------------------------- 1 | import React, { memo, useState } from 'react'; 2 | 3 | export default memo(function IteratorPanel() { 4 | const [state, setState] = useState({ 5 | loading: false, 6 | }); 7 | return
IteratorPanel
; 8 | }); 9 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Knowledge/Detail/index.module.less: -------------------------------------------------------------------------------- 1 | .container { 2 | height: 100%; 3 | padding-bottom: 16px; 4 | overflow-y: auto; 5 | } 6 | 7 | .list { 8 | margin-top: 16px; 9 | } 10 | 11 | .pagination { 12 | margin-top: 30px; 13 | justify-content: flex-end; 14 | } 15 | -------------------------------------------------------------------------------- /frontend/packages/main/tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | content: [ 3 | './src/**/*.{js,jsx,ts,tsx}', 4 | '../spark-flow/dist/**/*.{js,jsx}', 5 | ], 6 | theme: { 7 | extend: {}, 8 | }, 9 | plugins: [], 10 | corePlugins: { 11 | preflight: false, 12 | }, 13 | }; 14 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Component/Plugin/components/InputParamsConfig/index.module.less: -------------------------------------------------------------------------------- 1 | .item * { 2 | flex-shrink: 0; 3 | } 4 | 5 | .error-tip { 6 | white-space: nowrap; 7 | color: var(--ag-ant-color-error); 8 | } 9 | 10 | .label { 11 | color: var(--ag-ant-color-text-secondary); 12 | } 13 | -------------------------------------------------------------------------------- /frontend/packages/main/.env.example: -------------------------------------------------------------------------------- 1 | # Web server URL 2 | WEB_SERVER="http://127.0.0.1:8080" 3 | 4 | # Backend type, e.g., java, python 5 | BACK_END="java" 6 | 7 | # Default username for application login 8 | DEFAULT_USERNAME=saa 9 | 10 | # Default password for application login 11 | DEFAULT_PASSWORD=123456 12 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/components/ChatTestPanel/index.module.less: -------------------------------------------------------------------------------- 1 | .header { 2 | justify-content: flex-end; 3 | padding: 12px 16px; 4 | } 5 | 6 | .chat-container { 7 | :global { 8 | .ag-ant-chat-anywhere-layout-right { 9 | background: transparent; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Login/components/Form/Password.module.less: -------------------------------------------------------------------------------- 1 | .prefix-icon { 2 | font-size: 20px; 3 | color: var(--ag-ant-color-text-tertiary); 4 | margin-right: 8px; 5 | } 6 | 7 | .password { 8 | position: relative; 9 | top: -1px; 10 | height: 48px; 11 | border-radius: 0 0 6px 6px; 12 | } 13 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/EvaluatorDebugResult.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto; 2 | 3 | 4 | import lombok.Data; 5 | 6 | @Data 7 | public class EvaluatorDebugResult { 8 | private String score; 9 | 10 | private String reason; 11 | } 12 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/components/ExtractParamEditModal/index.module.less: -------------------------------------------------------------------------------- 1 | .spark-flow-horizontal-form-item { 2 | :global { 3 | .ag-ant-form-item-label { 4 | text-align: left; 5 | flex: 1; 6 | } 7 | 8 | .ag-ant-form-item-control { 9 | flex: initial; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/components/NodeResizer/index.less: -------------------------------------------------------------------------------- 1 | .spark-flow-node-resizer { 2 | border-style: none !important; 3 | background: transparent !important; 4 | border: 1px solid red; 5 | 6 | &-icon { 7 | position: absolute; 8 | right: 1px; 9 | bottom: 1px; 10 | line-height: 1; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /frontend/packages/main/src/legacy/pages/evaluation/evaluator/evaluator-debug/doc.md: -------------------------------------------------------------------------------- 1 | # 调试页面 2 | 3 | ## 该页面分为两个区域 4 | 5 | ### 左侧展示评估器配置信息, 包括 6 | 7 | - 模型 8 | - promot 9 | - 参数 10 | 11 | ### 右侧为沟槽测试数据区域, 包含三个输入区域 12 | 13 | - input 必传 14 | - output 必传 15 | - reference_output 可选 16 | 支持清空和运行, 运行后需要展示评测结果, 运行调用 debugEvaluator 接口 17 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/components/AuthConfigFormModal/index.module.less: -------------------------------------------------------------------------------- 1 | .valueInput { 2 | :global { 3 | .spark-flow-var-input-text-area { 4 | height: 120px; 5 | } 6 | } 7 | } 8 | 9 | .form { 10 | :global { 11 | .ag-ant-form-item { 12 | margin-bottom: 16px; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/Iterator/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode, NodeProps } from '@spark-ai/flow'; 2 | import { GroupNode } from '@spark-ai/flow'; 3 | import { memo } from 'react'; 4 | 5 | export default memo(function IteratorNode(props: NodeProps) { 6 | return ; 7 | }); 8 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/MCP/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode, NodeProps } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { memo } from 'react'; 4 | 5 | export default memo(function MCPNode(props: NodeProps) { 6 | return ; 7 | }); 8 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/Output/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode, NodeProps } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { memo } from 'react'; 4 | 5 | export default memo(function Output(props: NodeProps) { 6 | return ; 7 | }); 8 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/Parallel/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode, NodeProps } from '@spark-ai/flow'; 2 | import { GroupNode } from '@spark-ai/flow'; 3 | import { memo } from 'react'; 4 | 5 | export default memo(function ParallelNode(props: NodeProps) { 6 | return ; 7 | }); 8 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/EvaluationObjectConfig.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class EvaluationObjectConfig { 7 | 8 | private String type; 9 | 10 | private String config; 11 | 12 | } 13 | 14 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/InputNode/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode, NodeProps } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { memo } from 'react'; 4 | 5 | export default memo(function InputNode(props: NodeProps) { 6 | return ; 7 | }); 8 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/components/ExtractParamEditModal/index.less: -------------------------------------------------------------------------------- 1 | @import '../../index.less'; 2 | 3 | .spark-flow-horizontal-form-item { 4 | .@{ant-prefix}-form-item-label { 5 | text-align: left; 6 | flex: 1; 7 | } 8 | 9 | .@{ant-prefix}-form-item-control { 10 | flex: initial; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /docker/middleware/env.template: -------------------------------------------------------------------------------- 1 | # User ID and Group ID for containers 2 | # These will be automatically set by run.sh, or you can set them manually 3 | UID=1000 4 | GID=1000 5 | 6 | # Timezone 7 | TZ=Asia/Shanghai 8 | 9 | # Default values 10 | # Set this to the absolute path if you want to use a different location 11 | MIDDLEWARE_HOME=. 12 | 13 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/Retrieval/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode, NodeProps } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { memo } from 'react'; 4 | 5 | export default memo(function RetrievalNode(props: NodeProps) { 6 | return ; 7 | }); 8 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/nodes/Iterator/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode, NodeProps } from '@spark-ai/flow'; 2 | import { GroupNode } from '@spark-ai/flow'; 3 | import React, { memo } from 'react'; 4 | 5 | export default memo(function IteratorNode(props: NodeProps) { 6 | return ; 7 | }); 8 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/AssistantAppEdit/components/ExperienceConfigDrawer/components/guideText/index.module.less: -------------------------------------------------------------------------------- 1 | .textAreaWrapper { 2 | position: relative; 3 | } 4 | 5 | .textArea { 6 | :global { 7 | .ag-ant-input { 8 | min-height: 80px; 9 | max-height: 160px; 10 | resize: vertical; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/AppComponent/index.module.less: -------------------------------------------------------------------------------- 1 | .app-component-name { 2 | flex: 1; 3 | font-size: 12px; 4 | color: var(--ag-ant-color-text-base); 5 | } 6 | 7 | .app-component-item { 8 | height: 32px; 9 | padding: 0 8px; 10 | background: var(--ag-ant-color-fill-tertiary); 11 | border-radius: 6px; 12 | } 13 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/AppComponent/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode, NodeProps } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { memo } from 'react'; 4 | 5 | export default memo(function AppComponentNode(props: NodeProps) { 6 | return ; 7 | }); 8 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/VariableAssign/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode, NodeProps } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { memo } from 'react'; 4 | 5 | export default memo(function VariableAssign(props: NodeProps) { 6 | return ; 7 | }); 8 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/VariableMapItem.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class VariableMapItem { 7 | private String evaluatorVariable; 8 | private String source; 9 | private String dataSource; 10 | } 11 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/End/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode, NodeProps } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { memo } from 'react'; 4 | 5 | export default memo(function EndNode(props: NodeProps) { 6 | return ; 7 | }); 8 | -------------------------------------------------------------------------------- /frontend/packages/main/src/services/globalConfig.ts: -------------------------------------------------------------------------------- 1 | import { request } from '@/request'; 2 | 3 | export async function getGlobalConfig() { 4 | const res = await request({ 5 | method: 'GET', 6 | url: '/console/v1/system/global-config', 7 | }); 8 | 9 | const globalConfig = res.data.data; 10 | window.g_config.config = globalConfig; 11 | } 12 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/TraceDetailDTO.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | @Builder 10 | public class TraceDetailDTO { 11 | 12 | private List records; 13 | } -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/Start/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode, NodeProps } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { memo } from 'react'; 4 | 5 | export default memo(function StartNode(props: NodeProps) { 6 | return ; 7 | }); 8 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Knowledge/Detail/SliceConfiguration/index.module.less: -------------------------------------------------------------------------------- 1 | .container { 2 | display: flex; 3 | flex-wrap: nowrap; 4 | height: 100%; 5 | } 6 | 7 | .footer { 8 | width: 100%; 9 | display: flex; 10 | align-items: center; 11 | gap: 12px; 12 | background: var(--ag-ant-color-bg-base); 13 | box-sizing: border-box; 14 | } 15 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Knowledge/Detail/components/ChunkEditDrawer/index.module.less: -------------------------------------------------------------------------------- 1 | .footer { 2 | display: flex; 3 | align-items: center; 4 | justify-content: space-between; 5 | font-size: 14px; 6 | font-weight: normal; 7 | line-height: 24px; 8 | letter-spacing: normal; 9 | color: var(--ag-ant-color-text-tertiary); 10 | width: 100%; 11 | } -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/components/SelectWithDesc/index.less: -------------------------------------------------------------------------------- 1 | @import '../../index.less'; 2 | 3 | .spark-flow-select-with-desc-item { 4 | .spark-flow-select-with-desc-item-desc { 5 | color: e('var(--@{ant-prefix}-color-text-secondary)'); 6 | font-size: 12px; 7 | line-height: 18px; 8 | white-space: wrap; 9 | margin: 0; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/EvaluationPromptConfigVariableMap.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class EvaluationPromptConfigVariableMap { 7 | 8 | private String promptVariable; 9 | 10 | private String datasetVolumn; 11 | } 12 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/ServicesResponseDTO.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | @Builder 10 | public class ServicesResponseDTO { 11 | 12 | private List services; 13 | } -------------------------------------------------------------------------------- /frontend/packages/main/src/legacy/services/index.ts: -------------------------------------------------------------------------------- 1 | import * as evaluators from './evaluators'; 2 | import * as prompt from './prompt'; 3 | import * as model from './model'; 4 | import * as tracing from './tracing'; 5 | 6 | const API = { 7 | ...evaluators, 8 | ...prompt, 9 | ...model, 10 | observability: { 11 | ...tracing 12 | } 13 | }; 14 | 15 | export default API; -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Setting/Account/components/UserEditModal/index.module.less: -------------------------------------------------------------------------------- 1 | .section-title { 2 | font-size: 14px; 3 | font-weight: 500; 4 | color: var(--ag-ant-color-text); 5 | margin-top: 20px; 6 | margin-bottom: 16px; 7 | } 8 | 9 | .modal { 10 | padding: 20px; 11 | 12 | :global(.ag-ant-form-item) { 13 | margin-bottom: 8px; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/components/ParallelConfigForm/index.module.less: -------------------------------------------------------------------------------- 1 | .form { 2 | padding: 16px 16px 12px; 3 | background: var(--ag-ant-color-fill-tertiary); 4 | border-radius: 6px; 5 | 6 | .label-wrap { 7 | min-width: 120px; 8 | color: var(--ag-ant-color-text-secondary); 9 | font-size: 13px; 10 | font-weight: 500; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/VariableHandle/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode, NodeProps } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { memo } from 'react'; 4 | 5 | export default memo(function VariableHandleNode( 6 | props: NodeProps, 7 | ) { 8 | return ; 9 | }); 10 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/nodes/End/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { NodeProps } from '@xyflow/react'; 4 | import React, { memo } from 'react'; 5 | 6 | export default memo(function EndNode(props: NodeProps) { 7 | return ; 8 | }); 9 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/nodes/Output/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { NodeProps } from '@xyflow/react'; 4 | import React, { memo } from 'react'; 5 | 6 | export default memo(function Output(props: NodeProps) { 7 | return ; 8 | }); 9 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/i18n/index.ts: -------------------------------------------------------------------------------- 1 | import I18N from './i18n'; 2 | import enLangMap from './locales/en-us.json'; 3 | import jaLangMap from './locales/ja-jp.json'; 4 | import cnLangMap from './locales/zh-cn.json'; 5 | 6 | const multiLangMap = { 7 | zh: cnLangMap, 8 | en: enLangMap, 9 | ja: jaLangMap, 10 | }; 11 | 12 | export default new I18N({ multiLangMap }); 13 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/IteratorEnd/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode, NodeProps } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { memo } from 'react'; 4 | 5 | export default memo(function IteratorEndNode(props: NodeProps) { 6 | return ; 7 | }); 8 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/ParallelEnd/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode, NodeProps } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { memo } from 'react'; 4 | 5 | export default memo(function ParallelEndNode(props: NodeProps) { 6 | return ; 7 | }); 8 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/ParameterExtractor/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode, NodeProps } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { memo } from 'react'; 4 | 5 | export default memo(function ParameterExtractorNode( 6 | props: NodeProps, 7 | ) { 8 | return ; 9 | }); 10 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Component/Plugin/List/index.module.less: -------------------------------------------------------------------------------- 1 | .card { 2 | min-height: 166px; 3 | } 4 | 5 | .logo { 6 | width: 32px; 7 | height: 32px; 8 | border-radius: 6px; 9 | background-color: var(--ag-ant-color-bg-base); 10 | } 11 | 12 | .update-time { 13 | color: var(--ag-ant-color-text-secondary); 14 | font-size: 12px; 15 | line-height: 20px; 16 | } 17 | -------------------------------------------------------------------------------- /frontend/packages/main/src/components/Tag/FileTag.module.less: -------------------------------------------------------------------------------- 1 | .container { 2 | display: flex; 3 | align-items: center; 4 | gap: 8px; 5 | background: transparent; 6 | border-color: transparent; 7 | } 8 | 9 | .icon { 10 | width: 20px; 11 | height: 20px; 12 | } 13 | 14 | .text { 15 | color: var(--ag-ant-color-text-base); 16 | font-size: 14px; 17 | line-height: 24px; 18 | } 19 | -------------------------------------------------------------------------------- /frontend/packages/main/src/i18n/index.ts: -------------------------------------------------------------------------------- 1 | import I18N from '../../../spark-i18n/src/index'; 2 | import enLangMap from './locales/en-us.json'; 3 | import jaLangMap from './locales/ja-jp.json'; 4 | import cnLangMap from './locales/zh-cn.json'; 5 | 6 | const multiLangMap = { 7 | zh: cnLangMap, 8 | en: enLangMap, 9 | ja: jaLangMap, 10 | }; 11 | 12 | export default new I18N({ multiLangMap }); 13 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/MCP/components/McpTools/index.module.less: -------------------------------------------------------------------------------- 1 | .container { 2 | width: 80%; 3 | max-width: 960px; 4 | margin: 0 auto; 5 | 6 | :global { 7 | .ant-card { 8 | border: none; 9 | 10 | .ant-card-body { 11 | border-radius: 6px; 12 | } 13 | 14 | .spark-card-wrapper { 15 | padding: 0; 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/components/VariableInput/index.less: -------------------------------------------------------------------------------- 1 | @import '../../index.less'; 2 | .variable-input-container { 3 | display: flex; 4 | align-items: stretch; 5 | 6 | .@{ant-prefix}-cascader { 7 | height: auto; 8 | } 9 | 10 | .variable-type-select .@{ant-prefix}-select-selector { 11 | background-color: e('var(--@{ant-prefix}-color-bg-layout)'); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/nodes/VariableAssign/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { NodeProps } from '@xyflow/react'; 4 | import React, { memo } from 'react'; 5 | 6 | export default memo(function VariableAssign(props: NodeProps) { 7 | return ; 8 | }); 9 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/ServiceInfoDTO.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | @Builder 10 | public class ServiceInfoDTO { 11 | 12 | private String name; 13 | 14 | private List operations; 15 | } -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Component/Plugin/components/HeadersEditForm/index.module.less: -------------------------------------------------------------------------------- 1 | .form { 2 | background: var(--ag-ant-color-fill-quaternary); 3 | padding: 16px 20px; 4 | border-radius: 6px; 5 | 6 | .label { 7 | color: var(--ag-ant-color-text-secondary); 8 | font-size: 12px; 9 | } 10 | 11 | :global(.ag-ant-form-item) { 12 | margin-bottom: 4px; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/components/WorkFlowHeader/index.less: -------------------------------------------------------------------------------- 1 | @import '../../index.less'; 2 | 3 | .spark-flow-header { 4 | height: 64px; 5 | background: e('var(--@{ant-prefix}-color-bg-base)'); 6 | padding: 0 24px; 7 | flex-shrink: 0; 8 | border-bottom: 1px solid rgb(38 36 76 / 5%); 9 | 10 | &-item { 11 | width: calc((100% - 2rem - 160px) / 2); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | content: [ 3 | './src/**/*.{js,jsx,ts,tsx}', 4 | './docs/**/*.{md,mdx}', 5 | ], 6 | theme: { 7 | extend: { 8 | backgroundColor: { 9 | 'custom-blue': '#3B82F6', 10 | }, 11 | padding: { 12 | 'custom-padding': '1.5rem', 13 | }, 14 | }, 15 | }, 16 | plugins: [], 17 | }; 18 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Component/Plugin/Tools/Field.tsx: -------------------------------------------------------------------------------- 1 | import styles from './index.module.less'; 2 | 3 | export default function (props: { title: string; children: React.ReactNode }) { 4 | return ( 5 |
6 |
{props.title}
7 |
{props.children}
8 |
9 | ); 10 | } 11 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/nodes/Judge/panel.tsx: -------------------------------------------------------------------------------- 1 | import React, { memo } from 'react'; 2 | import { IJudgeNodeData } from '../../types/flow'; 3 | 4 | export default memo(function JudgePanel(props: { 5 | id: string; 6 | data: IJudgeNodeData; 7 | }) { 8 | return ( 9 | <> 10 |
{props.id}
11 | 12 | ); 13 | }); 14 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/nodes/Start/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { NodeProps } from '@xyflow/react'; 4 | import React, { memo } from 'react'; 5 | 6 | export default memo(function StartNode(props: NodeProps) { 7 | return ; 8 | }); 9 | -------------------------------------------------------------------------------- /frontend/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: require.resolve('umi/eslint'), 3 | rules: { 4 | '@typescript-eslint/no-unused-vars': 0, 5 | '@typescript-eslint/no-non-null-asserted-optional-chain': 0, 6 | 'no-case-declarations': 0, 7 | '@typescript-eslint/no-use-before-define': 0, 8 | '@typescript-eslint/no-unused-expressions': 0, 9 | 'no-useless-escape': 0, 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Knowledge/List/index.module.less: -------------------------------------------------------------------------------- 1 | .list { 2 | margin-top: 16px; 3 | } 4 | 5 | .pagination { 6 | margin-top: 30px; 7 | justify-content: flex-end; 8 | } 9 | 10 | .right { 11 | .addicon { 12 | font-size: 20px; 13 | color: var(--ag-ant-color-text-white); 14 | } 15 | 16 | :global { 17 | .ag-ant-btn-icon { 18 | height: 20px; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /frontend/packages/main/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | declare global { 2 | interface Window { 3 | g_config: { 4 | user: Partial<{ 5 | username: string; 6 | type: 'admin' | 'user'; 7 | }>, 8 | config: Partial<{ 9 | login_method: 'third_party' | 'preset_account'; 10 | upload_method: 'oss' | 'file'; 11 | }> 12 | } 13 | } 14 | } 15 | 16 | import 'umi/typings'; 17 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/IteratorStart/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode, NodeProps } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { memo } from 'react'; 4 | 5 | export default memo(function ParallelStartNode( 6 | props: NodeProps, 7 | ) { 8 | return ; 9 | }); 10 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/ParallelStart/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode, NodeProps } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { memo } from 'react'; 4 | 5 | export default memo(function ParallelStartNode( 6 | props: NodeProps, 7 | ) { 8 | return ; 9 | }); 10 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Component/Plugin/Info/index.module.less: -------------------------------------------------------------------------------- 1 | .container { 2 | max-width: 700px; 3 | width: 70%; 4 | padding: 40px 0; 5 | margin: 0 auto; 6 | } 7 | 8 | .title { 9 | font-size: 16px; 10 | font-weight: 400; 11 | color: var(--ag-ant-color-text-base); 12 | margin-bottom: 20px; 13 | } 14 | 15 | .bottom-bar { 16 | width: 70%; 17 | max-width: 700px; 18 | margin: 0 auto; 19 | } 20 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Knowledge/components/StepThree/index.module.less: -------------------------------------------------------------------------------- 1 | .step-three { 2 | .form-item-label { 3 | display: flex; 4 | align-items: center; 5 | gap: 4px; 6 | color: var(--ag-ant-color-text); 7 | } 8 | 9 | .info-icon { 10 | font-size: 16px; 11 | color: var(--ag-ant-color-text-tertiary); 12 | } 13 | 14 | .mcpInstallTypeItem { 15 | width: 314px; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Setting/ModelService/components/ModelConfigModal/index.module.less: -------------------------------------------------------------------------------- 1 | .container { 2 | padding: 0 16px; 3 | } 4 | 5 | .form-item { 6 | margin-bottom: 24px; 7 | 8 | .error { 9 | color: var(--ag-ant-color-error); 10 | font-size: 12px; 11 | margin-top: 4px; 12 | } 13 | } 14 | 15 | .capability-options { 16 | display: flex; 17 | flex-wrap: wrap; 18 | gap: 16px; 19 | } 20 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/components/GlobalVariableFormModal/index.module.less: -------------------------------------------------------------------------------- 1 | .add { 2 | width: 100%; 3 | margin-top: 12px; 4 | background: var(--ag-ant-color-bg-layout); 5 | } 6 | 7 | .form { 8 | height: 328px; 9 | overflow-y: auto; 10 | } 11 | 12 | .desc { 13 | font-size: 12px; 14 | font-weight: normal; 15 | line-height: 20px; 16 | color: var(--ag-ant-color-text-secondary); 17 | } 18 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Setting/Account/index.module.less: -------------------------------------------------------------------------------- 1 | .actions { 2 | display: flex; 3 | gap: 12px; 4 | color: var(--ag-ant-color-primary); 5 | font-weight: 500; 6 | } 7 | 8 | .disabled { 9 | color: var(--ag-ant-color-fill-disable); 10 | cursor: not-allowed; 11 | pointer-events: none; 12 | } 13 | 14 | .pagination { 15 | display: flex; 16 | justify-content: flex-end; 17 | width: 100%; 18 | } 19 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/nodes/VariableHandle/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { NodeProps } from '@xyflow/react'; 4 | import React, { memo } from 'react'; 5 | 6 | export default memo(function VariableHandleNode( 7 | props: NodeProps, 8 | ) { 9 | return ; 10 | }); 11 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Setting/ModelService/components/ProviderAvatar/index.module.less: -------------------------------------------------------------------------------- 1 | .avatar { 2 | font-size: 22px; 3 | font-weight: 600; 4 | color: var(--ag-ant-color-primary); 5 | background-color: var(--ag-ant-color-primary-bg); 6 | display: flex; 7 | align-items: center; 8 | justify-content: center; 9 | } 10 | 11 | .icon { 12 | font-size: 20px; 13 | color: var(--ag-ant-color-primary); 14 | } 15 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/MockToolDefinition.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * @author zhuoguang 7 | */ 8 | @Data 9 | public class MockToolDefinition { 10 | 11 | private String name; 12 | 13 | private String description; 14 | 15 | private String parameters; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /frontend/packages/main/src/components/SliderInput/index.module.less: -------------------------------------------------------------------------------- 1 | .slider-input { 2 | display: flex; 3 | align-items: center; 4 | gap: 12px; 5 | 6 | & > div:first-child { 7 | flex: 1; 8 | } 9 | } 10 | 11 | .slider-marker { 12 | font-size: 13px; 13 | font-weight: 500; 14 | line-height: 20px; 15 | letter-spacing: normal; 16 | color: var(--ag-ant-color-text-secondary); 17 | transform: translateY(-6px); 18 | } 19 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/components/FlowMiniMap/index.less: -------------------------------------------------------------------------------- 1 | @import '../../index.less'; 2 | 3 | .spark-flow-mini-map { 4 | bottom: 66px !important; 5 | left: 16px; 6 | right: initial !important; 7 | top: initial; 8 | margin: 0 !important; 9 | border-radius: 6px; 10 | border: 1px solid e('var(--@{ant-prefix}-color-border-secondary)'); 11 | 12 | > svg { 13 | width: 100%; 14 | height: 100%; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/nodes/IteratorEnd/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { NodeProps } from '@xyflow/react'; 4 | import React, { memo } from 'react'; 5 | 6 | export default memo(function IteratorEndNode(props: NodeProps) { 7 | return ; 8 | }); 9 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/nodes/ParameterExtractor/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { NodeProps } from '@xyflow/react'; 4 | import React, { memo } from 'react'; 5 | 6 | export default memo(function ParameterExtractorNode( 7 | props: NodeProps, 8 | ) { 9 | return ; 10 | }); 11 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/SpanEventDTO.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | 6 | import java.util.Map; 7 | 8 | @Data 9 | @Builder 10 | public class SpanEventDTO { 11 | 12 | private String time; 13 | 14 | private String name; 15 | 16 | private Map attributes; 17 | } -------------------------------------------------------------------------------- /frontend/packages/main/src/legacy/context/models.ts: -------------------------------------------------------------------------------- 1 | import { createContext } from "react"; 2 | 3 | export const ModelsContext = createContext<{ 4 | modelNameMap: Record; 5 | models: PromptAPI.GetModelsResult["pageItems"]; 6 | setModels: (models: PromptAPI.GetModelsResult["pageItems"]) => void; 7 | }>({ 8 | modelNameMap: {}, 9 | models: [], 10 | setModels: (models: PromptAPI.GetModelsResult["pageItems"]) => {} 11 | }); -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/EvaluationPromptConfig.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | @Data 8 | public class EvaluationPromptConfig { 9 | private String promptKey; 10 | 11 | private String version; 12 | 13 | private List variableMap; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/SpanLinkDTO.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | 6 | import java.util.Map; 7 | 8 | @Data 9 | @Builder 10 | public class SpanLinkDTO { 11 | 12 | private String traceId; 13 | 14 | private String spanId; 15 | 16 | private Map attributes; 17 | } -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/resources/static/index.html: -------------------------------------------------------------------------------- 1 | SAA Admin
-------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/hooks/index.ts: -------------------------------------------------------------------------------- 1 | export * from './useEdgesInteraction'; 2 | export * from './useFlowDebugInteraction'; 3 | export * from './useFlowInteraction'; 4 | export * from './useFlowKeyPress'; 5 | export * from './useFlowSave'; 6 | export * from './useFlowViewPort'; 7 | export * from './useNodesInteraction'; 8 | export * from './useNodesOutputParams'; 9 | export * from './useNodesUpdate'; 10 | export * from './useWorkFlow'; 11 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/components/FlowPanel/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { memo } from 'react'; 2 | import './index.less'; 3 | 4 | interface IFlowPanel { 5 | children?: React.ReactNode[] | React.ReactNode; 6 | } 7 | 8 | export default memo(function FlowPanel(props: IFlowPanel) { 9 | return ( 10 |
11 | {props.children} 12 |
13 | ); 14 | }); 15 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/EvaluatorConfig.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | 8 | @Data 9 | public class EvaluatorConfig { 10 | private Long evaluatorId; 11 | private Long evaluatorVersionId; 12 | private List variableMap; 13 | private String evaluatorName; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /frontend/packages/main/src/legacy/pages/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const LegacyHome: React.FC = () => { 4 | return ( 5 |
6 |

Legacy Admin

7 |

This is the placeholder entry for the merged legacy frontend. We will progressively migrate pages here.

8 |
9 | ); 10 | }; 11 | 12 | export default LegacyHome; 13 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/AssistantAppEdit/components/SparkChat/components/Welcome/index.less: -------------------------------------------------------------------------------- 1 | .suggested-questions-item-wrapper { 2 | background-color: var(--ag-ant-color-fill-quaternary); 3 | color: var(--ag-ant-primary-text); 4 | &:hover { 5 | background-color: var(--ag-ant-color-fill-tertiary); 6 | .suggested-questions-item-icon-wrapper { 7 | background-color: var(--ag-ant-color-fill-secondary); 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/EvaluatorTemplateListRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class EvaluatorTemplateListRequest { 7 | 8 | /** 9 | * 页码 10 | */ 11 | private Integer pageNumber = 1; 12 | 13 | /** 14 | * 每页大小 15 | */ 16 | private Integer pageSize = 10; 17 | 18 | } -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/nodes/IteratorStart/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { NodeProps } from '@xyflow/react'; 4 | import React, { memo } from 'react'; 5 | 6 | export default memo(function IteratorStartNode( 7 | props: NodeProps, 8 | ) { 9 | return ; 10 | }); 11 | -------------------------------------------------------------------------------- /frontend/packages/spark-i18n/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "declaration": true, 6 | "outDir": "./dist", 7 | "strict": true, 8 | "esModuleInterop": true, 9 | "skipLibCheck": true, 10 | "forceConsistentCasingInFileNames": true, 11 | "typeRoots": ["./node_modules/@types", "./src/types"] 12 | }, 13 | "include": ["src"], 14 | "exclude": ["node_modules", "dist"] 15 | } 16 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/MockTool.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto; 2 | 3 | 4 | import lombok.Data; 5 | import org.springframework.ai.tool.definition.DefaultToolDefinition; 6 | 7 | /** 8 | * @author zhuoguang 9 | */ 10 | @Data 11 | public class MockTool { 12 | 13 | 14 | private MockToolDefinition toolDefinition; 15 | 16 | private String output; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/OverviewQueryRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import jakarta.validation.constraints.NotBlank; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class OverviewQueryRequest { 8 | 9 | @NotBlank(message = "开始时间不能为空") 10 | private String startTime; 11 | 12 | @NotBlank(message = "结束时间不能为空") 13 | private String endTime; 14 | } -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/ServicesQueryRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import jakarta.validation.constraints.NotBlank; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class ServicesQueryRequest { 8 | 9 | @NotBlank(message = "开始时间不能为空") 10 | private String startTime; 11 | 12 | @NotBlank(message = "结束时间不能为空") 13 | private String endTime; 14 | } -------------------------------------------------------------------------------- /frontend/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | pluginSearchDirs: false, 3 | plugins: [ 4 | require.resolve('prettier-plugin-organize-imports'), 5 | require.resolve('prettier-plugin-packagejson'), 6 | ], 7 | printWidth: 80, 8 | proseWrap: 'never', 9 | singleQuote: true, 10 | trailingComma: 'all', 11 | overrides: [ 12 | { 13 | files: '*.md', 14 | options: { 15 | proseWrap: 'preserve', 16 | }, 17 | }, 18 | ], 19 | }; 20 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/EvaluatorTestRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | 4 | import jakarta.validation.constraints.NotNull; 5 | import lombok.Data; 6 | 7 | @Data 8 | public class EvaluatorTestRequest { 9 | @NotNull 10 | private String modelConfig; 11 | 12 | @NotNull 13 | private String prompt; 14 | 15 | 16 | private String variables; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /frontend/packages/main/src/components/Table/index.tsx: -------------------------------------------------------------------------------- 1 | import { Table as AntdTable, TableProps } from 'antd'; 2 | import classNames from 'classnames'; 3 | import styles from './index.module.less'; 4 | const Table = (props: TableProps) => { 5 | const { className, ...restProps } = props; 6 | return ( 7 | 8 | className={classNames(styles['table'], className)} 9 | {...restProps} 10 | /> 11 | ); 12 | }; 13 | 14 | export default Table; 15 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/DatasetExperimentsListRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class DatasetExperimentsListRequest { 7 | /** 8 | * 页码 9 | */ 10 | private Integer pageNumber = 1; 11 | 12 | /** 13 | * 每页大小 14 | */ 15 | private Integer pageSize = 10; 16 | 17 | private Long datasetId; 18 | } 19 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Knowledge/components/StepOne/index.module.less: -------------------------------------------------------------------------------- 1 | .step-one { 2 | .form-item-label { 3 | display: flex; 4 | align-items: center; 5 | gap: 4px; 6 | color: var(--ag-ant-color-text); 7 | } 8 | 9 | .info-icon { 10 | font-size: 16px; 11 | color: var(--ag-ant-color-text-tertiary); 12 | } 13 | } 14 | 15 | .opt-item { 16 | display: flex; 17 | align-items: center; 18 | gap: 8px; 19 | .opt-title { 20 | line-height: 20px; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/entity/EvaluatorTemplateDO.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.entity; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | 6 | @Data 7 | @Builder 8 | public class EvaluatorTemplateDO { 9 | private Long id; 10 | private String evaluatorTemplateKey; 11 | private String templateDesc; 12 | private String template; 13 | private String variables; 14 | private String modelConfig; 15 | } -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/EvaluatorCreateRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import jakarta.validation.constraints.NotNull; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class EvaluatorCreateRequest { 8 | 9 | /** 10 | * 评估器名称 11 | */ 12 | @NotNull 13 | private String name; 14 | 15 | /** 16 | * 评估器描述 17 | */ 18 | private String description; 19 | 20 | 21 | 22 | } -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/EvaluatorVersionUpdateRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | 4 | import lombok.Data; 5 | 6 | @Data 7 | public class EvaluatorVersionUpdateRequest { 8 | /** 9 | * 主键ID 10 | */ 11 | private Long evaluatorVersionId; 12 | 13 | 14 | /** 15 | * 评估器版本描述 16 | */ 17 | private String description; 18 | 19 | private String status; 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/ExperimentListRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ExperimentListRequest { 7 | /** 8 | * 页码 9 | */ 10 | private Integer pageNumber = 1; 11 | 12 | /** 13 | * 每页大小 14 | */ 15 | private Integer pageSize = 10; 16 | 17 | 18 | private String name; 19 | 20 | private String status; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/AssistantAppEdit/components/AssistantPromptEditor/Variables/index.module.less: -------------------------------------------------------------------------------- 1 | .variablesWrapper { 2 | padding: 12px; 3 | border-radius: 6px; 4 | background: var(--ag-ant-color-fill-quaternary); 5 | } 6 | 7 | .form { 8 | :global { 9 | .ag-ant-form-item { 10 | margin-bottom: 12px; 11 | } 12 | } 13 | } 14 | 15 | .expandBtn { 16 | color: var(--ag-ant-color-text); 17 | cursor: pointer; 18 | 19 | &.hidden { 20 | transform: rotate(180deg); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/components/RetryForm/index.module.less: -------------------------------------------------------------------------------- 1 | .panel-form-area { 2 | padding: 12px 16px; 3 | border-radius: 6px; 4 | background: var(--ag-ant-color-bg-layout); 5 | 6 | .panel-form-area-label { 7 | font-size: 12px; 8 | color: var(--ag-ant-color-text-secondary); 9 | display: inline-block; 10 | width: 84px; 11 | flex-shrink: 0; 12 | } 13 | } 14 | 15 | .panel-slider-selector { 16 | min-width: initial !important; 17 | margin-right: 0 !important; 18 | } 19 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/EvaluatorUpdateRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | 4 | import lombok.Data; 5 | 6 | @Data 7 | public class EvaluatorUpdateRequest { 8 | /** 9 | * 主键ID 10 | */ 11 | private Long id; 12 | 13 | /** 14 | * 评估器名称 15 | */ 16 | private String name; 17 | 18 | 19 | /** 20 | * 评估器描述 21 | */ 22 | private String description; 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/DatasetVersionListRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class DatasetVersionListRequest { 7 | 8 | /** 9 | * 页码 10 | */ 11 | private Integer pageNumber = 1; 12 | 13 | /** 14 | * 每页大小 15 | */ 16 | private Integer pageSize = 10; 17 | 18 | /** 19 | * 数据集Id 20 | */ 21 | private Long datasetId; 22 | } -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/EvaluatorListRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class EvaluatorListRequest { 7 | 8 | /** 9 | * 页码 10 | */ 11 | private Integer pageNumber = 1; 12 | 13 | /** 14 | * 每页大小 15 | */ 16 | private Integer pageSize = 10; 17 | 18 | /** 19 | * search by name 20 | */ 21 | private String name; 22 | 23 | } -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/components/DraggableWithHandle/index.less: -------------------------------------------------------------------------------- 1 | @import '../../index.less'; 2 | 3 | .draggable-item { 4 | position: relative; 5 | } 6 | 7 | .drag-handle { 8 | cursor: grab; 9 | display: inline-flex; 10 | align-items: center; 11 | justify-content: center; 12 | -webkit-touch-callout: none; 13 | user-select: none; 14 | 15 | &:active { 16 | cursor: grabbing; 17 | } 18 | 19 | i { 20 | font-size: 16px; 21 | color: e('var(--@{ant-prefix}-color-text-secondary)'); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Knowledge/Detail/components/ChunkViewDrawer/index.module.less: -------------------------------------------------------------------------------- 1 | .footer { 2 | display: flex; 3 | align-items: center; 4 | justify-content: space-between; 5 | font-size: 14px; 6 | font-weight: normal; 7 | line-height: 24px; 8 | letter-spacing: normal; 9 | color: var(--ag-ant-color-text-tertiary); 10 | width: 100%; 11 | } 12 | 13 | .content { 14 | font-size: 12px; 15 | font-weight: normal; 16 | line-height: 18px; 17 | letter-spacing: normal; 18 | color: var(--ag-ant-color-text); 19 | } -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/components/DragPanel/index.less: -------------------------------------------------------------------------------- 1 | .spark-drag-panel { 2 | position: relative; 3 | height: 100%; 4 | 5 | &-handle { 6 | position: absolute; 7 | left: 0; 8 | top: 0; 9 | bottom: 0; 10 | width: 2px; 11 | cursor: ew-resize; 12 | background-color: transparent; 13 | transition: background-color 0.2s ease; 14 | 15 | &--dragging { 16 | background-color: #1890ff; 17 | } 18 | 19 | &--hovering { 20 | background-color: #e6f7ff; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/components/InfoIcon/index.tsx: -------------------------------------------------------------------------------- 1 | import { IconFont } from '@spark-ai/design'; 2 | import { Popover } from 'antd'; 3 | import React, { memo } from 'react'; 4 | import './index.less'; 5 | 6 | interface IProps { 7 | tip: string; 8 | } 9 | 10 | export default memo(function InfoIcon(props: IProps) { 11 | return ( 12 | 13 | 14 | 15 | ); 16 | }); 17 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Component/Plugin/Info/Edit.tsx: -------------------------------------------------------------------------------- 1 | import { getPlugin } from '@/services/plugin'; 2 | import { useRequest } from 'ahooks'; 3 | import { useParams } from 'umi'; 4 | import Index from './index'; 5 | 6 | export default function () { 7 | const { id = '' } = useParams<{ id: string }>(); 8 | const { data } = useRequest(() => getPlugin(id)); 9 | const pluginData = data?.data || undefined; 10 | if (!pluginData) return null; 11 | 12 | return ; 13 | } 14 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/DatasetListRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import lombok.Data; 4 | 5 | 6 | @Data 7 | public class DatasetListRequest { 8 | 9 | /** 10 | * 页码 11 | */ 12 | private Integer pageNumber = 1; 13 | 14 | /** 15 | * 每页大小 16 | */ 17 | private Integer pageSize = 10; 18 | 19 | /** 20 | * 按照datasetName查询 21 | */ 22 | private String datasetName; 23 | 24 | 25 | } -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/EvaluatorExperimentsListRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class EvaluatorExperimentsListRequest { 7 | /** 8 | * 页码 9 | */ 10 | private Integer pageNumber = 1; 11 | 12 | /** 13 | * 每页大小 14 | */ 15 | private Integer pageSize = 10; 16 | 17 | /** 18 | * 评估器ID 19 | */ 20 | private Long evaluatorId; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/components/ScriptEditModal/index.less: -------------------------------------------------------------------------------- 1 | .spark-flow-script-edit-modal { 2 | :global { 3 | .ag-ant-modal-header { 4 | position: relative; 5 | 6 | .ag-ant-segmented { 7 | position: absolute; 8 | top: 50%; 9 | left: 50%; 10 | transform: translate(-50%, -50%); 11 | } 12 | } 13 | } 14 | 15 | &-editor { 16 | :global { 17 | .cm-theme, .cm-editor { 18 | height: 60vh; 19 | min-width: 400px; 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-core/src/main/resources/keys/public.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkgQdWAybEJoAPR7EZpfP 3 | QjTssBGDKOR88r0lAgKIbxVoWywHS7VBvjMrXPiuPV6wYdfngQz57b2xkp+bQVda 4 | RBc0tB3nXxkHd4AgPB78MbCNOtR/aAiyoMdTq7L0/Sgexq6PcmDD/J5rLM2ACTKD 5 | gIroq3GnpN7Oq8ikNT9RlrKCGzXBuSF6LMFoogk7xk1v03LLycjtAQtKvjV3DlxW 6 | n0QFnS30rspN+wAFscIuVTbwwET9WhCB7f6iPHbJ8prga1kGQa+pcAbf3iiA3aUF 7 | oeQoPPv4BQaaG8/+7badEFZaCDmnc1/xRVR0LqXu5HzCuM0XkfjC5UhvI4UGeWlA 8 | bwIDAQAB 9 | -----END PUBLIC KEY----- 10 | -------------------------------------------------------------------------------- /frontend/packages/main/src/legacy/pages/prompts/prompt-detail/hooks/useFunctions.ts: -------------------------------------------------------------------------------- 1 | import { useState } from "react"; 2 | 3 | 4 | export interface MockTool { 5 | toolDefinition: { 6 | name: string, 7 | description: string, 8 | parameters: string 9 | }, 10 | output: string 11 | } 12 | 13 | function useFunctions(defaultFunctions: MockTool[]) { 14 | 15 | const [functions, setFunctions] = useState(defaultFunctions || []); 16 | 17 | return { 18 | functions, setFunctions, 19 | } 20 | 21 | } 22 | 23 | export default useFunctions; -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Setting/APIKeys/index.module.less: -------------------------------------------------------------------------------- 1 | .api-key-cell { 2 | display: flex; 3 | align-items: center; 4 | 5 | .api-key-text { 6 | font-family: monospace; 7 | word-break: break-all; 8 | margin-right: 8px; 9 | } 10 | } 11 | 12 | .action-column { 13 | display: flex; 14 | 15 | button { 16 | padding: 0 8px; 17 | 18 | &:first-child { 19 | margin-right: 8px; 20 | } 21 | } 22 | } 23 | 24 | .pagination { 25 | display: flex; 26 | justify-content: flex-end; 27 | width: 100%; 28 | } 29 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/DatasetItemListRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import jakarta.validation.constraints.NotNull; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class DatasetItemListRequest { 8 | 9 | /** 10 | * 页码 11 | */ 12 | private Integer pageNumber = 1; 13 | 14 | /** 15 | * 每页大小 16 | */ 17 | private Integer pageSize = 10; 18 | 19 | @NotNull 20 | private Long datasetVersionId; 21 | } 22 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/tailwind.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | @layer components { 6 | .flex-justify-between { 7 | display: flex; 8 | justify-content: space-between; 9 | align-items: center; 10 | } 11 | 12 | .flex-center { 13 | display: flex; 14 | justify-content: center; 15 | align-items: center; 16 | } 17 | 18 | .full-center { 19 | width: 100%; 20 | height: 100%; 21 | display: flex; 22 | justify-content: center; 23 | align-items: center; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "declaration": true, 5 | "skipLibCheck": true, 6 | "esModuleInterop": true, 7 | "jsx": "react", 8 | "baseUrl": "./", 9 | "resolveJsonModule": true, 10 | "moduleResolution": "node", 11 | "paths": { 12 | "@@/*": [".dumi/tmp/*"], 13 | "@/*": ["src/*"], 14 | "@spark-ai/flow": ["src"], 15 | "@spark-ai/flow/*": ["src/*", "*"] 16 | } 17 | }, 18 | "module": "ESNext", 19 | "include": [".dumirc.ts", "src/**/*"] 20 | } 21 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/AssistantAppEdit/components/AppStatus/index.module.less: -------------------------------------------------------------------------------- 1 | .appStatus { 2 | .tagName { 3 | display: flex; 4 | align-items: center; 5 | font-weight: normal; 6 | } 7 | 8 | .backWrap { 9 | margin: 0; 10 | &.draft { 11 | max-width: calc(100% - 40px - 32px - 32px) !important; 12 | } 13 | 14 | &.publish { 15 | max-width: calc(100% - 52px - 32px - 32px) !important; 16 | } 17 | 18 | &.draftAndPublish { 19 | max-width: calc(100% - 88px - 32px - 32px) !important; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/LLM/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode, NodeProps } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { memo } from 'react'; 4 | import { ILLMNodeParam } from '../../types'; 5 | 6 | export default memo(function LLMNode(props: NodeProps) { 7 | return ( 8 | 15 | ); 16 | }); 17 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/APINode/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode, NodeProps } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { memo } from 'react'; 4 | import { IApiNodeParam } from '../../types'; 5 | 6 | export default memo(function ApiNode(props: NodeProps) { 7 | return ( 8 | 15 | ); 16 | }); 17 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/EvaluatorVersionListRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class EvaluatorVersionListRequest { 7 | 8 | /** 9 | * 页码 10 | */ 11 | private Integer pageNumber = 1; 12 | 13 | /** 14 | * 每页大小 15 | */ 16 | private Integer pageSize = 10; 17 | 18 | /** 19 | * 评估器Id 20 | */ 21 | private Long evaluatorId; 22 | 23 | 24 | 25 | private String name; 26 | 27 | } -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/Script/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode, NodeProps } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { memo } from 'react'; 4 | import { IScriptNodeParam } from '../../types'; 5 | 6 | export default memo(function Script(props: NodeProps) { 7 | return ( 8 | 15 | ); 16 | }); 17 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/components/FlowIcon/index.less: -------------------------------------------------------------------------------- 1 | @import '../../index.less'; 2 | 3 | .spark-flow-node-icon-wrap { 4 | border-radius: 4px; 5 | background: e('var(--@{ant-prefix}-color-primary)'); 6 | display: flex; 7 | align-items: center; 8 | justify-content: center; 9 | color: e('var(--@{ant-prefix}-color-text-white)'); 10 | 11 | &.spark-node-icon-small { 12 | .spark-flow-type-icon { 13 | font-size: 12px !important; 14 | } 15 | } 16 | 17 | &.spark-flow-node-icon-no-bg { 18 | color: e('var(--@{ant-prefix}-color-text)'); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /docker/middleware/conf/loongcollector/otlp_pipeline.yaml: -------------------------------------------------------------------------------- 1 | enable: true 2 | inputs: 3 | - Type: service_otlp 4 | Protocals: 5 | HTTP: 6 | Endpoint: 0.0.0.0:4318 7 | MaxRecvMsgSizeMiB: 64 8 | ReadTimeoutSec: 10 9 | ShutdownTimeoutSec: 5 10 | flushers: 11 | - Type: flusher_stdout 12 | OnlyStdout: true 13 | Tags: true 14 | - Type: flusher_elasticsearch 15 | Addresses: 16 | - http://elasticsearch:9200 17 | Index: loongsuite_traces 18 | Authentication: 19 | PlainText: 20 | Username: elastic 21 | Password: elastic -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/PluginNode/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode, NodeProps } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { memo } from 'react'; 4 | import { IPluginNodeParam } from '../../types'; 5 | 6 | export default memo(function PluginNode(props: NodeProps) { 7 | return ( 8 | 15 | ); 16 | }); 17 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Knowledge/Detail/components/Search/index.module.less: -------------------------------------------------------------------------------- 1 | .search-container { 2 | padding: 16px 20px; 3 | width: 100%; 4 | height: 64px; 5 | box-sizing: border-box; 6 | } 7 | 8 | .search-content { 9 | display: flex; 10 | align-items: center; 11 | gap: 24px; 12 | height: 32px; 13 | } 14 | 15 | .select-group { 16 | display: flex; 17 | align-items: center; 18 | gap: 24px; 19 | margin-left: auto; 20 | } 21 | 22 | .search-input { 23 | width: 240px; 24 | } 25 | .dropdown-icon { 26 | font-size: 20px; 27 | color: var(--ag-ant-color-text); 28 | } 29 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/components/CustomInputsControl/index.less: -------------------------------------------------------------------------------- 1 | @import '../../index.less'; 2 | .spark-flow-variable-from-select { 3 | height: auto !important; 4 | 5 | .@{ant-prefix}-select-selection-item { 6 | height: 30px; 7 | } 8 | } 9 | 10 | .spark-flow-var-label { 11 | .spark-flow-var-name { 12 | font-weight: 500; 13 | flex: 1; 14 | width: 1px; 15 | color: e('var(--@{ant-prefix}-color-primary)'); 16 | } 17 | } 18 | 19 | .spark-flow-var-type { 20 | color: e('var(--@{ant-prefix}-color-text-tertiary)'); 21 | font-family: Menlo, monospace; 22 | } 23 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/components/RetryForm/index.less: -------------------------------------------------------------------------------- 1 | @import '../../index.less'; 2 | 3 | .spark-flow-panel-form-area { 4 | padding: 12px 16px; 5 | border-radius: 6px; 6 | background: e('var(--@{ant-prefix}-color-bg-layout)'); 7 | 8 | .spark-flow-panel-form-area-label { 9 | font-size: 12px; 10 | color: e('var(--@{ant-prefix}-color-text-secondary)'); 11 | display: inline-block; 12 | width: 84px; 13 | flex-shrink: 0; 14 | } 15 | 16 | .spark-flow-spark-slider-selector { 17 | min-width: auto; 18 | margin: 0 0 0 20px; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/utils/defaultValues.ts: -------------------------------------------------------------------------------- 1 | import { IValueType } from '@/types/work-flow'; 2 | 3 | export const defaultValueMap: Record = { 4 | String: '', 5 | Number: '0', 6 | Boolean: 'false', 7 | Object: JSON.stringify({ key: 'value' }, null, 2), 8 | File: '', 9 | 'Array': JSON.stringify([{ key: 'value' }], null, 2), 10 | 'Array': JSON.stringify([''], null, 2), 11 | 'Array': JSON.stringify([0], null, 2), 12 | 'Array': JSON.stringify([false], null, 2), 13 | 'Array': JSON.stringify([], null, 2), 14 | }; 15 | -------------------------------------------------------------------------------- /frontend/packages/main/public/images/require.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/packages/main/src/components/Filter/index.module.less: -------------------------------------------------------------------------------- 1 | .filter-selector { 2 | :global { 3 | .ag-ant-tag-checkable { 4 | font-size: 14px; 5 | padding: 4px 12px; 6 | height: auto; 7 | margin: 0; 8 | background: transparent; 9 | &:hover { 10 | background: var(--ag-ant-control-item-bg-hover); 11 | color: var(--ag-ant-color-text); 12 | } 13 | 14 | &.ag-ant-tag-checkable-checked { 15 | background: var(--ag-ant-control-item-bg-active); 16 | color: var(--ag-ant-color-primary); 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /frontend/packages/main/src/legacy/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import { HashRouter } from 'react-router-dom'; 4 | import 'antd/dist/reset.css'; // Ant Design styles 5 | import App from './App'; 6 | import './styles/index.css'; 7 | import './styles/tailwind.css'; 8 | // 初始化全局错误处理 9 | import './utils/requestInterceptors'; 10 | 11 | const root = ReactDOM.createRoot(document.getElementById('root')); 12 | root.render( 13 | // 14 | 15 | 16 | 17 | // 18 | ); 19 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/components/InfoIcon/index.tsx: -------------------------------------------------------------------------------- 1 | import { IconFont } from '@spark-ai/design'; 2 | import { Popover } from 'antd'; 3 | import { memo } from 'react'; 4 | import styles from './index.module.less'; 5 | 6 | interface IProps { 7 | tip: string; 8 | } 9 | 10 | export default memo(function InfoIcon(props: IProps) { 11 | return ( 12 | 13 | 18 | 19 | ); 20 | }); 21 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/service/EvaluatorTemplateService.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.service; 2 | 3 | import com.alibaba.cloud.ai.studio.admin.common.PageResult; 4 | import com.alibaba.cloud.ai.studio.admin.dto.EvaluatorTemplate; 5 | import com.alibaba.cloud.ai.studio.admin.dto.request.EvaluatorTemplateListRequest; 6 | 7 | public interface EvaluatorTemplateService { 8 | 9 | 10 | 11 | EvaluatorTemplate get(Long id); 12 | 13 | 14 | PageResult list(EvaluatorTemplateListRequest request); 15 | } -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/resources/templates/GraphBuilder.java.mustache: -------------------------------------------------------------------------------- 1 | package {{packageName}}.graph; 2 | 3 | {{importSection}} 4 | 5 | @Component 6 | public class GraphBuilder { 7 | 8 | {{assistMethodCode}} 9 | 10 | @Bean 11 | public CompiledGraph buildGraph(ChatModel chatModel) throws Exception { 12 | // new stateGraph 13 | StateGraph stateGraph = new StateGraph({{stateSection}}); 14 | // add nodes 15 | {{nodeSection}} 16 | // add edges 17 | {{edgeSection}} 18 | return stateGraph.compile(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/components/ConditionItem/index.less: -------------------------------------------------------------------------------- 1 | .spark-flow-condition-item { 2 | border: 1px solid var(--ag-ant-color-border-secondary); 3 | border-radius: 6px; 4 | 5 | &-header { 6 | border-bottom: 1px solid var(--ag-ant-color-border-secondary); 7 | } 8 | 9 | .spark-flow-condition-item-divider { 10 | height: 20px; 11 | margin: 0; 12 | } 13 | 14 | &-disabled-label { 15 | background: var(--ag-ant-color-fill-secondary); 16 | padding: 6px 8px; 17 | font-size: 12px; 18 | line-height: 20px; 19 | color: var(--ag-ant-color-text-tertiary); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/components/FlowMiniMap/index.tsx: -------------------------------------------------------------------------------- 1 | import { useStore } from '@/flow/context'; 2 | import { MiniMap } from '@xyflow/react'; 3 | import React, { memo } from 'react'; 4 | import './index.less'; 5 | 6 | export default memo(function FlowMiniMap() { 7 | const showMiniMap = useStore((state) => state.showMiniMap); 8 | 9 | if (!showMiniMap) return null; 10 | return ( 11 | 19 | ); 20 | }); 21 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/ChatMessageMetrics.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto; 2 | 3 | 4 | import lombok.AllArgsConstructor; 5 | import lombok.Builder; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | import org.springframework.ai.chat.metadata.Usage; 9 | 10 | /** 11 | * @author zhuoguang 12 | */ 13 | @Data 14 | @Builder 15 | @NoArgsConstructor 16 | @AllArgsConstructor 17 | public class ChatMessageMetrics { 18 | 19 | 20 | private Usage usage; 21 | 22 | private String traceId; 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /frontend/packages/main/src/types/apiKey.ts: -------------------------------------------------------------------------------- 1 | // API Key base info 2 | export interface IApiKey { 3 | id?: number; 4 | api_key?: string; 5 | description?: string; 6 | gmt_create?: string; 7 | } 8 | 9 | // Create API Key parameters 10 | export interface ICreateApiKeyParams { 11 | description: string; 12 | } 13 | 14 | // Update API Key parameters 15 | export interface IUpdateApiKeyParams { 16 | id: number | string; 17 | description: string; 18 | } 19 | 20 | // Pagination list response 21 | export interface IPagingList { 22 | current: number; 23 | size: number; 24 | total: number; 25 | records: T[]; 26 | } 27 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/nodes/Api/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { NodeProps } from '@xyflow/react'; 4 | import React, { memo } from 'react'; 5 | import { IApiNodeParam } from '../../types/flow'; 6 | 7 | export default memo(function ApiNode(props: NodeProps) { 8 | return ( 9 | 16 | ); 17 | }); 18 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/nodes/LLM/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { NodeProps } from '@xyflow/react'; 4 | import React, { memo } from 'react'; 5 | import { ILLMNodeParam } from '../../types/flow'; 6 | 7 | export default memo(function LLMNode(props: NodeProps) { 8 | return ( 9 | 16 | ); 17 | }); 18 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/DatasetItemUpdateRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import lombok.Data; 4 | 5 | import jakarta.validation.constraints.NotBlank; 6 | import jakarta.validation.constraints.NotNull; 7 | 8 | @Data 9 | public class DatasetItemUpdateRequest { 10 | 11 | /** 12 | * 数据项ID 13 | */ 14 | @NotNull(message = "数据项ID不能为空") 15 | private Long id; 16 | 17 | /** 18 | * 数据内容(JSON格式) 19 | */ 20 | @NotBlank(message = "数据内容不能为空") 21 | private String dataContent; 22 | 23 | } -------------------------------------------------------------------------------- /frontend/packages/spark-i18n/src/config/work-station-app.js: -------------------------------------------------------------------------------- 1 | const doNotTranslateFiles = [ 2 | // Ignore test files 3 | /\.test\./, 4 | /\.spec\./, 5 | // Ignore type definition files 6 | /\.d\.ts$/, 7 | // Ignore specific directories 8 | 'src/pages/App/Workflow/components/ScriptCodeMirror', 9 | ] 10 | 11 | const config = { 12 | path: '../main/src', 13 | fileExtensions: ['.tsx', '.js', '.ts', '.jsx'], 14 | targetFilePath: '../main/src/i18n/locales/', 15 | keyPrefix: 'main', 16 | functionImportPath: '@/i18n' 17 | } 18 | 19 | module.exports = { 20 | doNotTranslateFiles, 21 | config 22 | } -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/nodes/Script/node.tsx: -------------------------------------------------------------------------------- 1 | import type { IWorkFlowNode } from '@spark-ai/flow'; 2 | import { BaseNode } from '@spark-ai/flow'; 3 | import { NodeProps } from '@xyflow/react'; 4 | import React, { memo } from 'react'; 5 | import { IScriptNodeParam } from '../../types/flow'; 6 | 7 | export default memo(function Script(props: NodeProps) { 8 | return ( 9 | 16 | ); 17 | }); 18 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/mapper/EvaluatorTemplateMapper.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.mapper; 2 | 3 | import com.alibaba.cloud.ai.studio.admin.entity.EvaluatorTemplateDO; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import java.util.List; 8 | 9 | @Mapper 10 | public interface EvaluatorTemplateMapper { 11 | 12 | 13 | EvaluatorTemplateDO selectById(Long id); 14 | 15 | List list(@Param("offset") Long offset, @Param("limit") Long limit); 16 | 17 | int count(); 18 | } -------------------------------------------------------------------------------- /frontend/packages/main/src/legacy/pages/evaluation/evaluator/evaluator-detail/index.css: -------------------------------------------------------------------------------- 1 | .evaluator-detail-page .ant-descriptions-item-label { 2 | font-weight: 600; 3 | color: #262626; 4 | } 5 | 6 | .evaluator-detail-page .ant-card-head-title { 7 | font-weight: 600; 8 | } 9 | 10 | .evaluator-detail-page .ant-tabs-content-holder { 11 | padding-top: 16px; 12 | } 13 | 14 | .evaluator-detail-page .ant-form-item-label > label { 15 | font-weight: 500; 16 | } 17 | 18 | .evaluator-detail-page .ant-slider { 19 | margin: 8px 0; 20 | } 21 | 22 | .evaluator-detail-page .version-table .ant-table-tbody > tr:hover { 23 | background-color: #f5f5f5; 24 | } -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/AssistantAppEdit/components/AppConfigDiffModal/index.module.less: -------------------------------------------------------------------------------- 1 | .desc { 2 | font-size: 12px; 3 | color: var(--ag-ant-color-text-description); 4 | margin-bottom: 16px; 5 | } 6 | 7 | .title { 8 | margin-bottom: 8px; 9 | } 10 | 11 | .table { 12 | border-radius: 8px; 13 | overflow: hidden; 14 | 15 | :global(.ag-ant-table-row:last-of-type .ag-ant-table-cell) { 16 | border-bottom: none; 17 | } 18 | } 19 | 20 | .loading { 21 | display: flex; 22 | align-items: center; 23 | justify-content: center; 24 | min-height: 240px; 25 | } 26 | 27 | .configLabel { 28 | white-space: pre-wrap; 29 | } 30 | -------------------------------------------------------------------------------- /frontend/packages/spark-i18n/src/config/spark-flow.js: -------------------------------------------------------------------------------- 1 | const doNotTranslateFiles = [ 2 | // Ignore test files 3 | /\.test\./, 4 | /\.spec\./, 5 | // Ignore type definition files 6 | /\.d\.ts$/, 7 | // Ignore specific directories 8 | // 'src/pages/App/Workflow/components/ScriptCodeMirror', 9 | ] 10 | 11 | const config = { 12 | path: '../spark-flow/src', 13 | fileExtensions: ['.tsx', '.js', '.ts', '.jsx'], 14 | targetFilePath: '../spark-flow/src/i18n/locales/', 15 | keyPrefix: 'spark-flow', 16 | functionImportPath: '@/i18n' 17 | } 18 | 19 | module.exports = { 20 | doNotTranslateFiles, 21 | config 22 | } -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/DatasetVersionUpdateRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import com.alibaba.cloud.ai.studio.admin.dto.DatasetColumn; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | public class DatasetVersionUpdateRequest { 10 | 11 | /** 12 | * 数据集版本Id描述 13 | */ 14 | private Long datasetVersionId; 15 | 16 | 17 | /** 18 | * 数据集版本描述 19 | */ 20 | private String description; 21 | 22 | 23 | /** 24 | * 数据集版本状态 25 | */ 26 | 27 | private String status; 28 | 29 | } -------------------------------------------------------------------------------- /frontend/packages/spark-flow/.dumirc.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'dumi'; 2 | 3 | export default defineConfig({ 4 | plugins: ['@umijs/plugins/dist/tailwindcss'], 5 | outputPath: 'docs-dist', 6 | themeConfig: { 7 | name: 'spark-flow', 8 | hd: { rules: [] }, 9 | logo: 'https://gw.alicdn.com/imgextra/i4/O1CN01vVn7g32134zNZEeAR_!!6000000006928-55-tps-24-24.svg', 10 | type: 'docs', 11 | prefersColor: { default: 'light', switch: false }, 12 | }, 13 | resolve: { 14 | atomDirs: [{ type: 'component', dir: 'src/demos' }], 15 | entryFile: './src/index.ts', 16 | }, 17 | esm: { type: 'babel' }, 18 | tailwindcss: {}, 19 | }); 20 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/ExperimentEvaluatorResultDetailListRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | 4 | import jakarta.validation.constraints.NotNull; 5 | import lombok.Data; 6 | 7 | @Data 8 | public class ExperimentEvaluatorResultDetailListRequest { 9 | @NotNull 10 | private Long experimentId; 11 | 12 | @NotNull 13 | private Long evaluatorVersionId; 14 | 15 | /** 16 | * 页码 17 | */ 18 | private Integer pageNumber = 1; 19 | 20 | /** 21 | * 每页大小 22 | */ 23 | private Integer pageSize = 10; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /frontend/packages/main/src/services/login.ts: -------------------------------------------------------------------------------- 1 | import { request } from '@/request'; 2 | import { session } from '@/request/session'; 3 | 4 | export function authLogin(data: { username: string; password: string }) { 5 | return request({ 6 | method: 'POST', 7 | url: '/console/v1/auth/login', 8 | data, 9 | }).then((res) => { 10 | session.set(res.data.data); 11 | return res; 12 | }); 13 | } 14 | 15 | export function authGithubLogin() { 16 | return request({ 17 | method: 'GET', 18 | url: '/oauth2/login/github', 19 | }).then((res) => res.data); 20 | } 21 | 22 | export function authLogout() { 23 | session.clear(); 24 | location.reload(); 25 | } 26 | -------------------------------------------------------------------------------- /frontend/packages/main/src/components/AccountModal/index.module.less: -------------------------------------------------------------------------------- 1 | .modal { 2 | :global(.ag-ant-form-item) { 3 | margin-bottom: 8px; 4 | } 5 | } 6 | 7 | .user-info-header { 8 | display: flex; 9 | align-items: center; 10 | gap: 12px; 11 | margin-bottom: 24px; 12 | } 13 | 14 | .user-info-details { 15 | display: flex; 16 | flex-direction: column; 17 | align-items: flex-start; 18 | gap: 4px; 19 | } 20 | 21 | .user-name { 22 | font-size: 14px; 23 | color: var(--ag-ant-color-text); 24 | } 25 | 26 | .section-title { 27 | font-size: 14px; 28 | font-weight: 500; 29 | color: var(--ag-ant-color-text); 30 | margin-top: 20px; 31 | margin-bottom: 8px; 32 | } 33 | -------------------------------------------------------------------------------- /frontend/packages/main/src/legacy/pages/evaluation/evaluator/evaluator-detail/doc.md: -------------------------------------------------------------------------------- 1 | # 评估器详情页面 2 | 3 | ## 调用接口 getEvaluator 4 | 5 | ## 需求说明 6 | - 该页面包含两个部分, 支持编辑, 编辑时仅名称和描述可以编辑,更新接口为 updateEvaluator 7 | 1. 评估器源信息展示, 包含 8 | - 名称 9 | - 当前版本 10 | - 描述 11 | - 裁判模型 12 | - 模型配置 13 | - Max Tokens 14 | - Temperature 15 | - Top P 16 | - System Prompt 17 | - 创建时间 18 | - 更新时间 19 | 20 | 2. 底部区域, 包含三个 Tab 21 | - 模型配置, 支持直接编辑 22 | - 展示裁判模型 23 | - 模型参数 24 | - Prompt 25 | - 调试(跳转至调试页面, 需要携带修改后的配置),发布新版本 26 | - 版本记录 getEvaluatorVersions 27 | - 展示当前版本列表, 列包含: 28 | - 版本号 29 | - 描述 30 | - 裁判模型 31 | - 创建时间 32 | - 关联试验 (暂不实现) -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/ModelConfigQueryRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ModelConfigQueryRequest { 7 | 8 | /** 9 | * 页码,从1开始 10 | */ 11 | private Integer page = 1; 12 | 13 | /** 14 | * 每页大小 15 | */ 16 | private Integer size = 10; 17 | 18 | /** 19 | * 模型名称(模糊查询) 20 | */ 21 | private String name; 22 | 23 | /** 24 | * 提供商 25 | */ 26 | private String provider; 27 | 28 | /** 29 | * 状态:1-启用,0-禁用 30 | */ 31 | private Integer status; 32 | } 33 | -------------------------------------------------------------------------------- /frontend/packages/main/tailwind.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | @layer components { 6 | .full-center, .loading-center { 7 | display: flex; 8 | height: 100%; 9 | width: 100%; 10 | justify-content: center; 11 | align-items: center; 12 | } 13 | 14 | .flex-justify-between { 15 | display: flex; 16 | justify-content: space-between; 17 | align-items: center; 18 | } 19 | 20 | .flex-center { 21 | display: flex; 22 | justify-content: center; 23 | align-items: center; 24 | } 25 | 26 | .disabled-icon-btn { 27 | color: var(--ag-ant-color-text-disabled); 28 | cursor: not-allowed; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/DatasetItemCreateRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import com.alibaba.cloud.ai.studio.admin.dto.DatasetColumn; 4 | import lombok.Data; 5 | import jakarta.validation.constraints.NotNull; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | public class DatasetItemCreateRequest { 11 | 12 | /** 13 | * 测评集ID 14 | */ 15 | @NotNull(message = "测评集ID不能为空") 16 | private Long datasetId; 17 | 18 | private List dataContent; 19 | 20 | /** 21 | * 列结构配置(JSON格式) 22 | */ 23 | 24 | private List columnsConfig; 25 | 26 | } -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/resources/templates/AgentBuilder.java.mustache: -------------------------------------------------------------------------------- 1 | package {{packageName}}.graph; 2 | 3 | {{importSection}} 4 | 5 | @Component 6 | public class AgentBuilder { 7 | 8 | @Bean(name = "buildGraph") 9 | public CompiledGraph buildCompiledGraph(ChatModel chatModel{{#hasResolver}}, ObjectProvider toolCallbackResolverProvider{{/hasResolver}}) throws Exception { 10 | {{#hasResolver}} 11 | ToolCallbackResolver toolCallbackResolver = toolCallbackResolverProvider != null ? toolCallbackResolverProvider.getIfAvailable() : null; 12 | {{/hasResolver}} 13 | {{{agentSection}}} 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/components/VarTypePrefix/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { memo } from 'react'; 2 | 3 | export const typeAbbr = { 4 | 'Array': 'Arr', 5 | 'Array': 'Arr', 6 | 'Array': 'Arr', 7 | 'Array': 'Arr', 8 | 'Array': 'Arr', 9 | Object: 'Obj', 10 | File: 'File', 11 | String: 'Str', 12 | Number: 'Num', 13 | Boolean: 'Bool', 14 | }; 15 | 16 | export default memo(function VarTypePrefix(props: { prefix?: string }) { 17 | if (!props.prefix) { 18 | return null; 19 | } 20 | 21 | return ( 22 | 23 | {typeAbbr[props.prefix as keyof typeof typeAbbr]} 24 | 25 | ); 26 | }); 27 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/repository/ModelConfigRepository.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.repository; 2 | 3 | import com.alibaba.cloud.ai.studio.admin.entity.ModelConfigDO; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 模型配置仓储接口(文件驱动实现)。 9 | */ 10 | public interface ModelConfigRepository { 11 | 12 | ModelConfigDO findById(Long id); 13 | 14 | boolean existsById(Long id); 15 | 16 | List list(String name, String provider, Integer status, int offset, int limit); 17 | 18 | int count(String name, String provider, Integer status); 19 | 20 | List listEnabled(); 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/MCP/index.tsx: -------------------------------------------------------------------------------- 1 | import InnerLayout from '@/components/InnerLayout'; 2 | import $i18n from '@/i18n'; 3 | import McpManage from './Manage'; 4 | 5 | export default function () { 6 | return ( 7 | 24 | 25 | 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/config/NacosConfig.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.config; 2 | 3 | import com.alibaba.cloud.ai.studio.admin.service.impl.NacosClientService; 4 | import com.alibaba.nacos.api.exception.NacosException; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | @Configuration 9 | public class NacosConfig { 10 | 11 | @Bean 12 | public NacosClientService nacosClientService(NacosProperties nacosProperties) throws NacosException { 13 | return new NacosClientService(nacosProperties.getNacosProperties()); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/DatasetColumn.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class DatasetColumn { 7 | 8 | /** 9 | * 列名称 10 | */ 11 | private String name; 12 | 13 | /** 14 | * 数据类型:STRING, NUMBER, BOOLEAN, JSON, ARRAY 15 | */ 16 | private String dataType; 17 | 18 | /** 19 | * 显示格式:PLAIN_TEXT, MARKDOWN, CODE, JSON, TABLE 20 | */ 21 | private String displayFormat; 22 | 23 | /** 24 | * 列描述 25 | */ 26 | private String description; 27 | 28 | /** 29 | * 是否必填 30 | */ 31 | private Boolean required; 32 | } -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/DatasetCreateRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import com.alibaba.cloud.ai.studio.admin.dto.DatasetColumn; 4 | import jakarta.validation.constraints.NotNull; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | public class DatasetCreateRequest { 11 | 12 | /** 13 | * 数据集名称 14 | */ 15 | @NotNull 16 | private String name; 17 | 18 | /** 19 | * 数据集描述 20 | */ 21 | private String description; 22 | 23 | /** 24 | * 列结构配置 25 | */ 26 | @NotNull 27 | private List columnsConfig; 28 | 29 | 30 | 31 | } -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Debug/components/ChatInterface.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { useConfigContext } from '../contexts/ConfigContext'; 3 | import Sidebar from './Sidebar'; 4 | import MessageArea from './MessageArea'; 5 | import DebugPanel from './DebugPanel'; 6 | import styles from '../index.module.less'; 7 | 8 | const ChatInterface: React.FC = () => { 9 | const { config } = useConfigContext(); 10 | 11 | return ( 12 |
13 | 14 |
15 | 16 |
17 | {config.showDebugInfo && } 18 |
19 | ); 20 | }; 21 | 22 | export default ChatInterface; 23 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/AssistantAppEdit/components/KnowledgeSelectorComp/index.module.less: -------------------------------------------------------------------------------- 1 | .expand-btn { 2 | color: var(--ag-ant-color-text); 3 | cursor: pointer; 4 | 5 | &.hidden { 6 | transform: rotate(180deg); 7 | } 8 | } 9 | 10 | .desc { 11 | color: var(--ag-ant-color-text-tertiary); 12 | font-size: 12px; 13 | line-height: 18px; 14 | 15 | .tag { 16 | padding: 0px 6px; 17 | border-radius: 4px; 18 | line-height: 22px; 19 | display: inline-block; 20 | background: var(--ag-ant-color-fill-tertiary); 21 | color: var(--ag-ant-color-text-base); 22 | margin: 0 3px; 23 | } 24 | 25 | .btn { 26 | color: var(--ag-ant-color-text-base); 27 | cursor: pointer; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/model-config-deepseek.yaml: -------------------------------------------------------------------------------- 1 | models: 2 | - id: 1 3 | name: deepseek 4 | provider: deepseek 5 | modelName: deepseek-chat 6 | apiKey: ${DEEPSEEK_API_KEY} 7 | status: 1 8 | defaultParameters: 9 | temperature: 0.7 10 | maxTokens: 4096 11 | supportedParameters: 12 | - name: temperature 13 | type: number 14 | minValue: 0 15 | maxValue: 2 16 | defaultValue: 0.7 17 | required: false 18 | description: 采样温度 19 | - name: maxTokens 20 | type: number 21 | minValue: 1 22 | maxValue: 4096 23 | defaultValue: 1024 24 | required: false 25 | description: 最大输出token 26 | 27 | 28 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/AssistantAppEdit/components/SparkChat/components/Steps/Plugin/index.module.less: -------------------------------------------------------------------------------- 1 | .container { 2 | display: flex; 3 | flex-direction: column; 4 | gap: 12px; 5 | .jsonContainer { 6 | border: 1px solid; 7 | border-color: var(--ag-ant-color-border-secondary); 8 | .header { 9 | height: 28px; 10 | padding: 3px 12px; 11 | display: flex; 12 | justify-content: space-between; 13 | align-items: center; 14 | line-height: 22px; 15 | font-size: 12px; 16 | color: var(--ag-ant-color-text); 17 | background-color: var(--ag-ant-color-fill-tertiary); 18 | } 19 | } 20 | .codeMirror { 21 | border-radius: 0; 22 | border: none; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /frontend/packages/main/src/components/Tag/StatusTag.module.less: -------------------------------------------------------------------------------- 1 | .container { 2 | background: transparent; 3 | border-color: transparent; 4 | font-size: 14px; 5 | line-height: 20px; 6 | } 7 | 8 | .icon { 9 | transform: translateY(3px); 10 | 11 | &.processing { 12 | color: var(--ag-ant-color-info); 13 | animation: rotate 3s linear infinite; 14 | } 15 | 16 | &.processed { 17 | color: var(--ag-ant-color-success); 18 | } 19 | 20 | &.failed { 21 | color: var(--ag-ant-color-error); 22 | } 23 | } 24 | 25 | .text { 26 | color: var(--ag-ant-color-text-base); 27 | } 28 | 29 | @keyframes rotate { 30 | from { 31 | transform: rotate(0deg); 32 | } 33 | 34 | to { 35 | transform: rotate(360deg); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Knowledge/Editor/index.module.less: -------------------------------------------------------------------------------- 1 | .container { 2 | width: 640px; 3 | margin: 0 auto; 4 | margin-top: 24px; 5 | } 6 | 7 | .footer { 8 | width: 100%; 9 | background: var(--ag-ant-color-bg-base); 10 | } 11 | .footer-btn { 12 | width: 640px; 13 | margin: 0 auto; 14 | display: flex; 15 | align-items: center; 16 | gap: 12px; 17 | } 18 | .form-item-label { 19 | display: flex; 20 | align-items: center; 21 | gap: 4px; 22 | color: var(--ag-ant-color-text); 23 | } 24 | 25 | .info-icon { 26 | font-size: 16px; 27 | color: var(--ag-ant-color-text-tertiary); 28 | } 29 | .opt-item { 30 | display: flex; 31 | align-items: center; 32 | gap: 8px; 33 | .opt-title { 34 | line-height: 20px; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /deploy/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Kustomization file for optional use with kubectl apply -k 2 | # This allows you to apply all resources at once 3 | apiVersion: kustomize.config.k8s.io/v1beta1 4 | kind: Kustomization 5 | 6 | namespace: spring-ai-admin 7 | 8 | resources: 9 | - namespace.yaml 10 | - middleware/mysql/mysql-deployment.yaml 11 | - middleware/elasticsearch/elasticsearch-deployment.yaml 12 | - middleware/kibana/kibana-deployment.yaml 13 | - middleware/redis/redis-deployment.yaml 14 | - middleware/nacos/nacos-deployment.yaml 15 | - middleware/rocketmq/rocketmq-deployment.yaml 16 | - middleware/loongcollector/loongcollector-deployment.yaml 17 | - backend/backend-deployment.yaml 18 | - frontend/frontend-deployment.yaml 19 | - ingress.yaml 20 | 21 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Knowledge/Test/components/ChunkList/index.module.less: -------------------------------------------------------------------------------- 1 | .chunk-list { 2 | display: flex; 3 | flex-direction: column; 4 | gap: 16px; 5 | padding: 20px 24px; 6 | width: 100%; 7 | height: 100%; 8 | overflow: auto; 9 | position: relative; 10 | } 11 | 12 | .chunk-list-header { 13 | font-size: 14px; 14 | font-weight: 500; 15 | line-height: 22px; 16 | color: var(--ag-ant-color-text); 17 | display: flex; 18 | align-items: center; 19 | gap: 4px; 20 | } 21 | 22 | .chunk-list-header-count { 23 | font-weight: 500; 24 | font-size: 14px; 25 | color: var(--ag-ant-color-text-secondary); 26 | } 27 | 28 | .empty { 29 | position: absolute; 30 | top: 50%; 31 | left: 50%; 32 | transform: translate(-50%, -50%); 33 | } 34 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/components/FlowBaseEdge/index.less: -------------------------------------------------------------------------------- 1 | @import '../../index.less'; 2 | 3 | .spark-flow-edge-btn { 4 | width: 20px; 5 | height: 20px; 6 | border-radius: 50%; 7 | background: e('var(--@{ant-prefix}-color-bg-base)'); 8 | box-shadow: 0 4px 24px 0 rgb(0 0 0 / 15%); 9 | color: e('var(--@{ant-prefix}-color-primary)'); 10 | position: absolute; 11 | pointer-events: all; 12 | transform-origin: center; 13 | cursor: pointer; 14 | z-index: 1003 !important; 15 | } 16 | 17 | .spark-flow-animate-gradient-edge { 18 | animation: gradientAnimation 2s linear infinite; 19 | } 20 | 21 | @keyframes gradientAnimation { 22 | 0% { 23 | transform: translateX(0); 24 | } 25 | 100% { 26 | transform: translateX(100%); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/model-config-openai.yaml: -------------------------------------------------------------------------------- 1 | models: 2 | - id: 1 3 | name: openai-gpt4o 4 | provider: openai 5 | modelName: gpt-4o 6 | baseUrl: https://api.openai.com/v1 7 | apiKey: ${OPENAI_API_KEY} 8 | status: 1 9 | defaultParameters: 10 | temperature: 0.7 11 | maxTokens: 4096 12 | supportedParameters: 13 | - name: temperature 14 | type: number 15 | minValue: 0 16 | maxValue: 2 17 | defaultValue: 0.7 18 | required: false 19 | description: 采样温度 20 | - name: maxTokens 21 | type: number 22 | minValue: 1 23 | maxValue: 4096 24 | defaultValue: 1024 25 | required: false 26 | description: 最大输出token 27 | 28 | 29 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/model-config-dashscope.yaml: -------------------------------------------------------------------------------- 1 | models: 2 | - id: 1 3 | name: qwen-plus 4 | provider: dashscope 5 | modelName: qwen-plus 6 | baseUrl: https://dashscope.aliyuncs.com/compatible-mode 7 | apiKey: ${DASHSCOPE_API_KEY} 8 | status: 1 9 | defaultParameters: 10 | temperature: 0.7 11 | maxTokens: 4096 12 | supportedParameters: 13 | - name: temperature 14 | type: number 15 | minValue: 0 16 | maxValue: 2 17 | defaultValue: 0.7 18 | required: false 19 | description: 采样温度 20 | - name: maxTokens 21 | type: number 22 | minValue: 1 23 | maxValue: 4096 24 | defaultValue: 1024 25 | required: false 26 | description: 最大输出token -------------------------------------------------------------------------------- /frontend/packages/main/src/request/download.ts: -------------------------------------------------------------------------------- 1 | import request, { baseURL, session } from './request'; 2 | import { UPLOAD_METHOD } from './upload'; 3 | 4 | export async function getPreviewUrl(filePath: string) { 5 | const upload_method = window.g_config.config.upload_method; 6 | 7 | if (upload_method === UPLOAD_METHOD.OSS) { 8 | const response = await request({ 9 | url: `/console/v1/files/get-preview-url`, 10 | method: 'GET', 11 | params: { 12 | path: filePath, 13 | }, 14 | }); 15 | 16 | return response.data.data; 17 | } 18 | if (upload_method === UPLOAD_METHOD.FILE) 19 | return `${baseURL.get()}/console/v1/files/download?path=${encodeURIComponent( 20 | filePath, 21 | )}&preview=true&access_token=${session.get()}`; 22 | } 23 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/resources/elasticsearch.yml: -------------------------------------------------------------------------------- 1 | # Elasticsearch 配置文件 2 | spring: 3 | elasticsearch: 4 | # Elasticsearch 服务地址 5 | # 支持通过环境变量 SPRING_ELASTICSEARCH_URL 覆盖,默认值用于本地开发 6 | url: ${SPRING_ELASTICSEARCH_URL:http://localhost:9200} 7 | # 连接超时时间(毫秒) 8 | connect-timeout: 5000 9 | # 读取超时时间(毫秒) 10 | socket-timeout: 60000 11 | # 连接池配置 12 | connection-pool: 13 | # 最大连接数 14 | max-connections: 100 15 | # 最大空闲连接数 16 | max-idle-connections: 50 17 | # 连接保活时间(毫秒) 18 | keep-alive: 300000 19 | 20 | # 应用追踪配置 21 | app: 22 | tracing: 23 | # 索引配置 24 | index: 25 | # traces 索引名称 26 | traces-index: loongsuite_traces 27 | # 索引分片数 28 | shards: 1 29 | # 索引副本数 30 | replicas: 0 -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Login/components/Login/GithubLogin.tsx: -------------------------------------------------------------------------------- 1 | import $i18n from '@/i18n'; 2 | import { authGithubLogin } from '@/services/login'; 3 | import { GithubFilled } from '@ant-design/icons'; 4 | import { Button } from '@spark-ai/design'; 5 | import styles from './index.module.less'; 6 | 7 | export default function () { 8 | return ( 9 | 23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/components/GroupVariableForm/index.module.less: -------------------------------------------------------------------------------- 1 | .spark-flow-group-variable-form { 2 | padding: 16px 16px 12px; 3 | background: var(--ag-ant-color-fill-tertiary); 4 | border-radius: 6px; 5 | 6 | &-label { 7 | font-size: 12px; 8 | color: var(--ag-ant-color-text-secondary); 9 | } 10 | 11 | .spark-flow-hover-icon { 12 | opacity: 0; 13 | pointer-events: none; 14 | } 15 | 16 | &:hover { 17 | .spark-flow-hover-icon { 18 | opacity: 1; 19 | visibility: visible; 20 | pointer-events: auto; 21 | } 22 | } 23 | 24 | .spark-flow-name-input-ok-btn { 25 | color: var(--ag-ant-color-teal); 26 | font-size: 20px; 27 | } 28 | 29 | .spark-flow-name-input-cancel-btn { 30 | font-size: 20px; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/DatasetUpdateRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import com.alibaba.cloud.ai.studio.admin.dto.DatasetColumn; 4 | import jakarta.validation.constraints.NotNull; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | public class DatasetUpdateRequest { 11 | 12 | /** 13 | * 数据集名称 14 | */ 15 | @NotNull 16 | private String name; 17 | 18 | /** 19 | * 数据集描述 20 | */ 21 | private String description; 22 | 23 | /** 24 | * 列结构配置 25 | */ 26 | @NotNull 27 | private List columnsConfig; 28 | 29 | 30 | /** 31 | * 数据集ID 32 | */ 33 | @NotNull 34 | Long datasetId; 35 | } -------------------------------------------------------------------------------- /frontend/packages/main/src/layouts/LoginProvider.tsx: -------------------------------------------------------------------------------- 1 | import { getAccountInfo } from '@/services/account'; 2 | import { useRequest } from 'ahooks'; 3 | import { Spin } from 'antd'; 4 | import { history } from 'umi'; 5 | 6 | export default function (props: { 7 | children: React.ReactNode | React.ReactNode[]; 8 | }) { 9 | const { loading } = useRequest(getAccountInfo, { 10 | onSuccess(res) { 11 | window.g_config.user = res.data; 12 | }, 13 | onError() { 14 | if (new URL(window.location.href).searchParams.get('ignore-login')) 15 | return; 16 | history.replace('/login'); 17 | }, 18 | }); 19 | 20 | if (loading) 21 | return ( 22 |
23 | 24 |
25 | ); 26 | 27 | return props.children; 28 | } 29 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/DataItemCreateFromTraceRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import com.alibaba.cloud.ai.studio.admin.dto.DatasetColumn; 4 | import jakarta.validation.constraints.NotNull; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | public class DataItemCreateFromTraceRequest { 11 | /** 12 | * 测评集ID 13 | */ 14 | @NotNull(message = "测评集ID不能为空") 15 | private Long datasetId; 16 | 17 | 18 | @NotNull(message = "测评集版本ID不能为空") 19 | private Long datasetVersionId; 20 | 21 | private List dataContent; 22 | 23 | /** 24 | * 列结构配置(JSON格式) 25 | */ 26 | 27 | private List columnsConfig; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /frontend/packages/main/src/layouts/Header.tsx: -------------------------------------------------------------------------------- 1 | import { getCommonConfig } from '@spark-ai/design'; 2 | import { history } from 'umi'; 3 | import styles from './index.module.less'; 4 | 5 | type TChildren = React.ReactNode | React.ReactNode[]; 6 | 7 | export default function (props: { 8 | logo?: string; 9 | children?: TChildren; 10 | right?: TChildren; 11 | }) { 12 | const darkMode = getCommonConfig().isDarkMode; 13 | 14 | return ( 15 |
16 | history.push('/')} 19 | src={darkMode ? '/images/logoBlack.png' : '/images/logoWhite.png'} 20 | /> 21 | {props.children} 22 |
{props.right}
23 |
24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Knowledge/Test/components/Form/index.module.less: -------------------------------------------------------------------------------- 1 | .form-container { 2 | width: 340px; 3 | flex: 0 0 340px; 4 | height: 100%; 5 | overflow: auto; 6 | padding: 20px; 7 | border-right: 1px solid var(--ag-ant-color-border-secondary); 8 | } 9 | 10 | 11 | .form-title { 12 | font-size: 14px; 13 | font-weight: 500; 14 | line-height: 24px; 15 | color: var(--ag-ant-color-text); 16 | margin-bottom: 20px; 17 | } 18 | 19 | .form-item-label { 20 | display: flex; 21 | align-items: center; 22 | gap: 4px; 23 | color: var(--ag-ant-color-text); 24 | } 25 | 26 | .info-icon { 27 | font-size: 16px; 28 | color: var(--ag-ant-color-text-tertiary); 29 | } 30 | 31 | .submit-button { 32 | width: 100%; 33 | } 34 | 35 | .form-item-submit { 36 | margin-top: 48px; 37 | } 38 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/components/TestPanel/index.tsx: -------------------------------------------------------------------------------- 1 | import $i18n from '@/i18n'; 2 | import { DragPanel, PanelContainer } from '@spark-ai/flow'; 3 | import React, { memo } from 'react'; 4 | 5 | export default memo(function TestPanel(props: { 6 | open: boolean; 7 | setOpen: (open: boolean) => void; 8 | }) { 9 | const { open, setOpen } = props; 10 | if (!open) return null; 11 | return ( 12 | 13 | setOpen(false)} 19 | > 20 |
TestPanel
21 |
22 |
23 | ); 24 | }); 25 | -------------------------------------------------------------------------------- /frontend/packages/main/src/components/Table/index.module.less: -------------------------------------------------------------------------------- 1 | .table { 2 | :global { 3 | .ant-table-content { 4 | --ag-ant-table-header-bg: transparent; 5 | --ag-ant-table-header-color: var(--ag-ant-color-text-tertiary); 6 | --ag-ant-table-cell-padding-block: 10px; 7 | --ag-ant-table-cell-padding-inline: 20px; 8 | } 9 | 10 | thead.ant-table-thead > tr > th { 11 | border-top: 1px solid var(--ag-ant-color-border-secondary); 12 | font-weight: normal; 13 | line-height: 20px; 14 | font-size: 12px; 15 | } 16 | 17 | tbody.ant-table-tbody > tr > td { 18 | --ag-ant-table-cell-padding-block: 12px; 19 | line-height: 24px; 20 | } 21 | 22 | thead.ant-table-thead > tr > th::before { 23 | content: none !important; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/components/OutputParamsTree/index.less: -------------------------------------------------------------------------------- 1 | @import '../../index.less'; 2 | .spark-flow-output-params-tree-node { 3 | display: flex; 4 | flex-direction: column; 5 | gap: 4px; 6 | 7 | .spark-flow-output-params-tree-node-label { 8 | display: flex; 9 | align-items: center; 10 | gap: 4px; 11 | font-weight: 500; 12 | font-size: 14px; 13 | color: e('var(--@{ant-prefix}-color-text)'); 14 | } 15 | 16 | .spark-flow-output-params-tree-node-desc { 17 | font-size: 12px; 18 | line-height: 20px; 19 | color: e('var(--@{ant-prefix}-color-text-tertiary)'); 20 | } 21 | } 22 | 23 | .spark-flow-output-params-tree-node-properties { 24 | margin-left: 6px; 25 | padding-left: 8px; 26 | border-left: 1px solid e('var(--@{ant-prefix}-color-border-secondary)'); 27 | } 28 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/ExperimentEvaluatorResult.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | 6 | import java.math.BigDecimal; 7 | 8 | @Data 9 | @Builder 10 | public class ExperimentEvaluatorResult { 11 | 12 | /** 13 | * 实验ID 14 | */ 15 | private Long experimentId; 16 | 17 | 18 | /** 19 | * 评估平均得分(0.0-1.0) 20 | */ 21 | private BigDecimal averageScore; 22 | 23 | 24 | /** 25 | * 评估器版本ID 26 | */ 27 | private Long evaluatorVersionId; 28 | 29 | 30 | /** 31 | * 进度 32 | */ 33 | private Integer progress; 34 | 35 | 36 | private Integer completeItemsCount; 37 | 38 | private Integer totalItemsCount; 39 | 40 | 41 | 42 | } -------------------------------------------------------------------------------- /frontend/packages/main/src/types/workflow.ts: -------------------------------------------------------------------------------- 1 | import type { 2 | INodeDataInputParamItem, 3 | INodeDataOutputParamItem, 4 | } from '@spark-ai/flow'; 5 | 6 | export interface IBizNode { 7 | id: string; 8 | type: string; 9 | name: string; 10 | position: { 11 | x: number; 12 | y: number; 13 | }; 14 | config: { 15 | input_params: INodeDataInputParamItem[]; 16 | output_params: INodeDataOutputParamItem[]; 17 | node_param: any; 18 | }; 19 | desc?: string; 20 | width: number; 21 | height?: number; 22 | parent_id?: string; 23 | } 24 | 25 | export interface IBizEdge { 26 | id: string; 27 | source: string; 28 | target: string; 29 | source_handle?: string; 30 | target_handle?: string; 31 | } 32 | 33 | export interface IBizFlowData { 34 | nodes: IBizNode[]; 35 | edges: IBizEdge[]; 36 | } 37 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/components/InputTextArea/index.less: -------------------------------------------------------------------------------- 1 | @import '../../index.less'; 2 | 3 | .spark-flow-input-text-area { 4 | border-radius: 6px; 5 | border: 1px solid e('var(--@{ant-prefix}-color-border-secondary)'); 6 | 7 | &-header { 8 | display: flex; 9 | justify-content: space-between; 10 | align-items: center; 11 | background: e('var(--@{ant-prefix}-color-fill-quaternary)'); 12 | border-radius: 6px 6px 0 0; 13 | height: 24px; 14 | padding: 0 12px; 15 | } 16 | 17 | .spark-flow-var-input-text-area { 18 | border-radius: 0; 19 | border: none; 20 | min-height: initial; 21 | max-height: initial; 22 | height: 180px; 23 | } 24 | 25 | &.spark-flow-input-text-area-fold { 26 | .spark-flow-var-input-text-area { 27 | height: 90px; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/ModelParameterDef.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ModelParameterDef { 7 | 8 | /** 9 | * 参数名 10 | */ 11 | private String name; 12 | 13 | /** 14 | * 参数类型: number, string, boolean 15 | */ 16 | private String type; 17 | 18 | /** 19 | * 默认值 20 | */ 21 | private Object defaultValue; 22 | 23 | /** 24 | * 最小值(数字类型) 25 | */ 26 | private Object minValue; 27 | 28 | /** 29 | * 最大值(数字类型) 30 | */ 31 | private Object maxValue; 32 | 33 | /** 34 | * 参数描述 35 | */ 36 | private String description; 37 | 38 | /** 39 | * 是否必填 40 | */ 41 | private Boolean required; 42 | } 43 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Component/AppComponent/components/DetailDrawer/index.module.less: -------------------------------------------------------------------------------- 1 | .form-title { 2 | font-size: 16px; 3 | font-weight: 500; 4 | line-height: 24px; 5 | } 6 | 7 | .form-item { 8 | display: flex; 9 | gap: 4px; 10 | flex-direction: column; 11 | 12 | .label { 13 | font-size: 13px; 14 | font-weight: 500; 15 | line-height: 20px; 16 | color: var(--ag-ant-color-text); 17 | } 18 | 19 | .value { 20 | font-size: 14px; 21 | line-height: 24px; 22 | color: var(--ag-ant-color-text-secondary); 23 | } 24 | } 25 | 26 | .form-drawer { 27 | :global { 28 | .ag-ant-drawer-body { 29 | padding: 0; 30 | } 31 | } 32 | } 33 | 34 | .form-con { 35 | padding: 20px 24px; 36 | &:not(:last-child) { 37 | border-bottom: 1px solid var(--ag-ant-color-border-secondary); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/EvaluatorVersionCreateRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class EvaluatorVersionCreateRequest { 7 | 8 | /** 9 | * 评估器Id 10 | */ 11 | private String evaluatorId; 12 | 13 | /** 14 | * 评估器版本描述 15 | */ 16 | private String description; 17 | 18 | /** 19 | * 模型ID 20 | */ 21 | private String modelConfig; 22 | 23 | /** 24 | * Prompt 25 | */ 26 | private String prompt; 27 | 28 | 29 | /** 30 | * 评估器 版本号 31 | */ 32 | 33 | private String version; 34 | 35 | 36 | 37 | /** 38 | * 版本状态 39 | */ 40 | private String status; 41 | 42 | 43 | private String variables; 44 | 45 | } -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Component/Plugin/List/index.tsx: -------------------------------------------------------------------------------- 1 | import { useInnerLayout } from '@/components/InnerLayout/utils'; 2 | import $i18n from '@/i18n'; 3 | import { Button, IconFont } from '@spark-ai/design'; 4 | import { history } from 'umi'; 5 | import List from './List'; 6 | 7 | export default function () { 8 | const portal = useInnerLayout(); 9 | 10 | return ( 11 | <> 12 | {portal.rightPortal( 13 | , 23 | )} 24 | 25 | 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/observation/IgnoreStudioHttpSpanPredicate.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.observation; 2 | 3 | import io.micrometer.observation.Observation.Context; 4 | import io.micrometer.observation.ObservationPredicate; 5 | import org.springframework.stereotype.Component; 6 | 7 | @Component 8 | public class IgnoreStudioHttpSpanPredicate implements ObservationPredicate { 9 | 10 | /** 11 | * Ignore Http Span of Studio 12 | */ 13 | @Override 14 | public boolean test(String name, Context context) { 15 | return !(context instanceof org.springframework.http.server.observation.ServerRequestObservationContext) 16 | && !(context instanceof org.springframework.http.server.reactive.observation.ServerRequestObservationContext); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /frontend/packages/main/src/components/ScrollMenu/index.tsx: -------------------------------------------------------------------------------- 1 | import classNames from 'classnames'; 2 | import styles from './index.module.less'; 3 | 4 | interface IProps { 5 | menus: Array; 6 | handleMenuClick: (val: number) => void; 7 | activeMenuCode: number; 8 | } 9 | 10 | export default function ScrollMenu({ 11 | menus, 12 | handleMenuClick, 13 | activeMenuCode, 14 | }: IProps) { 15 | return ( 16 |
17 | {menus.map((menuItem, index) => ( 18 |
handleMenuClick(index)} 20 | key={index} 21 | className={classNames(styles['step-item'], { 22 | [styles['active']]: index === activeMenuCode, 23 | })} 24 | > 25 | 26 | {menuItem} 27 |
28 | ))} 29 |
30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/DatasetVersionCreateRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import com.alibaba.cloud.ai.studio.admin.dto.DatasetColumn; 4 | import jakarta.validation.constraints.NotNull; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | public class DatasetVersionCreateRequest { 11 | 12 | /** 13 | * 数据集Id 14 | */ 15 | @NotNull 16 | private Long datasetId; 17 | 18 | /** 19 | * 数据集版本描述 20 | */ 21 | private String description; 22 | 23 | /** 24 | * 列结构配置 25 | */ 26 | @NotNull 27 | private List columnsConfig; 28 | 29 | /** 30 | * 数据集ID 31 | */ 32 | @NotNull 33 | private List datasetItems; 34 | 35 | 36 | String status; 37 | } -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/components/GroupVariableForm/index.less: -------------------------------------------------------------------------------- 1 | @import '../../index.less'; 2 | 3 | .spark-flow-group-variable-form { 4 | padding: 16px 16px 12px; 5 | background: e('var(--@{ant-prefix}-color-fill-tertiary)'); 6 | border-radius: 6px; 7 | 8 | &-label { 9 | font-size: 12px; 10 | color: e('var(--@{ant-prefix}-color-text-secondary)'); 11 | } 12 | 13 | .spark-flow-hover-icon { 14 | opacity: 0; 15 | pointer-events: none; 16 | } 17 | 18 | &:hover { 19 | .spark-flow-hover-icon { 20 | opacity: 1; 21 | visibility: visible; 22 | pointer-events: auto; 23 | } 24 | } 25 | 26 | .spark-flow-name-input-ok-btn { 27 | color: e('var(--@{ant-prefix}-color-teal)'); 28 | font-size: 20px; 29 | } 30 | 31 | .spark-flow-name-input-cancel-btn { 32 | font-size: 20px; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /frontend/packages/main/src/defaultSettings.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | agentSystemPromptMaxLength: 10000, // Maximum length for agent system prompt 3 | agentUserPromptMaxLength: 10000, // Maximum length for agent user prompt 4 | agentAgentComponentMaxLimit: 5, // Maximum number of agent components per agent 5 | agentWorkflowComponentMaxLimit: 5, // Maximum number of workflow components per agent 6 | agentKnowledgeBaseMaxLimit: 10, // Maximum number of knowledge bases per agent 7 | agentMcpMaxLimit: 5, // Maximum number of MCPs per agent 8 | agentToolMaxLimit: 10, // Maximum number of plugin tools per agent 9 | agentPresetQuestionMaxLimit: 5, // Maximum number of preset questions per agent 10 | agentWelcomeMessageMaxLength: 2000, // Maximum length for agent welcome message 11 | agentSSETimeout: '180000', // SSE connection timeout for agent conversation API (in milliseconds) 12 | }; 13 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/hooks/useInitDebug.ts: -------------------------------------------------------------------------------- 1 | import { initWorkFlowDebug } from '@/services/workflow'; 2 | import { useCallback } from 'react'; 3 | import { useWorkflowAppStore } from '../context/WorkflowAppProvider'; 4 | 5 | export const useInitDebug = () => { 6 | const appId = useWorkflowAppStore((store) => store.appId); 7 | const showTest = useWorkflowAppStore((store) => store.showTest); 8 | const setDebugInputParams = useWorkflowAppStore( 9 | (store) => store.setDebugInputParams, 10 | ); 11 | const initDebug = useCallback( 12 | (force = false) => { 13 | if (!appId || (!showTest && !force)) return; 14 | initWorkFlowDebug({ 15 | app_id: appId, 16 | }).then((res) => { 17 | setDebugInputParams(res); 18 | }); 19 | }, 20 | [appId, showTest], 21 | ); 22 | 23 | return { 24 | initDebug, 25 | }; 26 | }; 27 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/service/client/ChatClientFactory.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.service.client; 2 | 3 | import com.alibaba.cloud.ai.studio.admin.dto.ModelConfigInfo; 4 | import com.alibaba.cloud.ai.studio.admin.entity.ModelConfigDO; 5 | import io.micrometer.observation.ObservationRegistry; 6 | import org.springframework.ai.chat.client.ChatClient; 7 | import org.springframework.ai.chat.model.ChatModel; 8 | import org.springframework.ai.chat.prompt.ChatOptions; 9 | 10 | import java.util.Map; 11 | 12 | public interface ChatClientFactory { 13 | 14 | String getSupportProvider(); 15 | 16 | ChatModel buildChatModel(ModelConfigDO modelConfig); 17 | 18 | ChatOptions buildChatOptions(ModelConfigDO modelConfig,Map userParameters, Map observationMetadata); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Knowledge/Detail/SliceConfiguration/components/Form/index.module.less: -------------------------------------------------------------------------------- 1 | .form-container { 2 | width: 637px; 3 | padding: 20px; 4 | box-sizing: border-box; 5 | height: 100%; 6 | border-right: 1px solid var(--ag-ant-color-border-secondary); 7 | flex-shrink: 0; 8 | overflow: auto; 9 | } 10 | 11 | .form-title { 12 | font-size: 14px; 13 | font-weight: 500; 14 | line-height: 24px; 15 | color: var(--ag-ant-color-text); 16 | margin-bottom: 20px; 17 | } 18 | 19 | .form-item-label { 20 | display: flex; 21 | align-items: center; 22 | gap: 4px; 23 | color: var(--ag-ant-color-text); 24 | } 25 | 26 | .info-icon { 27 | font-size: 16px; 28 | color: var(--ag-ant-color-text-tertiary); 29 | } 30 | 31 | .submit-button { 32 | width: 100%; 33 | } 34 | 35 | .chunk-type { 36 | width: 290px; 37 | } 38 | 39 | .submit-icon { 40 | font-size: 20px; 41 | } 42 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Login/components/Form/Email.tsx: -------------------------------------------------------------------------------- 1 | import $i18n from '@/i18n'; 2 | import { IconFont, Input, InputProps } from '@spark-ai/design'; 3 | import classNames from 'classnames'; 4 | import React from 'react'; 5 | import styles from './Email.module.less'; 6 | 7 | const Email: React.FC = (props) => { 8 | const { 9 | placeholder = $i18n.get({ 10 | id: 'main.pages.Login.components.Form.Email.enterYourAccount', 11 | dm: '输入您的账号', 12 | }), 13 | className, 14 | ...restProps 15 | } = props; 16 | 17 | return ( 18 | 23 | } 24 | allowClear 25 | {...restProps} 26 | /> 27 | ); 28 | }; 29 | 30 | export default Email; 31 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/components/ExtractParamItem/index.module.less: -------------------------------------------------------------------------------- 1 | .extract-param-item { 2 | padding: 10px 12px; 3 | border: 1px solid var(--ag-ant-color-border-secondary); 4 | border-radius: 6px; 5 | font-size: 13px; 6 | line-height: 20px; 7 | transition: 0.4s ease-in-out; 8 | cursor: pointer; 9 | 10 | &-key { 11 | font-weight: 500; 12 | max-width: 200px !important; 13 | } 14 | 15 | &-info, 16 | &-type, 17 | &-desc { 18 | color: var(--ag-ant-color-text-secondary); 19 | } 20 | 21 | &-actions { 22 | display: none; 23 | } 24 | 25 | &:hover { 26 | box-shadow: var(--ag-ant-box-shadow); 27 | border-color: var(--ag-ant-color-primary); 28 | 29 | .extract-param-item-info { 30 | display: none; 31 | } 32 | 33 | .extract-param-item-actions { 34 | display: flex; 35 | font-size: 16px; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Login/components/Form/Password.tsx: -------------------------------------------------------------------------------- 1 | import $i18n from '@/i18n'; 2 | import { IconFont, Input, InputProps } from '@spark-ai/design'; 3 | import classNames from 'classnames'; 4 | import React from 'react'; 5 | import styles from './Password.module.less'; 6 | 7 | const Password: React.FC = (props) => { 8 | const { 9 | placeholder = $i18n.get({ 10 | id: 'main.pages.Login.components.Form.Password.enterYourPassword', 11 | dm: '输入您的密码', 12 | }), 13 | className, 14 | ...restProps 15 | } = props; 16 | 17 | return ( 18 | 23 | } 24 | {...restProps} 25 | /> 26 | ); 27 | }; 28 | 29 | export default Password; 30 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Setting/ModelService/components/ProviderAvatar/index.tsx: -------------------------------------------------------------------------------- 1 | import { IProviderConfigInfo } from '@/types/modelService'; 2 | import { Avatar, IconFont } from '@spark-ai/design'; 3 | import classNames from 'classnames'; 4 | import styles from './index.module.less'; 5 | 6 | interface ProviderAvatarProps { 7 | provider: IProviderConfigInfo | null; 8 | className?: string; 9 | } 10 | 11 | export const ProviderAvatar: React.FC = ({ 12 | provider, 13 | className, 14 | }) => { 15 | if (provider?.icon) { 16 | return ( 17 | 21 | ); 22 | } 23 | 24 | return ( 25 | 26 | {provider?.name?.charAt(0).toUpperCase() || 'P'} 27 | 28 | ); 29 | }; 30 | -------------------------------------------------------------------------------- /frontend/packages/main/src/utils/uniqueId.ts: -------------------------------------------------------------------------------- 1 | const charset = [ 2 | ['0', '9'], 3 | ['a', 'z'], 4 | ['A', 'Z'], 5 | ] 6 | .map((pair) => pair.map((char) => char.charCodeAt(0))) 7 | .flatMap(([start, end]) => 8 | Array.from({ length: end - start + 1 }, (_, index) => start + index), 9 | ); 10 | 11 | const randomId = (length: number): string => { 12 | return String.fromCharCode.apply( 13 | String, 14 | Array.from( 15 | { length }, 16 | () => charset[Math.floor(Math.random() * charset.length)], 17 | ), 18 | ); 19 | }; 20 | 21 | let _seed = 0; 22 | const incrementalId = (length: number): string => { 23 | _seed += 1; 24 | return `${_seed.toString(16)}######`.substring(0, length); 25 | }; 26 | 27 | let _strategy = 'random'; 28 | export default function uniqueId(length: number): string { 29 | return _strategy === 'incremental' ? incrementalId(length) : randomId(length); 30 | } 31 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/generator/model/chatbot/ChatBot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.alibaba.cloud.ai.studio.admin.builder.generator.model.chatbot; 17 | 18 | public class ChatBot { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Component/AppComponent/components/EditDrawer/index.module.less: -------------------------------------------------------------------------------- 1 | .form-title { 2 | font-size: 16px; 3 | font-weight: 500; 4 | line-height: 24px; 5 | 6 | &.required { 7 | display: flex; 8 | align-items: center; 9 | gap: 4px; 10 | } 11 | } 12 | 13 | .form { 14 | :global { 15 | .ag-ant-form-item-label { 16 | font-size: 13px; 17 | font-weight: 500; 18 | } 19 | } 20 | } 21 | 22 | .form-item-con { 23 | padding: 20px 24px; 24 | &:not(:last-child) { 25 | border-bottom: 1px solid var(--ag-ant-color-border-secondary); 26 | } 27 | 28 | :global { 29 | .ag-ant-form-item-label { 30 | padding-bottom: 4px !important; 31 | } 32 | 33 | .ag-ant-form-item { 34 | margin-bottom: 0px !important; 35 | } 36 | } 37 | } 38 | 39 | .drawer { 40 | :global { 41 | .ag-ant-drawer-body { 42 | padding: 0; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/components/ExtractParamItem/index.less: -------------------------------------------------------------------------------- 1 | @import '../../index.less'; 2 | 3 | .spark-flow-panel-extract-param-item { 4 | padding: 10px 20px; 5 | border: 1px solid e('var(--@{ant-prefix}-color-border-secondary)'); 6 | border-radius: 6px; 7 | font-size: 13px; 8 | line-height: 20px; 9 | transition: 0.4s ease-in-out; 10 | cursor: pointer; 11 | 12 | &-info, 13 | &-type { 14 | color: e('var(--@{ant-prefix}-color-text-secondary)'); 15 | } 16 | 17 | &-actions { 18 | display: none; 19 | } 20 | 21 | &:hover { 22 | box-shadow: e('var(--@{ant-prefix}-box-shadow)'); 23 | border-color: e('var(--@{ant-prefix}-color-primary)'); 24 | 25 | .spark-flow-panel-extract-param-item-info { 26 | display: none; 27 | } 28 | 29 | .spark-flow-panel-extract-param-item-actions { 30 | display: flex; 31 | font-size: 16px; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/hooks/useFlowDebugInteraction.tsx: -------------------------------------------------------------------------------- 1 | import { IWorkFlowTaskProcess } from '@/types/work-flow'; 2 | import { useCallback } from 'react'; 3 | import { useStore } from '../flow/context'; 4 | import { useEdgesInteraction } from './useEdgesInteraction'; 5 | 6 | export const useFlowDebugInteraction = () => { 7 | const setTaskStore = useStore((s) => s.setTaskStore); 8 | const { updateEdgeByNodeResults, hiddenEdgeStatus } = useEdgesInteraction(); 9 | 10 | const updateTaskStore = useCallback( 11 | (val: IWorkFlowTaskProcess) => { 12 | setTaskStore(val); 13 | updateEdgeByNodeResults(val.node_results); 14 | }, 15 | [setTaskStore, updateEdgeByNodeResults], 16 | ); 17 | 18 | const clearTaskStore = useCallback(() => { 19 | setTaskStore(void 0); 20 | hiddenEdgeStatus(); 21 | }, [setTaskStore, hiddenEdgeStatus]); 22 | 23 | return { updateTaskStore, clearTaskStore }; 24 | }; 25 | -------------------------------------------------------------------------------- /frontend/.stylelintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: require.resolve('umi/stylelint'), 3 | customSyntax: 'postcss-less', 4 | rules: { 5 | 'shorthand-property-no-redundant-values': null, 6 | 'alpha-value-notation': null, 7 | 'rule-empty-line-before': null, 8 | 'value-no-vendor-prefix': null, 9 | 'length-zero-no-unit': null, 10 | 'keyframes-name-pattern': null, 11 | 'declaration-empty-line-before': null, 12 | 'value-keyword-case': null, 13 | 'at-rule-no-unknown': [ 14 | true, 15 | { 16 | ignoreAtRules: [ 17 | 'tailwind', 18 | 'apply', 19 | 'variants', 20 | 'responsive', 21 | 'screen', 22 | 'layer', 23 | ], 24 | }, 25 | ], 26 | 'selector-class-pattern': null, 27 | 'function-no-unknown': [ 28 | true, 29 | { 30 | ignoreFunctions: ['e'], 31 | }, 32 | ], 33 | }, 34 | }; 35 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/MCP/components/McpCard/index.module.less: -------------------------------------------------------------------------------- 1 | .status-tag { 2 | display: flex; 3 | align-items: center; 4 | font-size: 12px; 5 | white-space: nowrap; 6 | 7 | .dot { 8 | display: inline-block; 9 | width: 6px; 10 | height: 6px; 11 | border-radius: 50%; 12 | margin-right: 6px; 13 | background-color: currentcolor; 14 | } 15 | 16 | &[data-color='success'] { 17 | color: var(--ag-ant-color-success); 18 | } 19 | 20 | &[data-color='error'] { 21 | color: var(--ag-ant-color-error); 22 | } 23 | 24 | &[data-color='processing'] { 25 | color: var(--ag-ant-color-primary); 26 | } 27 | 28 | &[data-color='warning'] { 29 | color: var(--ag-ant-color-warning); 30 | } 31 | 32 | &[data-color='default'] { 33 | color: var(--ag-ant-color-text-quaternary); 34 | } 35 | } 36 | 37 | .update-time { 38 | color: var(--ag-ant-color-text-secondary); 39 | font-size: 12px; 40 | } 41 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-runtime/src/main/java/com/alibaba/cloud/ai/studio/runtime/domain/workflow/ParamSourceEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.alibaba.cloud.ai.studio.runtime.domain.workflow; 17 | 18 | public enum ParamSourceEnum { 19 | 20 | sys, user, conversation 21 | 22 | } 23 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/request/TracesQueryRequest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto.request; 2 | 3 | import jakarta.validation.constraints.Max; 4 | import jakarta.validation.constraints.Min; 5 | import jakarta.validation.constraints.NotBlank; 6 | import lombok.Data; 7 | 8 | @Data 9 | public class TracesQueryRequest { 10 | 11 | private String serviceName; 12 | 13 | private String traceId; 14 | 15 | private String spanName; 16 | 17 | @NotBlank(message = "开始时间不能为空") 18 | private String startTime; 19 | 20 | @NotBlank(message = "结束时间不能为空") 21 | private String endTime; 22 | 23 | @Min(value = 1, message = "页码最小值为1") 24 | private Integer pageNumber = 1; 25 | 26 | @Min(value = 1, message = "每页大小最小值为1") 27 | @Max(value = 200, message = "每页大小最大值为200") 28 | private Integer pageSize = 50; 29 | 30 | private String attributes; 31 | } -------------------------------------------------------------------------------- /frontend/packages/main/src/components/ScrollMenu/index.module.less: -------------------------------------------------------------------------------- 1 | .content { 2 | position: relative; 3 | &::after { 4 | content: ''; 5 | position: absolute; 6 | height: 100%; 7 | width: 2px; 8 | top: 0; 9 | left: -2px; 10 | z-index: 1; 11 | border-left: 2px solid var(--ag-ant-color-primary-border); 12 | } 13 | .step-item { 14 | cursor: pointer; 15 | display: flex; 16 | align-items: center; 17 | font-size: 14px; 18 | line-height: 30px; 19 | position: relative; 20 | padding-left: 16px; 21 | width: 80px; 22 | 23 | &:hover, 24 | &.active { 25 | color: var(--ag-ant-color-primary-hover); 26 | &::after { 27 | content: ''; 28 | position: absolute; 29 | height: 100%; 30 | width: 2px; 31 | left: -2px; 32 | z-index: 9; 33 | border-left: 2px solid var(--ag-ant-color-primary-hover); 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/entity/EvaluatorDO.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.entity; 2 | 3 | import jakarta.persistence.*; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | 7 | import java.time.LocalDateTime; 8 | 9 | @Data 10 | @Builder 11 | public class EvaluatorDO { 12 | 13 | /** 14 | * 主键ID 15 | */ 16 | @Id 17 | @GeneratedValue(strategy = GenerationType.IDENTITY) 18 | private Long id; 19 | 20 | /** 21 | * 评估器名称 22 | */ 23 | private String name; 24 | 25 | /** 26 | * 评估器描述 27 | */ 28 | private String description; 29 | 30 | 31 | 32 | /** 33 | * 创建时间 34 | */ 35 | 36 | private LocalDateTime createTime; 37 | 38 | /** 39 | * 更新时间 40 | */ 41 | private LocalDateTime updateTime; 42 | 43 | /** 44 | * 逻辑删除标识:0-未删除,1-已删除 45 | */ 46 | private Integer deleted; 47 | 48 | } -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/demos/flow-demo/components/SingleNodeDrawer/index.less: -------------------------------------------------------------------------------- 1 | @import '../../index.less'; 2 | 3 | .spark-flow-single-node-drawer-title { 4 | font-size: 16px; 5 | line-height: 24px; 6 | color: e('var(--@{ant-prefix}-color-text)'); 7 | } 8 | 9 | .spark-flow-drawer, 10 | .spark-flow-drawer-mask { 11 | border-radius: 8px; 12 | } 13 | 14 | .spark-flow-drawer .@{ant-prefix}-drawer-header-title { 15 | flex-direction: row-reverse; 16 | } 17 | 18 | .spark-flow-single-var-name { 19 | font-size: 13px; 20 | font-weight: 500; 21 | line-height: 20px; 22 | } 23 | 24 | .spark-flow-single-var-type, 25 | .spark-flow-single-var-desc { 26 | font-size: 12px; 27 | line-height: 20px; 28 | color: e('var(--@{ant-prefix}-color-text-tertiary)'); 29 | } 30 | 31 | .spark-flow-panel-form-title { 32 | font-weight: 500; 33 | font-size: 13px; 34 | line-height: 20px; 35 | display: flex; 36 | align-items: center; 37 | gap: 4px; 38 | } 39 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/generator/service/runner/RunnableModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.alibaba.cloud.ai.studio.admin.builder.generator.service.runner; 17 | 18 | public interface RunnableModel { 19 | 20 | String id(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/service/PromptRunService.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.service; 2 | 3 | import com.alibaba.cloud.ai.studio.admin.dto.ChatSession; 4 | import com.alibaba.cloud.ai.studio.admin.dto.PromptRunResponse; 5 | import com.alibaba.cloud.ai.studio.admin.dto.request.PromptRunRequest; 6 | import reactor.core.publisher.Flux; 7 | 8 | public interface PromptRunService { 9 | 10 | /** 11 | * 运行Prompt调试(支持持续交互) 12 | * 13 | * @param request 调试请求 14 | * @return 流式响应,包含会话信息 15 | */ 16 | Flux run(PromptRunRequest request); 17 | 18 | /** 19 | * 获取会话信息 20 | * 21 | * @param sessionId 会话ID 22 | * @return 会话对象 23 | */ 24 | ChatSession getSession(String sessionId); 25 | 26 | /** 27 | * 删除会话 28 | * 29 | * @param sessionId 会话ID 30 | */ 31 | void deleteSession(String sessionId); 32 | } 33 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/components/Card/Status.module.less: -------------------------------------------------------------------------------- 1 | .status { 2 | display: flex; 3 | align-items: center; 4 | gap: 8px; 5 | padding: 7px 13px; 6 | } 7 | 8 | .dot { 9 | box-sizing: content-box; 10 | width: 6px; 11 | height: 6px; 12 | border-radius: 50%; 13 | } 14 | 15 | .text { 16 | font-size: 12px; 17 | } 18 | 19 | .published { 20 | .dot { 21 | background: var(--ag-ant-color-success); 22 | border: 2px solid var(--ag-ant-color-success-bg-hover); 23 | } 24 | .text { 25 | color: var(--ag-ant-color-success); 26 | } 27 | } 28 | 29 | .editing { 30 | .dot { 31 | background: var(--ag-ant-color-info); 32 | border: 2px solid var(--ag-ant-color-info-bg-hover); 33 | } 34 | .text { 35 | color: var(--ag-ant-color-info); 36 | } 37 | } 38 | 39 | .draft { 40 | .dot { 41 | background: var(--ag-ant-color-fill-disable); 42 | } 43 | .text { 44 | color: var(--ag-ant-color-text-quaternary); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/entity/DatasetItemDO.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.entity; 2 | 3 | import jakarta.persistence.*; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | 7 | import java.time.LocalDateTime; 8 | 9 | @Data 10 | @Builder 11 | public class DatasetItemDO { 12 | 13 | /** 14 | * 主键ID 15 | */ 16 | @Id 17 | @GeneratedValue(strategy = GenerationType.IDENTITY) 18 | private Long id; 19 | 20 | /** 21 | * 数据集ID 22 | */ 23 | private Long datasetId; 24 | 25 | /** 26 | * 列结构配置(JSON格式) 27 | */ 28 | 29 | private String columnsConfig; 30 | 31 | /** 32 | * 数据内容(JSON格式) 33 | */ 34 | 35 | private String dataContent; 36 | 37 | 38 | /** 39 | * 创建时间 40 | */ 41 | 42 | private LocalDateTime createTime; 43 | 44 | /** 45 | * 更新时间 46 | */ 47 | private LocalDateTime updateTime; 48 | 49 | } -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Component/AppComponent/components/InputParamsComp/index.module.less: -------------------------------------------------------------------------------- 1 | .key-label { 2 | font-size: 12px; 3 | line-height: 20px; 4 | color: var(--ag-ant-color-text-secondary); 5 | 6 | > span { 7 | display: inline-flex; 8 | } 9 | } 10 | 11 | .key-label, 12 | .form-row-item { 13 | .name { 14 | width: 165px; 15 | } 16 | 17 | .type { 18 | width: 110px; 19 | } 20 | 21 | .alias { 22 | width: 100px; 23 | } 24 | 25 | .desc { 26 | width: 166px; 27 | } 28 | 29 | .required, 30 | .enable { 31 | width: 90px; 32 | } 33 | 34 | .default-value { 35 | width: 100px; 36 | } 37 | 38 | .source { 39 | width: 130px; 40 | } 41 | } 42 | 43 | .title-wrap { 44 | .title { 45 | font-size: 13px; 46 | font-weight: 500; 47 | line-height: 20px; 48 | } 49 | } 50 | 51 | .inputs-form { 52 | padding: 12px; 53 | border-radius: 6px; 54 | background: var(--ag-ant-color-fill-quaternary); 55 | } 56 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/resources/application-dev.yml.example: -------------------------------------------------------------------------------- 1 | # 本地开发环境配置示例 2 | # 复制此文件为 application-dev.yml 并根据你的本地环境修改 3 | # 或者直接使用环境变量覆盖默认值 4 | 5 | # 如果本地使用 Docker Compose 启动中间件,可以使用以下配置: 6 | # spring: 7 | # datasource: 8 | # url: jdbc:mysql://localhost:3306/admin?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai 9 | # username: admin 10 | # password: admin 11 | # data: 12 | # redis: 13 | # host: localhost 14 | # port: 6379 15 | # elasticsearch: 16 | # uris: http://localhost:9200 17 | # nacos: 18 | # server-addr: localhost:8848 19 | # rocketmq: 20 | # endpoints: localhost:18080 21 | # management: 22 | # otlp: 23 | # tracing: 24 | # export: 25 | # endpoint: http://localhost:4318/v1/traces 26 | 27 | # 注意:application.yml 中已经设置了默认值(localhost), 28 | # 所以本地开发时通常不需要创建此文件,除非需要覆盖某些配置。 29 | 30 | -------------------------------------------------------------------------------- /frontend/packages/main/src/components/Filter/index.tsx: -------------------------------------------------------------------------------- 1 | import { Flex, Tag } from 'antd'; 2 | import styles from './index.module.less'; 3 | 4 | export interface IFilterProps { 5 | options: { 6 | value: string; 7 | label: string; 8 | }[]; 9 | value: string; 10 | onSelect: (value: string, item: any) => void; 11 | } 12 | 13 | export default function Filter({ options, value, onSelect }: IFilterProps) { 14 | return ( 15 | 16 | {options.map((item) => { 17 | const isActive = item.value === value; 18 | return ( 19 | { 22 | if (isActive) return; 23 | onSelect(item.value, item); 24 | }} 25 | key={item.value} 26 | > 27 | {item.label} 28 | 29 | ); 30 | })} 31 | 32 | ); 33 | } 34 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/hooks/useWorkFlow.tsx: -------------------------------------------------------------------------------- 1 | import { useCallback } from 'react'; 2 | import { WorkflowRunningStatus } from '../constant'; 3 | import { useStore, useWorkflowStore } from '../flow/context'; 4 | 5 | export const useNodesReadOnly = () => { 6 | const workflowStore = useWorkflowStore(); 7 | const taskStore = useStore((s) => s.taskStore); 8 | const readyOnly = useStore((s) => s.readyOnly); 9 | 10 | const getNodesReadOnly = useCallback(() => { 11 | const { taskStore } = workflowStore.getState(); 12 | 13 | return ( 14 | [WorkflowRunningStatus.Running, WorkflowRunningStatus.Paused].includes( 15 | taskStore?.task_status || '', 16 | ) || readyOnly 17 | ); 18 | }, [workflowStore, readyOnly]); 19 | 20 | return { 21 | nodesReadOnly: 22 | [WorkflowRunningStatus.Running, WorkflowRunningStatus.Paused].includes( 23 | taskStore?.task_status || '', 24 | ) || readyOnly, 25 | getNodesReadOnly, 26 | }; 27 | }; 28 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/App/Workflow/nodes/Retrieval/index.module.less: -------------------------------------------------------------------------------- 1 | .panel-form-area { 2 | padding: 12px 16px; 3 | border-radius: 6px; 4 | background: var(--ag-ant-color-bg-layout); 5 | 6 | .panel-form-area-label { 7 | font-size: 12px; 8 | color: var(--ag-ant-color-text-secondary); 9 | display: inline-flex; 10 | align-items: center; 11 | gap: 4px; 12 | width: 90px; 13 | flex-shrink: 0; 14 | } 15 | } 16 | 17 | .add-knowledge-btn { 18 | background: var(--ag-ant-color-bg-layout); 19 | } 20 | 21 | .loading-container { 22 | height: 160px; 23 | } 24 | 25 | .knowledge-name { 26 | flex: 1; 27 | font-size: 12px; 28 | color: var(--ag-ant-color-text-base); 29 | } 30 | 31 | .knowledge-item { 32 | height: 32px; 33 | padding: 0 8px; 34 | background: var(--ag-ant-color-fill-tertiary); 35 | border-radius: 6px; 36 | } 37 | 38 | .right-add { 39 | padding: 0 !important; 40 | font-size: 12px !important; 41 | gap: 4px !important; 42 | } 43 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Component/Plugin/components/ExpandBtn/index.tsx: -------------------------------------------------------------------------------- 1 | import { IconButton } from '@spark-ai/design'; 2 | import classNames from 'classnames'; 3 | import styles from './index.module.less'; 4 | 5 | interface IProps { 6 | expand: boolean; 7 | setExpand: (val: boolean) => void; 8 | } 9 | 10 | export function RightExpandBtn(props: IProps) { 11 | return ( 12 | props.setExpand(!props.expand)} 17 | icon="bl-icon-right-line" 18 | /> 19 | ); 20 | } 21 | 22 | export function TopExpandBtn(props: IProps) { 23 | return ( 24 | props.setExpand(!props.expand)} 26 | className={classNames(styles.expandBtn, styles.top, { 27 | [styles.expand]: props.expand, 28 | })} 29 | icon="bl-icon-up-line" 30 | shape="circle" 31 | /> 32 | ); 33 | } 34 | -------------------------------------------------------------------------------- /spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/dto/OverviewStatsDTO.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.cloud.ai.studio.admin.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | @Builder 11 | public class OverviewStatsDTO { 12 | 13 | @JsonProperty("operation.count") 14 | private StatDetail operationCount; 15 | 16 | @JsonProperty("model.count") 17 | private StatDetail modelCount; 18 | 19 | @JsonProperty("usage.tokens") 20 | private StatDetail usageTokens; 21 | 22 | @Data 23 | @Builder 24 | public static class StatDetail { 25 | private Long total; 26 | private List detail; 27 | } 28 | 29 | @Data 30 | @Builder 31 | public static class StatItem { 32 | private String operationName; 33 | private String modelName; 34 | private Long total; 35 | } 36 | } -------------------------------------------------------------------------------- /frontend/packages/main/src/components/Icon/IconFile.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import type { FileType } from '@/types/base'; 4 | 5 | const pdfLogo = '/images/pdf.svg'; 6 | const mdLogo = '/images/md.svg'; 7 | const excelLogo = '/images/excel.svg'; 8 | const pptLogo = '/images/ppt.svg'; 9 | const txtLogo = '/images/txt.png'; 10 | const wordLogo = '/images/word.png'; 11 | const GeneralLogo = '/images/general.png'; 12 | 13 | interface IconFileProps { 14 | className?: string; 15 | type: FileType; 16 | } 17 | 18 | const IconFile: React.FC = ({ type, className }) => { 19 | const iconMap = { 20 | PDF: pdfLogo, 21 | MD: mdLogo, 22 | Excel: excelLogo, 23 | PPT: pptLogo, 24 | TXT: txtLogo, 25 | DOC: wordLogo, 26 | DOCX: wordLogo, 27 | PPTX: pptLogo, 28 | GENERAL: GeneralLogo, 29 | }; 30 | const iconSrc = iconMap[type] || iconMap.GENERAL; 31 | return ; 32 | }; 33 | 34 | export default IconFile; 35 | -------------------------------------------------------------------------------- /frontend/packages/main/src/pages/Component/Plugin/components/ExampleConfigForm/index.module.less: -------------------------------------------------------------------------------- 1 | .addBtn { 2 | display: inline-flex; 3 | align-items: center; 4 | gap: 4px; 5 | 6 | i { 7 | font-size: 14px; 8 | } 9 | } 10 | 11 | .formArea { 12 | background: var(--ag-ant-color-fill-quaternary); 13 | padding: 16px 16px 16px 20px; 14 | border-radius: 6px; 15 | 16 | .formItem { 17 | padding-right: 16px; 18 | border-radius: 1px solid var(--ag-ant-color-split-secondary); 19 | } 20 | 21 | .deleteBtn { 22 | font-size: 20px; 23 | } 24 | 25 | .label { 26 | font-size: 12px; 27 | line-height: 20px; 28 | color: var(--ag-ant-color-text-description); 29 | } 30 | } 31 | 32 | .title { 33 | font-size: 16px; 34 | font-weight: 500; 35 | line-height: 24px; 36 | } 37 | 38 | .content { 39 | margin-top: 12px; 40 | } 41 | 42 | .tip { 43 | color: var(--ag-ant-color-text-description); 44 | font-size: 12px; 45 | line-height: 20px; 46 | margin-top: 8px; 47 | } 48 | -------------------------------------------------------------------------------- /frontend/packages/spark-flow/src/components/SelectWithDesc/index.tsx: -------------------------------------------------------------------------------- 1 | import { Select, SelectProps } from '@spark-ai/design'; 2 | import { Typography } from 'antd'; 3 | import React, { memo } from 'react'; 4 | import './index.less'; 5 | 6 | export default memo(function SelectWithDesc(props: SelectProps) { 7 | return ( 8 |