agrd commited on
Commit
f596100
·
verified ·
1 Parent(s): 93d0816

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -23
app.py CHANGED
@@ -1,23 +1,25 @@
1
- import gradio as gr
2
- from agent import TakeoffAgent
3
-
4
- # Initialize the agent
5
- agent = TakeoffAgent()
6
-
7
- def chat_response(message, history):
8
- # The agent handles state, parsing, and calculation logic
9
- response = agent.process_message(message)
10
- return response
11
-
12
- # Clean Chat Interface
13
- with gr.Blocks(theme=gr.themes.Soft()) as demo:
14
- gr.Markdown("#✈️ PA-28-181 AI Performance Engineer")
15
- gr.Markdown("Describe your conditions naturally. Example: *'I am at 2000ft, 25C, QNH 1013, 1090kg with 10kt headwind'*")
16
-
17
- chat_interface = gr.ChatInterface(
18
- fn=chat_response,
19
- type="messages",
20
- )
21
-
22
- if __name__ == "__main__":
23
- demo.launch()
 
 
 
1
+ import gradio as gr
2
+ from agent import TakeoffAgent
3
+
4
+ # Initialize the agent
5
+ agent = TakeoffAgent()
6
+
7
+ def chat_response(message, history):
8
+ # The agent handles state, parsing, and calculation logic
9
+ # We don't use 'history' in the logic, so the format (tuples vs dicts) doesn't matter
10
+ response = agent.process_message(message)
11
+ return response
12
+
13
+ # Clean Chat Interface
14
+ with gr.Blocks() as demo:
15
+ gr.Markdown("# ✈️ PA-28-181 AI Performance Engineer")
16
+ gr.Markdown("Describe your conditions naturally. Example: *'I am at 2000ft, 25C, QNH 1013, 1090kg with 10kt headwind'*")
17
+
18
+ # Removed 'type="messages"' to fix the TypeError
19
+ chat_interface = gr.ChatInterface(
20
+ fn=chat_response,
21
+ )
22
+
23
+ if __name__ == "__main__":
24
+ # Moved theme to launch() to address the Gradio UserWarning
25
+ demo.launch(theme=gr.themes.Soft())