themissingCRAM commited on
Commit
4e51d19
·
1 Parent(s): 2b23d72
Files changed (1) hide show
  1. app.py +16 -2
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
  import os
4
- from smolagents import tool, CodeAgent, HfApiModel, GradioUI
5
  from sqlalchemy import (
6
  create_engine,
7
  MetaData,
@@ -127,4 +127,18 @@ if __name__ == "__main__":
127
  verbosity_level=1,
128
  )
129
  # agent.run("What is the average each customer paid?")
130
- GradioUI(agent).launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
  import os
4
+ from smolagents import tool, CodeAgent, HfApiModel, GradioUI, MultiStepAgent
5
  from sqlalchemy import (
6
  create_engine,
7
  MetaData,
 
127
  verbosity_level=1,
128
  )
129
  # agent.run("What is the average each customer paid?")
130
+ # GradioUI(agent).launch()
131
+
132
+ def enter_message(agent: MultiStepAgent, text: str):
133
+ print(text)
134
+ x = agent.run(text)
135
+ print(type(x))
136
+ print(x.action_output)
137
+
138
+ with gr.Blocks() as b:
139
+ gr.Chatbot(type="history")
140
+
141
+ input = gr.Textbox()
142
+ button = gr.Button("reply")
143
+ button.click(enter_message)
144
+ b.launch()