SuperAPI AI Directory

industry-research-report

Writing & research

View repository

Updated 10-16 09:45

About this skill

Industry Research Report Generation Skill

Overview

This Skill is used to extract industry keywords from the user's free-form input using the model, call the industry research script to generate a research report, and finally output the final returned title, body text, and PDF/DOC attachment addresses.

Environment Variables

Variable Name Description Default
INDUSTRY_RESEARCH_REPORT_OUTPUT_DIR Report file output directory (optional) ./miaoxiang/industry_research_report

Execution Flow

Step 1: Extract industry keywords {{topic}}

The user's input format is relatively free; it may be a sentence, a phrase, or a passage, but it must contain the key information of the "industry entity".

What you need to do:

  • Accurately extract the industry keyword from the user's question and record it as {{topic}}。
  • When extracting, keep only the core industry entity name and remove extra modifiers (such as "help me take a look", "analyze it", etc.).
  • If the user's question contains multiple industries, prioritize extracting the most core one (they may also be merged when necessary, such as "new energy vehicles").

Example:

User input Extracted {{topic}}
"Help me generate a research report on the semiconductor industry" Semiconductor
"I want to understand the development trends of the new energy vehicle industry" New energy vehicles
"In-depth analysis of the AI chip industry" AI chips
"Please analyze the intersection trends of consumer electronics and smart home" Consumer electronics and smart home

Step 2: Call the industry research report writing script

Using {{topic}} as the input parameter, callscripts/get_data.py the industry research script:

python3 {baseDir}/scripts/get_data.py --query "{{topic}}"

Script function: generate the corresponding industry research report and save it in pdf and docx formats respectively.

Description of script return fields:

{
    "title": "生成的报告标题",
    "truncated_text": "研究报告的部分正文内容",
    "pdf_output_path": "完整报告的pdf文件保存地址",
    "docx_output_path": "完整报告的docx文件保存地址",
    "share_url": "完整报告的分享链接"
}

Note:It is prohibited to run this script in any "background execution, report later" manner. You may only synchronously wait in the current session until the command completes, obtain the stdout result, and then continue. Otherwise Step 3 cannot be executed, causing this Skill to fail.

Step 3: Final output result

After Step 2 succeeds, fill the returned title, truncated_text, pdf_output_dir, docx_output_dir, and other results into the template below to generate the final reply.

《[title]》

已经生成行业研究报告。此处仅展示部分正文内容,请下载附件查看报告详情和参考信息。(不要删减这段话)

[truncated_text]...

**附件:**
- 📄 [title].pdf 已保存到 [pdf_output_path]
- 📄 [title].docx 已保存到 [docx_output_path]

**分享链接:**
[share_url]

Note: If the [truncated_text] part returned by the script in Step 2 is empty, read the contents of the docx attachment returned by the interface and summarize the relevant report information to return, so as to ensure that the final output [truncated_text] content is non-empty.

Error Handling

Error Code Meaning User-facing wording
ERROR_TOPIC_TOO_LONG topic exceeds the 500-character limit "The word count exceeds the limit. Please try another entity."
Other exceptions Interface call failure, etc. "The report generation service is temporarily unavailable. Please try again later."

Security and Privacy Notice (Must Read)

  • File Persistence: The script will write to local files. Please specify the save location via the environment variable INDUSTRY_RESEARCH_REPORT_OUTPUT_DIR to ensure the directory is writable and meets your compliance requirements.
  • Caution with External Links: The server may return sharing links; please open them only in a network environment you trust, and pay attention to the domain and redirects.