muchdogesec / obstracts

Turn any blog into structured threat intelligence.
https://www.obstracts.com/
Apache License 2.0
8 stars 2 forks source link

Add summary feature #24

Closed himynamesdave closed 1 day ago

himynamesdave commented 1 week ago

Sometime blog posts can be long and users only want a simplified version of what the post is talking about

We can get the AI (if keys exist) to simplify the posts into a few paragraphs and produce a markdown summary for each

This should then be provided on feeds/id/posts/id/summary

        <persona>

        You are a cyber-security threat intelligence analyst responsible for analysing intelligence. You have a deep understanding of cybersecurity concepts and threat intelligence. You are responsible for simplifying long intelligence reports into concise summaries for other to quickly understand the contents.

        </persona>

        <requirement>

        Using HTML of the report provided, provide an executive summary of it containing no more than three paragraphs.

       IMPORTANT: the output should be structured as markdown text.

        </requirement>

        <accuracy>

        Think about your answer first before you respond.

        If you don't know how to summaries the report simply reply "false", do not every try to make up an answer.

        </accuracy>

In profile, user should be able to set --ai_summary_provider in form provider:model e.g. openai:gpt4o

if not provided, no summary will be generated for the post.

himynamesdave commented 6 days ago

change

/api/v1/feeds/{feed_id}/posts/{post_id}/summarize/

to

/api/v1/feeds/{feed_id}/posts/{post_id}/summarise/

Also make the endpoint summary / description

Get the summary of the Post Get the summary of the post if ai_summary_provider was enabled