File size: 923 Bytes
f122d9d
a4583a7
 
9bcfd60
 
 
 
f122d9d
3c19ce7
f122d9d
 
 
 
bbaff74
 
f122d9d
 
 
 
 
d0dbb44
3c19ce7
bbaff74
2462f34
f122d9d
 
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
import gradio as gr
import os

from langgraph import run_multi_agent

os.environ["LANGCHAIN_TRACING_V2"] = "true"
os.environ["LANGCHAIN_PROJECT"] = "langgraph-multi-agent"

def invoke(openai_api_key, prompt):
    if (openai_api_key == ""):
        raise gr.Error("OpenAI API Key is required.")
        
    os.environ["OPENAI_API_KEY"] = openai_api_key
   
    return "TODO"

gr.close_all()

demo = gr.Interface(fn = invoke, 
                    inputs = [gr.Textbox(label = "OpenAI API Key", type = "password", lines = 1),
                              gr.Textbox(label = "Input", value="Fetch the USA's GDP over the past 5 years, then draw a line graph of it. Once you code it up, finish.", lines = 1)],
                    outputs = [gr.Markdown(label = "Output", value="TODO")],
                    title = "Multi-Agent RAG: Chart Generation",
                    description = os.environ["DESCRIPTION"])

demo.launch()