File size: 2,497 Bytes
66a53df
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
62
63
64
65
66
67
68
69
70
71
72
73
import gradio as gr
from investigators.src.investigators.crew import Investigators

def investigate(target_name, affiliations):
    inputs = {
        'target': target_name,
        'affiliations': affiliations,
    # 'current_year': str(datetime.now().year)
    }

    try:
        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

# view = gr.Interface(
#     fn=investigate,
#     inputs=[
#         gr.Textbox(label="Target name:"),
#         gr.Textbox(label="Target Affiliations (comma separated):")],
#     outputs=[gr.Markdown(label="Risk Assessment Report:")],
#     flagging_mode="never",
#     examples=[
#         ["Raz Nissim", "Ben Gurion University, General Motors"],
#     ],
#     title="OSINT Investigator",
#     description="Enter the name of your target and their affiliations (to make search easier), and get a AML Risk assessment based on their public information.",
#     layout="vertical")
# 
# view.launch(inbrowser=True)

    # Clear button functionality
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(label="Risk Assessment Report:", container=True, show_copy_button=True)
    
    submit_btn.click(
        fn=investigate, 
        inputs=[name_input, affiliation_input],
        outputs=output
    )
    

    
    clear_btn.click(
        fn=clear_inputs,
        inputs=[],
        outputs=[name_input, affiliation_input]
    )
    gr.Examples(
        examples=[["Raz Nissim", "Ben Gurion University, General Motors"]],
        inputs=[name_input, affiliation_input]
    )

view.launch(inbrowser=True)