File size: 2,233 Bytes
66a53df
 
 
ec3c4ea
66a53df
 
 
 
 
ec3c4ea
66a53df
ec3c4ea
 
66a53df
 
 
 
 
71aa48c
 
551667a
71aa48c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
998dff6
71aa48c
 
 
 
 
 
 
 
 
 
551667a
71aa48c
 
1e78c7b
 
 
 
 
 
71aa48c
 
 
 
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import gradio as gr
from investigators.src.investigators.crew import Investigators

def investigate(target_name, affiliations, progress=gr.Progress()):
    inputs = {
        'target': target_name,
        'affiliations': affiliations,
    # 'current_year': str(datetime.now().year)
    }
    progress(0.1, desc=f"Created AI Crew and launched investigation of {target_name}..")
    try:
        investigators = Investigators(progress)
        crew_output = investigators.crew().kickoff(inputs=inputs)
    except Exception as e:
        raise Exception(f"An error occurred while running the crew: {e}")
    
    return crew_output.raw


def clear_inputs():
    return "", "", ""
    
with gr.Blocks() as view:
    gr.Markdown("# OSINT Investigator")
    gr.Markdown("#### Enter the name of your target and their affiliations (to make search easier), and get a AML Risk assessment based on their public information.")
    with gr.Row(equal_height=True):
        with gr.Column(scale=3):
            name_input = gr.Textbox(label="Target name:")
            affiliation_input = gr.Textbox(label="Target Affiliations (comma separated):")
            with gr.Row():
                clear_btn = gr.Button("Clear")
                submit_btn = gr.Button("Investigate")
        with gr.Column(scale=1):
            img1 = gr.Image("images/logo1.png", show_download_button=False, show_fullscreen_button=False, show_label=False, show_share_button=False)
        
    
    with gr.Row():
        output = gr.Markdown(container=True, show_copy_button=False, min_height=100)
    
    submit_btn.click(
        fn=investigate, 
        inputs=[name_input, affiliation_input],
        outputs=output
    )
    
    clear_btn.click(
        fn=clear_inputs,
        inputs=[],
        outputs=[name_input, affiliation_input, output]
    )
    gr.Examples(
        examples=[["Raz Nissim", "Ben Gurion University, General Motors"],
                  ["Mohammed Mosharref Hossain", "Albany"], 
                  ["Giovanni Cazzetta", "Montreal"],
                  ["Willy Bokonga", "Congo"],
                  ["Avraham Hirshzon", "Israel, Politician"],
            ],
        inputs=[name_input, affiliation_input]
    )

view.launch(inbrowser=True)