Spaces:
Running
Running
Update agent.py
Browse files
agent.py
CHANGED
@@ -46,8 +46,8 @@ import torch.nn.functional as F
|
|
46 |
from langchain.agents import initialize_agent, AgentType
|
47 |
from langchain_community.chat_models import ChatOpenAI
|
48 |
from langchain_community.tools import Tool
|
49 |
-
|
50 |
import time
|
|
|
51 |
|
52 |
load_dotenv()
|
53 |
|
@@ -449,7 +449,8 @@ wikiq_tool = wikidata_query
|
|
449 |
tools = [wiki_tool, calc_tool, file_tool, web_tool, arvix_tool, youtube_tool, video_tool, analyze_tool, wikiq_tool]
|
450 |
|
451 |
# Define the LLM before using it
|
452 |
-
llm = ChatOpenAI(temperature=0, model="gpt-
|
|
|
453 |
|
454 |
# Create an agent using the planner, task classifier, and decision logic
|
455 |
agent = initialize_agent(
|
@@ -461,6 +462,7 @@ agent = initialize_agent(
|
|
461 |
|
462 |
|
463 |
|
|
|
464 |
# -------------------------------
|
465 |
# Step 8: Use the Planner, Classifier, and Decision Logic
|
466 |
# -------------------------------
|
|
|
46 |
from langchain.agents import initialize_agent, AgentType
|
47 |
from langchain_community.chat_models import ChatOpenAI
|
48 |
from langchain_community.tools import Tool
|
|
|
49 |
import time
|
50 |
+
from langchain_mistralai.chat_models import ChatMistralAI
|
51 |
|
52 |
load_dotenv()
|
53 |
|
|
|
449 |
tools = [wiki_tool, calc_tool, file_tool, web_tool, arvix_tool, youtube_tool, video_tool, analyze_tool, wikiq_tool]
|
450 |
|
451 |
# Define the LLM before using it
|
452 |
+
#llm = ChatOpenAI(temperature=0, model="gpt-3.5-turbo") # or "gpt-3.5-turbo" "gpt-4"
|
453 |
+
llm = ChatMistralAI(model="mistral-7b-instruct-v0.1")
|
454 |
|
455 |
# Create an agent using the planner, task classifier, and decision logic
|
456 |
agent = initialize_agent(
|
|
|
462 |
|
463 |
|
464 |
|
465 |
+
|
466 |
# -------------------------------
|
467 |
# Step 8: Use the Planner, Classifier, and Decision Logic
|
468 |
# -------------------------------
|