Compare commits
8 Commits
fix/Timebo
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
feae2f2e1e | ||
|
|
415234d4c8 | ||
|
|
e38a60e107 | ||
|
|
86eb08c73f | ||
|
|
53f1b0e586 | ||
|
|
49cc47a79a | ||
|
|
1817f52edf | ||
|
|
40633d72c3 |
@@ -242,6 +242,8 @@ class Settings:
|
||||
SMTP_USER: str = os.getenv("SMTP_USER", "")
|
||||
SMTP_PASSWORD: str = os.getenv("SMTP_PASSWORD", "")
|
||||
|
||||
SANDBOX_URL: str = os.getenv("SANDBOX_URL", "")
|
||||
|
||||
REFLECTION_INTERVAL_SECONDS: float = float(os.getenv("REFLECTION_INTERVAL_SECONDS", "300"))
|
||||
HEALTH_CHECK_SECONDS: float = float(os.getenv("HEALTH_CHECK_SECONDS", "600"))
|
||||
REFLECTION_INTERVAL_TIME: Optional[str] = int(os.getenv("REFLECTION_INTERVAL_TIME", 30))
|
||||
|
||||
@@ -14,6 +14,7 @@ from app.core.workflow.engine.variable_pool import VariablePool
|
||||
from app.core.workflow.nodes import BaseNode
|
||||
from app.core.workflow.nodes.code.config import CodeNodeConfig
|
||||
from app.core.workflow.variable.base_variable import VariableType, DEFAULT_VALUE
|
||||
from app.core.config import settings
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -131,7 +132,7 @@ class CodeNode(BaseNode):
|
||||
|
||||
async with httpx.AsyncClient(timeout=60) as client:
|
||||
response = await client.post(
|
||||
"http://sandbox:8194/v1/sandbox/run",
|
||||
f"{settings.SANDBOX_URL}:8194/v1/sandbox/run",
|
||||
headers={
|
||||
"x-api-key": 'redbear-sandbox'
|
||||
},
|
||||
|
||||
@@ -3,14 +3,14 @@ import { Popover, type PopoverProps } from 'antd'
|
||||
import Tag, { type TagProps } from '@/components/Tag'
|
||||
|
||||
interface OverflowTagsProps {
|
||||
items: ReactNode[];
|
||||
items?: ReactNode[];
|
||||
gap?: number;
|
||||
numTagColor?: TagProps['color'];
|
||||
numTag?: (num?: number) => ReactNode;
|
||||
popoverProps?: PopoverProps | false;
|
||||
}
|
||||
|
||||
const OverflowTags = ({ items, gap = 8, numTagColor = 'default', numTag, popoverProps }: OverflowTagsProps) => {
|
||||
const OverflowTags = ({ items = [], gap = 8, numTagColor = 'default', numTag, popoverProps }: OverflowTagsProps) => {
|
||||
const containerRef = useRef<HTMLDivElement>(null)
|
||||
const measureRef = useRef<HTMLDivElement>(null)
|
||||
const [visibleCount, setVisibleCount] = useState(items.length)
|
||||
@@ -20,7 +20,7 @@ const OverflowTags = ({ items, gap = 8, numTagColor = 'default', numTag, popover
|
||||
if (!measure || containerWidth === 0) return
|
||||
|
||||
const children = Array.from(measure.children) as HTMLElement[]
|
||||
if (!children.length) return
|
||||
if (!children.length) { setVisibleCount(0); return }
|
||||
|
||||
// last child is the sample +N tag
|
||||
const extraTagWidth = (children[children.length - 1] as HTMLElement).offsetWidth
|
||||
|
||||
@@ -166,10 +166,10 @@ const Ontology: FC = () => {
|
||||
<div className="rb:h-10 rb:wrap-break-word rb:line-clamp-2 rb:leading-5">{item.scene_description}</div>
|
||||
</Tooltip>
|
||||
|
||||
<div className="rb:mt-2">
|
||||
<div className="rb:mt-2 rb:h-5.5">
|
||||
<OverflowTags
|
||||
popoverProps={false}
|
||||
items={[...item.entity_type?.map((type, i) => <Tag key={i} variant="borderless" color="dark">{type}</Tag>), <Tag variant="borderless" color="dark">{`+${item.type_num - 3}`}</Tag>]}
|
||||
items={item.entity_type ? [...item.entity_type.map((type, i) => <Tag key={i} variant="borderless" color="dark">{type}</Tag>), <Tag variant="borderless" color="dark">{`+${item.type_num - 3}`}</Tag>] : []}
|
||||
numTag={(num?: number) => <Tag variant="borderless" color="dark">{`+${item.type_num - 3 + (num ? num - 1 : 0)}`}</Tag>}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -134,7 +134,7 @@ export const useWorkflowGraph = ({
|
||||
const data = node.getData()
|
||||
if (data?.type === 'if-else' || data?.type === 'question-classifier') {
|
||||
console.log('chatVariables', chatVariables)
|
||||
node.setData({ ...data, chatVariables }, { silent: true })
|
||||
node.setData({ ...data, chatVariables })
|
||||
}
|
||||
})
|
||||
}, [chatVariables])
|
||||
@@ -1709,7 +1709,7 @@ export const useWorkflowGraph = ({
|
||||
// Reset all node execution status on every chatHistory change
|
||||
nodes.forEach(node => {
|
||||
const data = node.getData();
|
||||
node.setData({ ...data, executionStatus: '' }, { silent: true });
|
||||
node.setData({ ...data, executionStatus: '' });
|
||||
});
|
||||
|
||||
const lastAssistant = [...chatHistory].reverse().find(item => item.role === 'assistant');
|
||||
@@ -1718,7 +1718,7 @@ export const useWorkflowGraph = ({
|
||||
if (typeof sub.status === 'string') {
|
||||
const node = nodes.find(n => n.getData()?.id === sub.node_id);
|
||||
if (node) {
|
||||
node.setData({ ...node.getData(), executionStatus: sub.status }, { silent: true });
|
||||
node.setData({ ...node.getData(), executionStatus: sub.status });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user