Spaces:
Running
Running
Update agent_llamaindex.py
Browse files- agent_llamaindex.py +5 -4
agent_llamaindex.py
CHANGED
@@ -12,10 +12,10 @@ def date_tool(text: str) -> str:
|
|
12 |
Any date mathematics should occur outside this function."""
|
13 |
return str(date.today())
|
14 |
|
15 |
-
def agent_llamaindex(
|
16 |
llm = OpenAI(
|
17 |
-
model =
|
18 |
-
temperature = temperature)
|
19 |
|
20 |
tool_spec = OpenWeatherMapToolSpec(key = os.environ["OPENWEATHERMAP_API_KEY"])
|
21 |
tools = tool_spec.to_tool_list()
|
@@ -26,6 +26,7 @@ def agent_llamaindex(model, temperature, prompt):
|
|
26 |
[tools[0], # built-in tools
|
27 |
dt_tool], # custom tools
|
28 |
llm = llm,
|
29 |
-
verbose = True
|
|
|
30 |
|
31 |
return agent.chat(prompt)
|
|
|
12 |
Any date mathematics should occur outside this function."""
|
13 |
return str(date.today())
|
14 |
|
15 |
+
def agent_llamaindex(config, prompt):
|
16 |
llm = OpenAI(
|
17 |
+
model = config["model_name"],
|
18 |
+
temperature = config["temperature"])
|
19 |
|
20 |
tool_spec = OpenWeatherMapToolSpec(key = os.environ["OPENWEATHERMAP_API_KEY"])
|
21 |
tools = tool_spec.to_tool_list()
|
|
|
26 |
[tools[0], # built-in tools
|
27 |
dt_tool], # custom tools
|
28 |
llm = llm,
|
29 |
+
verbose = True
|
30 |
+
)
|
31 |
|
32 |
return agent.chat(prompt)
|