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