diff --git a/packages/studio-explore/src/components/Report/Intention.tsx b/packages/studio-explore/src/components/Report/Intention.tsx index 73e9c203..e015a40c 100644 --- a/packages/studio-explore/src/components/Report/Intention.tsx +++ b/packages/studio-explore/src/components/Report/Intention.tsx @@ -106,6 +106,7 @@ const Intention: React.FunctionComponent = props => { loading: true, }; }); + const { nodes, edges } = filterDataByParticalSchema(intention.schema, data); const _res = await query([ @@ -158,6 +159,10 @@ const Intention: React.FunctionComponent = props => { children: ( Required data + + Please first ensure that the current canvas contains these types of nodes and edges. You can manually + adjust the set of node properties passed to the LLM. + {intention.schema.nodes.map(item => { const { id, label, properties = [] } = item; diff --git a/packages/studio-explore/src/components/Report/index.tsx b/packages/studio-explore/src/components/Report/index.tsx index cd33664e..38730790 100644 --- a/packages/studio-explore/src/components/Report/index.tsx +++ b/packages/studio-explore/src/components/Report/index.tsx @@ -76,7 +76,7 @@ const Report: React.FunctionComponent = props => { intention: ItentionType | null; }>({ loading: false, - task: '请根据我选中的 papers ,分析关键技术随时间的变化,写对应的趋势分析报告', + task: '请根据我选中的 papers ,整理出一份趋势报告,重点考虑时间因素', // '帮我把画布上的papers按照时间和引用数整理成一个分析报告', // '请根据我选中的 papers ,以及 paper 关联的 challenge,写一个 related work section。要求 papers 按照 challenge 进行整理', // '帮我把这些 Papers 整理写成一个 related work 的 section,关注点在 challenge 上', diff --git a/packages/studio-explore/src/components/Report/utils.tsx b/packages/studio-explore/src/components/Report/utils.tsx index 31fde7a5..a1f888a4 100644 --- a/packages/studio-explore/src/components/Report/utils.tsx +++ b/packages/studio-explore/src/components/Report/utils.tsx @@ -22,7 +22,7 @@ export const filterDataByParticalSchema = (schema, data) => { return { id, label, - properties: match.properties.reduce((acc, curr) => { + properties: (match.properties || []).reduce((acc, curr) => { return { ...acc, [curr.name]: properties[curr.name], @@ -41,7 +41,7 @@ export const filterDataByParticalSchema = (schema, data) => { return { id, label, - properties: match.properties.reduce((acc, curr) => { + properties: (match.properties || []).reduce((acc, curr) => { return { ...acc, [curr.name]: properties[curr.name],