Skip to content
Draft
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: 2 additions & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ services:
image: unstract/runner:${VERSION}
container_name: unstract-runner
restart: unless-stopped
profiles:
- legacy-runner
ports:
- 5002:5002
env_file:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@
grid-auto-flow: column;
justify-self: end;
}

.toolinfo-card-deprecated {
opacity: 0.6;
cursor: not-allowed;
}
17 changes: 15 additions & 2 deletions frontend/src/components/agency/tool-info-card/ToolInfoCard.jsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
import { Card, Col, Row, Typography } from "antd";
import { Card, Col, Row, Tag, Tooltip, Typography } from "antd";
import PropTypes from "prop-types";
import { useDrag } from "react-dnd";

import "./ToolInfoCard.css";
import { ToolIcon } from "../tool-icon/ToolIcon";

function ToolInfoCard({ toolInfo }) {
const isDeprecated = toolInfo?.deprecated;

const [, ref] = useDrag({
type: "STEP",
item: { function_name: toolInfo?.function_name },
canDrag: !isDeprecated,
});

return (
<Card className="toolinfo-card" ref={ref}>
<Card
className={`toolinfo-card${isDeprecated ? " toolinfo-card-deprecated" : ""}`}
ref={ref}
>
<Row>
<Col span={4}>
<ToolIcon iconSrc={toolInfo?.icon} showBorder={true} />
Expand All @@ -21,6 +27,13 @@ function ToolInfoCard({ toolInfo }) {
<div className="tool-info-header">
<div className="tool-info-title">
<Typography.Text strong>{toolInfo?.name}</Typography.Text>
{isDeprecated && (
<Tooltip title={toolInfo?.deprecation_message}>
<Tag color="orange" style={{ marginLeft: 8 }}>
Deprecated
</Tag>
</Tooltip>
)}
</div>
<Typography
type="secondary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ def fetch_tools_descriptions(
ToolKey.DESCRIPTION: data.get(PropKey.DESCRIPTION),
ToolKey.ICON: icon,
ToolKey.FUNCTION_NAME: data.get(PropKey.FUNCTION_NAME),
"deprecated": configuration.get("deprecated", False),
"deprecation_message": configuration.get("deprecation_message", ""),
}
tools_list.append(tool_data)
return tools_list
Expand Down
4 changes: 4 additions & 0 deletions unstract/tool-registry/tool_registry_config/public_tools.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"classify": {
"tool_uid": "classify",
"deprecated": true,
"deprecation_message": "File Classifier is deprecated and will be removed in a future release. Use Prompt Studio with an LLM for classification.",
"properties": {
"schemaVersion": "0.0.1",
"displayName": "File Classifier",
Expand Down Expand Up @@ -112,6 +114,8 @@
},
"text_extractor": {
"tool_uid": "text_extractor",
"deprecated": true,
"deprecation_message": "Text Extractor is deprecated and will be removed in a future release. Use the X2Text adapter instead.",
"properties": {
"schemaVersion": "0.0.1",
"displayName": "Text Extractor",
Expand Down