|
|
|
from langchain.agents import create_react_agent, AgentExecutor |
|
from src.config import groq_llm |
|
from src.tools.python_tool import python_tool |
|
from langchain.hub import pull |
|
from src.tools.serper_search import serper_search_tool |
|
from src.tools.file_loader import file_loader_tool |
|
|
|
|
|
llm = groq_llm(model="llama3-70b-8192") |
|
tools = [python_tool, serper_search_tool, file_loader_tool] |
|
prompt = pull("hwchase17/react") |
|
|
|
agent = create_react_agent(llm=llm, tools=tools, prompt=prompt) |
|
|
|
agent_executor = AgentExecutor( |
|
agent=agent, |
|
tools=tools, |
|
verbose=True, |
|
handle_parsing_errors=True, |
|
) |
|
|
|
if __name__ == "__main__": |
|
print(agent_executor.invoke({ |
|
"input": "Load this tiny sample CSV and show me the first rows: " |
|
"https://people.sc.fsu.edu/~jburkardt/data/csv/hw_200.csv" |
|
})) |
|
|