diff --git a/flo_ai/flo_ai/llm/gemini_llm.py b/flo_ai/flo_ai/llm/gemini_llm.py index 578681e1..dd975d12 100644 --- a/flo_ai/flo_ai/llm/gemini_llm.py +++ b/flo_ai/flo_ai/llm/gemini_llm.py @@ -208,9 +208,9 @@ def get_next_chunk(): def get_message_content(self, response: Dict[str, Any]) -> str: if isinstance(response, str): return response - if hasattr(response, 'content') and response.content is not None: - return str(response.content) - return '' + if isinstance(response, dict): + content = response.get('content') + return str(content) if content is not None else '' def format_tool_for_llm(self, tool: 'Tool') -> Dict[str, Any]: """Format a single tool for Gemini's function declarations""" diff --git a/wavefront/client/src/components/ChatBot.tsx b/wavefront/client/src/components/ChatBot.tsx index 12711a74..2bd88266 100644 --- a/wavefront/client/src/components/ChatBot.tsx +++ b/wavefront/client/src/components/ChatBot.tsx @@ -4,6 +4,7 @@ import { Switch } from '@app/components/ui/switch'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@app/components/ui/select'; import { Spinner } from '@app/components/ui/spinner'; import { Textarea } from '@app/components/ui/textarea'; +import { Popover, PopoverContent, PopoverTrigger } from '@app/components/ui/popover'; import { LLMInferenceConfig } from '@app/types/llm-inference-config'; import { ChatMessageContent, ImageContent, DocumentContent } from '@app/types/chat-message'; import clsx from 'clsx'; @@ -106,6 +107,13 @@ const ChatBot = ({ const variablesModalRef = useRef(null); const [showLogic, setShowLogic] = useState(true); const [selectValue, setSelectValue] = useState(''); + const combinedAttachments = [ + ...uploadedImages.map((image, index) => ({ kind: 'image' as const, image, originalIndex: index })), + ...uploadedDocuments.map((document, index) => ({ kind: 'document' as const, document, originalIndex: index })), + ]; + const visibleCombinedAttachments = combinedAttachments.slice(0, 2); + const remainingCombinedAttachmentsCount = Math.max(combinedAttachments.length - visibleCombinedAttachments.length, 0); + const remainingCombinedAttachments = combinedAttachments.slice(2); return (
@@ -222,56 +230,81 @@ const ChatBot = ({ {/* Scrollable Attachments Container */} {(uploadedImages.length > 0 || uploadedDocuments.length > 0) && ( -
- {/* Uploaded Images */} - {uploadedImages.length > 0 && ( -
- {uploadedImages.map((image, index) => ( +
+
+ {visibleCombinedAttachments.map((attachment, index) => + attachment.kind === 'image' ? (
- {image.file.name} + {attachment.image.file.name}
-

{image.file.name}

-

{formatFileSize(image.file.size)}

+

+ {attachment.image.file.name} +

+

{formatFileSize(attachment.image.file.size)}

- ))} -
- )} - - {/* Uploaded Documents */} - {uploadedDocuments.length > 0 && ( -
- {uploadedDocuments.map((doc, index) => ( + ) : (
📄
-

{doc.file.name}

-

{formatFileSize(doc.file.size)}

+

+ {attachment.document.file.name} +

+

{formatFileSize(attachment.document.file.size)}

- ))} -
- )} + ) + )} + {remainingCombinedAttachmentsCount > 0 && ( + + + + + +
+ {remainingCombinedAttachments.map((attachment, index) => ( +

+ {attachment.kind === 'image' ? attachment.image.file.name : attachment.document.file.name} +

+ ))} +
+
+
+ )} +
)}
diff --git a/wavefront/client/src/pages/apps/[appId]/workflows/[id].tsx b/wavefront/client/src/pages/apps/[appId]/workflows/[id].tsx index 1af4600e..30f71385 100644 --- a/wavefront/client/src/pages/apps/[appId]/workflows/[id].tsx +++ b/wavefront/client/src/pages/apps/[appId]/workflows/[id].tsx @@ -726,7 +726,7 @@ const WorkflowDetail: React.FC = () => { Edit Workflow Configuration -
+
=6.0.3,<7", diff --git a/wavefront/server/modules/tools_module/pyproject.toml b/wavefront/server/modules/tools_module/pyproject.toml index 2508da8c..16b572e4 100644 --- a/wavefront/server/modules/tools_module/pyproject.toml +++ b/wavefront/server/modules/tools_module/pyproject.toml @@ -3,7 +3,7 @@ name = "tools_module" version = "0.1.0" description = "Tools module for Flo AI agent system" dependencies = [ - "flo-ai==1.1.3", + "flo-ai==1.1.4", "flo_cloud", "datasource", diff --git a/wavefront/server/uv.lock b/wavefront/server/uv.lock index 8691344e..0c140b9b 100644 --- a/wavefront/server/uv.lock +++ b/wavefront/server/uv.lock @@ -3,10 +3,10 @@ revision = 3 requires-python = ">=3.11" resolution-markers = [ "python_full_version >= '3.14' and sys_platform == 'darwin'", - "python_full_version == '3.13.*' and sys_platform == 'darwin'", "python_full_version >= '3.14' and platform_machine == 'aarch64' and sys_platform == 'linux'", - "python_full_version == '3.13.*' and platform_machine == 'aarch64' and sys_platform == 'linux'", "(python_full_version >= '3.14' and platform_machine != 'aarch64' and sys_platform == 'linux') or (python_full_version >= '3.14' and sys_platform != 'darwin' and sys_platform != 'linux')", + "python_full_version == '3.13.*' and sys_platform == 'darwin'", + "python_full_version == '3.13.*' and platform_machine == 'aarch64' and sys_platform == 'linux'", "(python_full_version == '3.13.*' and platform_machine != 'aarch64' and sys_platform == 'linux') or (python_full_version == '3.13.*' and sys_platform != 'darwin' and sys_platform != 'linux')", "python_full_version == '3.12.*' and sys_platform == 'darwin'", "python_full_version == '3.12.*' and platform_machine == 'aarch64' and sys_platform == 'linux'", @@ -90,7 +90,7 @@ dependencies = [ requires-dist = [ { name = "api-services-module", editable = "modules/api_services_module" }, { name = "common-module", editable = "modules/common_module" }, - { name = "flo-ai", specifier = "==1.1.3" }, + { name = "flo-ai", specifier = "==1.1.4" }, { name = "flo-cloud", editable = "packages/flo_cloud" }, { name = "flo-utils", editable = "packages/flo_utils" }, { name = "tools-module", editable = "modules/tools_module" }, @@ -706,7 +706,7 @@ version = "2.0.17" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "aiohttp" }, - { name = "audioop-lts", marker = "python_full_version >= '3.13' and python_full_version < '4'" }, + { name = "audioop-lts", marker = "python_full_version >= '3.13' and python_full_version < '4.0'" }, { name = "httpx" }, { name = "httpx-sse" }, { name = "iterators" }, @@ -1395,7 +1395,7 @@ wheels = [ [[package]] name = "flo-ai" -version = "1.1.3" +version = "1.1.4" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "aiohttp" }, @@ -1413,13 +1413,12 @@ dependencies = [ { name = "opentelemetry-sdk" }, { name = "pydantic" }, { name = "pyjwt" }, - { name = "pymupdf4llm" }, - { name = "pypdf" }, + { name = "pymupdf" }, { name = "pyyaml" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/39/64/20f5af2233f07b961eae7500951a1a11a568dcb85fba8e0a5cb16b17299d/flo_ai-1.1.3.tar.gz", hash = "sha256:d43b5c49f2a16a02818e0e672f04df8986c431b24c97f914ee69c0b000686cf5", size = 92363, upload-time = "2026-03-13T08:27:57.077Z" } +sdist = { url = "https://files.pythonhosted.org/packages/f3/f0/08132aef558ca6ca032b871bd9b48e5ee134a9afee23f7236a395f5b5ab4/flo_ai-1.1.4.tar.gz", hash = "sha256:53eec306f0995d3b5f1000012224593b27e5e302faa6badd1a217b06207ee6bc", size = 98302, upload-time = "2026-04-22T09:05:28.579Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/0b/e7/48b7b394bd61e6308d819cdc1f79391b954bd27b81460b610543d717332f/flo_ai-1.1.3-py3-none-any.whl", hash = "sha256:887714ec5a853339edef207e7e3d334269ad2c80449055c4fd1c5aa99a3810ba", size = 119627, upload-time = "2026-03-13T08:27:55.82Z" }, + { url = "https://files.pythonhosted.org/packages/9e/74/4ef0d81d1e36218d2b7747ad824ff097a06f15669173ab585a417d362ada/flo_ai-1.1.4-py3-none-any.whl", hash = "sha256:84300f318784c33e93d381ef76d58a3cd92befb0a3de25c28c2f3346a7ae6af9", size = 126036, upload-time = "2026-04-22T09:05:26.222Z" }, ] [[package]] @@ -2595,7 +2594,7 @@ dev = [ requires-dist = [ { name = "boto3", specifier = "<=1.38.40" }, { name = "datasource", editable = "plugins/datasource" }, - { name = "flo-ai", specifier = "==1.1.3" }, + { name = "flo-ai", specifier = "==1.1.4" }, { name = "flo-cloud", editable = "packages/flo_cloud" }, { name = "google-cloud-pubsub", specifier = "~=2.30.0" }, { name = "numpy", specifier = ">=1.24,<2.0" }, @@ -4574,18 +4573,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d1/c4/87d27b108c2f6d773aa5183c5ae367b2a99296ea4bc16eb79f453c679e30/pymupdf-1.26.4-cp39-abi3-win_amd64.whl", hash = "sha256:0b6345a93a9afd28de2567e433055e873205c52e6b920b129ca50e836a3aeec6", size = 18743491, upload-time = "2025-08-25T14:19:01.104Z" }, ] -[[package]] -name = "pymupdf4llm" -version = "0.0.17" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "pymupdf" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/2e/3c/1a530a410bdf76d83289bf30b3b86236d338b3f5f21842790c2cf7e9c1f6/pymupdf4llm-0.0.17.tar.gz", hash = "sha256:27287ef9fe0217cf37841a3ef2bcf70da2553c43d95ea39b664a6de6485678c3", size = 25180, upload-time = "2024-09-21T18:40:01.033Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/ae/af/1576ecfc8a62d31c0c8b34b856e52f6b05f1d76546dbac0e1d037f044a9e/pymupdf4llm-0.0.17-py3-none-any.whl", hash = "sha256:26de9996945f15e3ca507908f80dc18a959f5b5214bb2e302c7f7034089665a0", size = 26190, upload-time = "2024-09-21T18:40:03.097Z" }, -] - [[package]] name = "pyparsing" version = "3.2.5" @@ -4595,15 +4582,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/10/5e/1aa9a93198c6b64513c9d7752de7422c06402de6600a8767da1524f9570b/pyparsing-3.2.5-py3-none-any.whl", hash = "sha256:e38a4f02064cf41fe6593d328d0512495ad1f3d8a91c4f73fc401b3079a59a5e", size = 113890, upload-time = "2025-09-21T04:11:04.117Z" }, ] -[[package]] -name = "pypdf" -version = "4.3.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f0/65/2ed7c9e1d31d860f096061b3dd2d665f501e09faaa0409a3f0d719d2a16d/pypdf-4.3.1.tar.gz", hash = "sha256:b2f37fe9a3030aa97ca86067a56ba3f9d3565f9a791b305c7355d8392c30d91b", size = 293266, upload-time = "2024-07-21T19:35:20.207Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/3c/60/eccdd92dd4af3e4bea6d6a342f7588c618a15b9bec4b968af581e498bcc4/pypdf-4.3.1-py3-none-any.whl", hash = "sha256:64b31da97eda0771ef22edb1bfecd5deee4b72c3d1736b7df2689805076d6418", size = 295825, upload-time = "2024-07-21T19:35:18.126Z" }, -] - [[package]] name = "pyreadline3" version = "3.5.4" @@ -4631,14 +4609,14 @@ wheels = [ [[package]] name = "pytest-asyncio" -version = "0.26.0" +version = "0.24.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "pytest" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/8e/c4/453c52c659521066969523e87d85d54139bbd17b78f09532fb8eb8cdb58e/pytest_asyncio-0.26.0.tar.gz", hash = "sha256:c4df2a697648241ff39e7f0e4a73050b03f123f760673956cf0d72a4990e312f", size = 54156, upload-time = "2025-03-25T06:22:28.883Z" } +sdist = { url = "https://files.pythonhosted.org/packages/52/6d/c6cf50ce320cf8611df7a1254d86233b3df7cc07f9b5f5cbcb82e08aa534/pytest_asyncio-0.24.0.tar.gz", hash = "sha256:d081d828e576d85f875399194281e92bf8a68d60d72d1a2faf2feddb6c46b276", size = 49855, upload-time = "2024-08-22T08:03:18.145Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/20/7f/338843f449ace853647ace35870874f69a764d251872ed1b4de9f234822c/pytest_asyncio-0.26.0-py3-none-any.whl", hash = "sha256:7b51ed894f4fbea1340262bdae5135797ebbe21d8638978e35d31c6d19f72fb0", size = 19694, upload-time = "2025-03-25T06:22:27.807Z" }, + { url = "https://files.pythonhosted.org/packages/96/31/6607dab48616902f76885dfcf62c08d929796fc3b2d2318faf9fd54dbed9/pytest_asyncio-0.24.0-py3-none-any.whl", hash = "sha256:a811296ed596b69bf0b6f3dc40f83bcaf341b155a269052d82efa2b25ac7037b", size = 18024, upload-time = "2024-08-22T08:03:15.536Z" }, ] [[package]] @@ -5579,7 +5557,7 @@ dev = [ requires-dist = [ { name = "common-module", editable = "modules/common_module" }, { name = "datasource", editable = "plugins/datasource" }, - { name = "flo-ai", specifier = "==1.1.3" }, + { name = "flo-ai", specifier = "==1.1.4" }, { name = "flo-cloud", editable = "packages/flo_cloud" }, { name = "knowledge-base-module", editable = "modules/knowledge_base_module" }, { name = "plugins-module", editable = "modules/plugins_module" }, @@ -5596,10 +5574,10 @@ name = "torch" version = "2.8.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "filelock", marker = "sys_platform != 'darwin'" }, - { name = "fsspec", marker = "sys_platform != 'darwin'" }, - { name = "jinja2", marker = "sys_platform != 'darwin'" }, - { name = "networkx", marker = "sys_platform != 'darwin'" }, + { name = "filelock" }, + { name = "fsspec" }, + { name = "jinja2" }, + { name = "networkx" }, { name = "nvidia-cublas-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, { name = "nvidia-cuda-cupti-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, { name = "nvidia-cuda-nvrtc-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, @@ -5614,10 +5592,10 @@ dependencies = [ { name = "nvidia-nccl-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, { name = "nvidia-nvjitlink-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, { name = "nvidia-nvtx-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, - { name = "setuptools", marker = "python_full_version >= '3.12' and sys_platform != 'darwin'" }, - { name = "sympy", marker = "sys_platform != 'darwin'" }, + { name = "setuptools", marker = "python_full_version >= '3.12'" }, + { name = "sympy" }, { name = "triton", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, - { name = "typing-extensions", marker = "sys_platform != 'darwin'" }, + { name = "typing-extensions" }, ] wheels = [ { url = "https://files.pythonhosted.org/packages/8f/c4/3e7a3887eba14e815e614db70b3b529112d1513d9dae6f4d43e373360b7f/torch-2.8.0-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:220a06fd7af8b653c35d359dfe1aaf32f65aa85befa342629f716acb134b9710", size = 102073391, upload-time = "2025-08-06T14:53:20.937Z" },