Skip to content

Commit

Permalink
✨ Default to search tool
Browse files Browse the repository at this point in the history
  • Loading branch information
asim-shrestha committed Nov 1, 2023
1 parent 3704cbd commit 41ff8d6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions next/src/components/index/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { ChatMessage } from "../console/ChatMessage";
import ChatWindow from "../console/ChatWindow";
import { ChatWindowTitle } from "../console/ChatWindowTitle";
import Summarize from "../console/SummarizeButton";
import Expand from "../motions/expand";
import FadeIn from "../motions/FadeIn";

type ChatProps = {
Expand All @@ -33,7 +32,7 @@ const Chat = (props: ChatProps) => {

return (
<>
<Expand className="flex w-full flex-grow flex-col items-center overflow-hidden">
<div className="flex w-full flex-grow flex-col items-center overflow-hidden">
<ChatWindow
messages={props.messages}
title={<ChatWindowTitle model={settings.customModelName} />}
Expand Down Expand Up @@ -63,7 +62,7 @@ const Chat = (props: ChatProps) => {
})}
<Summarize />
</ChatWindow>
</Expand>
</div>
<AgentControls
disablePlay={props.disableStartAgent}
lifecycle={agentLifecycle}
Expand Down
4 changes: 2 additions & 2 deletions next/src/hooks/useTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ const loadTools = async (key: string) => {
const obj = z.array(ActiveToolSchema).parse(JSON.parse(data ?? ""));
activeTools = allTools.tools.map((db_tool) => {
const tool = obj.find((t) => t.name === db_tool.name);
return tool ?? { ...db_tool, active: true };
return tool ?? { ...db_tool, active: false };
});
} catch (error) {
activeTools = allTools.tools.map((toolModel) => ({ ...toolModel, active: true }));
activeTools = allTools.tools.map((toolModel) => ({ ...toolModel, active: false }));
}

return activeTools;
Expand Down
2 changes: 1 addition & 1 deletion platform/reworkd_platform/web/api/agent/tools/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async def call(
CitedSnippet(
0,
"\n".join(answer_values),
quote(f"https://www.google.com/search?q={input_str}"),
f"https://www.google.com/search?q={quote(input_str)}",
)
)

Expand Down
4 changes: 1 addition & 3 deletions platform/reworkd_platform/web/api/agent/tools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from reworkd_platform.web.api.agent.tools.code import Code
from reworkd_platform.web.api.agent.tools.conclude import Conclude
from reworkd_platform.web.api.agent.tools.image import Image
from reworkd_platform.web.api.agent.tools.reason import Reason
from reworkd_platform.web.api.agent.tools.search import Search
from reworkd_platform.web.api.agent.tools.sidsearch import SID
from reworkd_platform.web.api.agent.tools.tool import Tool
Expand All @@ -30,15 +29,14 @@ def get_external_tools() -> List[Type[Tool]]:
return [
# Wikipedia, # TODO: Remove if async doesn't work
Image,
Search,
Code,
SID,
]


def get_default_tools() -> List[Type[Tool]]:
return [
Reason,
Search,
Conclude,
]

Expand Down

0 comments on commit 41ff8d6

Please sign in to comment.