File size: 1,548 Bytes
50d0a1a
6e19847
50d0a1a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6e19847
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import modal
from search_recommend import recommend, get_podcast_title

def get_rss_output(rss):
    f = modal.Function.lookup("corise-podcast-project", "main")
    output = f.call(rss, '/podcast/')
    podcast_info = output
    podcast_name = podcast_info['podcast_details']['podcast_title']
    # Process the file data as needed
    episode_title = podcast_info['podcast_details']['episode_title']
    episode_image = podcast_info['podcast_details']['episode_image']
    podcast_summary = podcast_info['podcast_summary']
    podcast_guest = str(podcast_info['podcast_guest']['podcast_guest'])
    podcast_guest_org = str(podcast_info['podcast_guest'].get('podcast_guest_org'))
    podcast_guest_title = str(podcast_info['podcast_guest'].get('podcast_guest_title'))
    podcast_guest_wikipedia = str(podcast_info['podcast_guest'].get('wikipedia_summary'))
    podcast_highlights = str(podcast_info['podcast_highlights'])
    podcast_key_moments = str(podcast_info['key_moments_and_key_topics'])
    podcast_gpt_transcript = str(podcast_info['gpt_podcast_transcript'])

    return podcast_name, episode_title, episode_image, podcast_summary, podcast_guest, podcast_guest_org, \
           podcast_guest_title, podcast_guest_wikipedia, podcast_highlights, podcast_key_moments, \
           podcast_gpt_transcript


def get_recommendations(podcast_id, normal_chatbot):
    recommend_string = recommend(podcast_id)
    podcast_title = get_podcast_title(podcast_id)
    normal_chatbot.append((podcast_title,recommend_string))
    return normal_chatbot