Update agent.py
Browse files
agent.py
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
import os
|
4 |
import asyncio
|
5 |
from llama_index.llms.openai import OpenAI
|
6 |
-
from llama_index.core.agent
|
7 |
from llama_index.core.tools import FunctionTool
|
8 |
|
9 |
from langchain_community.utilities.wikipedia import WikipediaAPIWrapper
|
@@ -87,11 +87,9 @@ TOOLS = [
|
|
87 |
# Create agent with FunctionAgent (compatible with run)
|
88 |
llm = OpenAI(model="gpt-4")
|
89 |
|
90 |
-
agent =
|
91 |
-
max_iterations=5,
|
92 |
tools=TOOLS,
|
93 |
llm=llm,
|
94 |
-
verbose=True,
|
95 |
system_prompt="""
|
96 |
You are a highly capable AI agent taking the GAIA benchmark test.
|
97 |
|
|
|
3 |
import os
|
4 |
import asyncio
|
5 |
from llama_index.llms.openai import OpenAI
|
6 |
+
from llama_index.core.agent import FunctionCallingAgent
|
7 |
from llama_index.core.tools import FunctionTool
|
8 |
|
9 |
from langchain_community.utilities.wikipedia import WikipediaAPIWrapper
|
|
|
87 |
# Create agent with FunctionAgent (compatible with run)
|
88 |
llm = OpenAI(model="gpt-4")
|
89 |
|
90 |
+
agent = FunctionCallingAgent.from_tools(
|
|
|
91 |
tools=TOOLS,
|
92 |
llm=llm,
|
|
|
93 |
system_prompt="""
|
94 |
You are a highly capable AI agent taking the GAIA benchmark test.
|
95 |
|