bstraehle commited on
Commit
70f5db8
·
1 Parent(s): 0bd1de5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import gradio as gr
2
 
3
  from datetime import date
4
- from langchain.agents import AgentType, initialize_agent, tool
5
  from langchain.chat_models import ChatOpenAI
6
 
7
  config = {
@@ -33,12 +33,11 @@ def invoke(openai_api_key, prompt):
33
  openai_api_key = openai_api_key,
34
  temperature = config["temperature"])
35
 
36
- agent = initialize_agent(
37
- [time],
38
- llm,
39
- agent = AgentType.CHAT_ZERO_SHOT_REACT_DESCRIPTION,
40
- handle_parsing_errors = True,
41
- verbose = True)
42
 
43
  result = agent(prompt)
44
 
@@ -60,6 +59,6 @@ demo = gr.Interface(fn = invoke,
60
  gr.Textbox(label = "Prompt", lines = 1)],
61
  outputs = [gr.Textbox(label = "Completion", lines = 1)],
62
  title = "Generative AI - LLM & Agent",
63
- description = description,)
64
 
65
  demo.launch()
 
1
  import gradio as gr
2
 
3
  from datetime import date
4
+ from langchain.agents import AgentType, initialize_agent
5
  from langchain.chat_models import ChatOpenAI
6
 
7
  config = {
 
33
  openai_api_key = openai_api_key,
34
  temperature = config["temperature"])
35
 
36
+ agent = initialize_agent([time],
37
+ llm,
38
+ agent = AgentType.CHAT_ZERO_SHOT_REACT_DESCRIPTION,
39
+ handle_parsing_errors = True,
40
+ verbose = True)
 
41
 
42
  result = agent(prompt)
43
 
 
59
  gr.Textbox(label = "Prompt", lines = 1)],
60
  outputs = [gr.Textbox(label = "Completion", lines = 1)],
61
  title = "Generative AI - LLM & Agent",
62
+ description = description)
63
 
64
  demo.launch()