File size: 397 Bytes
1bc7525
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import json
from typing import Dict, List

from ai import llm
from utils.io import print_system


PROMPT = """
Here is the text from a website:
{text}

What is this website about?
"""


def summarize_text(text: str) -> str:
    print_system("Summarizing text...")
    instructions = PROMPT.format(text=text)
    messages = [{"role": "user", "content": instructions}]
    return llm.next(messages)