Spaces:
Sleeping
Sleeping
version complète v04
Browse files
agent.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
from llama_index.llms.openai import OpenAI
|
| 2 |
-
from llama_index.agent
|
| 3 |
from tools import TOOLS
|
| 4 |
-
|
| 5 |
import os
|
|
|
|
| 6 |
from dotenv import load_dotenv
|
| 7 |
|
| 8 |
load_dotenv()
|
|
@@ -24,7 +24,7 @@ llm = OpenAI(
|
|
| 24 |
max_tokens=500
|
| 25 |
)
|
| 26 |
|
| 27 |
-
agent =
|
| 28 |
tools=TOOLS,
|
| 29 |
llm=llm,
|
| 30 |
verbose=True
|
|
|
|
| 1 |
from llama_index.llms.openai import OpenAI
|
| 2 |
+
from llama_index.core.agent import ReActAgent
|
| 3 |
from tools import TOOLS
|
|
|
|
| 4 |
import os
|
| 5 |
+
#from llama_index.agent.openai import OpenAIAgent
|
| 6 |
from dotenv import load_dotenv
|
| 7 |
|
| 8 |
load_dotenv()
|
|
|
|
| 24 |
max_tokens=500
|
| 25 |
)
|
| 26 |
|
| 27 |
+
agent = ReActAgent.from_tools(
|
| 28 |
tools=TOOLS,
|
| 29 |
llm=llm,
|
| 30 |
verbose=True
|
tools.py
CHANGED
|
@@ -157,15 +157,5 @@ qa_tool = FunctionTool.from_defaults(
|
|
| 157 |
)
|
| 158 |
|
| 159 |
# Liste exportable
|
| 160 |
-
TOOLS = [summarize_tool, entities_tool, date_tool, events_tool, qa_tool]
|
| 161 |
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
TOOLS = [search_tool, hello_tool, summarize_tool, entities_tool, date_tool]
|
|
|
|
| 157 |
)
|
| 158 |
|
| 159 |
# Liste exportable
|
|
|
|
| 160 |
|
| 161 |
+
TOOLS = [search_tool, hello_tool, summarize_tool, entities_tool, date_tool, events_tool, qa_tool]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|