File size: 1,985 Bytes
ee74471
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr
from rag import rbc_product
from tool import rival_product

with gr.Blocks() as demo:
  with gr.Tab("RAG"):
    gr.Markdown("""
Marketing
------------
GraphRAG: Models customer-product relationship networks for next-best-action predictions

DSPy: Optimizes cross-sell/upsell prompt variations through A/B testing

Risk & Audit
------------
GraphRAG: Maps transactional relationships into dynamic knowledge graphs to detect multi-layered fraud patterns

Tool Use: Integrates fraud detection APIs, anomaly scoring models, and regulatory compliance checkers

DSPy: Optimizes fraud explanation prompts for regulatory reporting
    """)
    gr.Markdown("""
    Retrieval: Public RBC Product Data
    
    Recommend: RBC Product 
    """)
    in_verbatim = gr.Textbox(label="Verbatim")
    out_product = gr.Textbox(label="Product")


    gr.Examples(
      [
        ["Low APR and great customer service. I would highly recommend if you’re looking for a great credit card company and looking to rebuild your credit. I have had my credit limit increased annually and the annual fee is very low."]
      ],
      [in_verbatim]
    )
    btn_recommend=gr.Button("Recommend")
    btn_recommend.click(fn=rbc_product, inputs=in_verbatim, outputs=out_product)

  with gr.Tab("Tool Use"):
    gr.Markdown("""
    Retrieval: Public Product Data using Tavily Search
    
    Recommend: Competition Product 
    """)
    in_verbatim = gr.Textbox(label="Verbatim")
    out_product = gr.Textbox(label="Product")

    gr.Examples(
      [
        ["Low APR and great customer service. I would highly recommend if you’re looking for a great credit card company and looking to rebuild your credit. I have had my credit limit increased annually and the annual fee is very low."]
      ],
      [in_verbatim]
    )
    btn_recommend=gr.Button("Recommend")
    btn_recommend.click(fn=rival_product, inputs=in_verbatim, outputs=out_product)



demo.launch(allowed_paths=["./xgb","./ts"])