Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion galacticview_bot/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

tools = [tavily_search_tool]

llm_with_tools = llm.bind_tools(tools)
llm_with_tools = llm.bind_tools(tools, tool_choice="auto")

class AgentState(TypedDict):
messages: Annotated[List[BaseMessage], add_messages]
Expand Down
6 changes: 3 additions & 3 deletions galacticview_bot/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
load_dotenv()

class TavilyInput(BaseModel):
query: str = Field(description="The search query")
query: str = Field(description="The search query to find information on the internet.")

if os.getenv("TAVILY_API_KEY"):
logger.info("TAVILY_API_KEY found. Initializing Tavily search tool.")
tavily_search_tool = TavilySearch(
max_results=3,
topic="general",
include_answer=True,
include_raw_content=False,
args_schema=TavilyInput,
description="Search the internet for space-related information and return relevant results.",
name="tavily_search",
description="Search the internet for real-time information. Input should be a simple search query string."
)
else:
logger.warning("TAVILY_API_KEY not set. Tavily search tool will be disabled.")