This commit is contained in:
ManishMadan2882
2025-02-11 23:58:14 +05:30
15 changed files with 670 additions and 42 deletions

View File

@@ -134,7 +134,7 @@ export default function ToolConfig({
{Object.keys(tool?.config).length !== 0 &&
tool.name !== 'api_tool' && (
<div className="relative w-96">
<span className="absolute left-5 -top-2 bg-white px-2 text-xs text-gray-4000 dark:bg-[#26272E] dark:text-silver">
<span className="z-10 absolute left-5 -top-2 bg-white px-2 text-xs text-gray-4000 dark:bg-[#26272E] dark:text-silver">
API Key / Oauth
</span>
<Input
@@ -447,7 +447,7 @@ function APIToolConfig({
</div>
<div className="mt-8 px-5">
<div className="relative w-full">
<span className="absolute left-5 -top-2 bg-white px-2 text-xs text-gray-4000 dark:bg-raisin-black dark:text-silver">
<span className="z-10 absolute left-5 -top-2 bg-white px-2 text-xs text-gray-4000 dark:bg-raisin-black dark:text-silver">
URL
</span>
<Input
@@ -516,7 +516,7 @@ function APIToolConfig({
</div>
<div className="mt-4 px-5 py-2">
<div className="relative w-full">
<span className="absolute left-5 -top-2 bg-white px-2 text-xs text-gray-4000 dark:bg-raisin-black dark:text-silver">
<span className="z-10 absolute left-5 -top-2 bg-white px-2 text-xs text-gray-4000 dark:bg-raisin-black dark:text-silver">
Description
</span>
<Input

View File

@@ -58,9 +58,27 @@ export default function Tools() {
getUserTools();
};
const handleToolAdded = (toolId: string) => {
userService
.getUserTools()
.then((res) => res.json())
.then((data) => {
const newTool = data.tools.find(
(tool: UserToolType) => tool.id === toolId,
);
if (newTool) {
setSelectedTool(newTool);
} else {
console.error('Newly added tool not found');
}
})
.catch((error) => console.error('Error fetching tools:', error));
};
React.useEffect(() => {
getUserTools();
}, []);
return (
<div>
{selectedTool ? (
@@ -85,6 +103,7 @@ export default function Tools() {
id="tool-search-input"
value={searchTerm}
onChange={(e) => setSearchTerm(e.target.value)}
borderVariant="thin"
/>
</div>
<button
@@ -184,6 +203,7 @@ export default function Tools() {
modalState={addToolModalState}
setModalState={setAddToolModalState}
getUserTools={getUserTools}
onToolAdded={handleToolAdded}
/>
</div>
)}

View File

@@ -1,3 +1,9 @@
export type ChunkType = {
doc_id: string;
text: string;
metadata: { [key: string]: string };
};
export type APIKeyData = {
id: string;
name: string;