Socket
Socket
Sign inDemoInstall

mkdocs-ai-summary

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mkdocs-ai-summary

A mkdocs plugin to generage summary with the help of AI.


Maintainers
1

mkdocs-ai-summary

PyPI - Version PyPI - Implementation PyPI - Python Version

Generage an ai-summary for the page:

Minimal demo: aiboy996.github.io/mkdocs-ai-summary

Live demo(my homepage): yangzhang.site

Installation

You should install the package with pip:

pip install mkdocs-ai-summary[chatgpt]

or

pip install mkdocs-ai-summary[tongyi]

⚠️⚠️⚠️⚠️

Only support ChatGPT and tongyi ai for now.

To use ChatGPT(default), you should set a Environmental Variable for api key:

export OPENAI_API_KEY='sk-xxxxxxx'

how to get an OPENAI_API_KEY?

To use tongyi ai, you should set a Environmental Variable for api key:

export DASHSCOPE_API_KEY='sk-xxxxxxx'

how to get an DASHSCOPE_API_KEY?

[optional] Then you can include the ai-summary.css(optional, this is for the custom ai summary admonition style) in the config file as below:

Configuration

Options can be set

nametypedefault valuenote
apistrchatgptonly support chatgpt or tongyi
modelstrgpt-3.5-turbo-
ignore_codebooltrueignore code block in markdown
cachebooltrue-
cache_dirstr"./"-
promptstr"Please help me summarize the following content into an abstract within 200 words: "-

For ChatGPT Summary

Setup mkdocs.yml like this:

site_name: mkdocs-ai-summary
theme:
  name: material

plugins:
  - ai-summary:
      api: "chatgpt"
      model: "gpt-3.5-turbo"
      ignore_code: true 
      cache: true
      cache_dir: "./"
      prompt: "Please help me summarize the following content into an abstract within 200 words: "
  - tags

markdown_extensions:
  - admonition
  - pymdownx.details
  - pymdownx.superfences
  - pymdownx.tabbed:
      alternate_style: true 
extra_css:
  - ai-summary.css

Then for the page you want an ai-summary, just add a meta tag:

---
include:
- ai-summary
---

# title

hello ai summary.

For tongyi ai Summary

or you can use tongyi ai by setting:

plugins:
  - ai-summary:
      api: "tongyi"
      model: "qwen-turbo"
      ignore_code: true
      cache: true
      cache_dir: "./"
      prompt: "Please help me summarize the following content into an abstract within 200 words: "

Setup ai-summary for specific page

You can also setup ai summary for each page separately:

---
include:
- ai-summary
ai-summary-config:
    api: "tongyi"
    model: "qwen-turbo"
    prompt: "帮我把下面的内容总结为200字以内的摘要:"
---

# title

hello ai summary.

all config options are available. Page configuration will override unified configuration.

About Cache

Don't worry about duplicate api calls, we've made the cache function so that if you've done an ai-summary before and the content hasn't changed it will use the cache.

Enjoy it.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc