Skip to content

Commit

Permalink
Change description for CurrentTimeTool and change method of calling c…
Browse files Browse the repository at this point in the history
…ustom tools
  • Loading branch information
DEENUU1 committed Jan 24, 2024
1 parent f022213 commit ce51aa7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
17 changes: 3 additions & 14 deletions app/ai/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from .llm import get_chat_openai
from .memory import setup_memory
from .prompt import prompt
from .tools import news, today # , google_calendar
from .tools import news, today
from .vector import get_pinecone

langchain.debug = True
Expand Down Expand Up @@ -63,26 +63,15 @@ def setup_agent(session_id: str, model: str) -> AgentExecutor:

weather = OpenWeatherMapAPIWrapper(openweathermap_api_key=settings.OPENWEATHERAPP_API_KEY)
wikipedia = WikipediaQueryRun(api_wrapper=WikipediaAPIWrapper())
news_tool = news.NewsTool()
# google_calendar_list_event = google_calendar.GoogleCalendarListEventTool()
current_time = today.CurrentTimeTool()

tools = [
# Tool(
# name="GoogleCalendarListEvent",
# func=google_calendar_list_event.run,
# description="Useful for when you need to answer questions about events from Google calendar"
# ),
Tool(
name="CurrentTime",
func=current_time.run,
description="Useful for when you need to answer questions about current time"
),
Tool(
name="News",
func=news_tool.run,
description="Useful for when you need to answer questions about current news"
),
today.CurrentTimeTool(),
news.NewsTool(),
Tool(
name="Wikipedia",
func=wikipedia.run,
Expand Down
2 changes: 1 addition & 1 deletion app/ai/tools/today.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def get_current_time():

class CurrentTimeTool(BaseTool):
name = "current_time_tool"
description = "Useful for when you need to answer questions about current time"
description = "Useful for when you need to answer questions about current date and time"

def _to_args_and_kwargs(self, tool_input: Union[str, Dict]) -> Tuple[Tuple, Dict]:
return (), {}
Expand Down
2 changes: 1 addition & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from config.settings import settings
from routers import health, chat, media
from integration.google_auth import get_credentials
# from integration.google_auth import get_credentials
# from config.database import engine, Base
# Base.metadata.create_all(bind=engine)

Expand Down

0 comments on commit ce51aa7

Please sign in to comment.