diff --git a/flo_ai/flo_ai/arium/arium.py b/flo_ai/flo_ai/arium/arium.py index f88bbeba..4260baee 100644 --- a/flo_ai/flo_ai/arium/arium.py +++ b/flo_ai/flo_ai/arium/arium.py @@ -647,8 +647,11 @@ def _serialize_node_output(self, result: Any) -> Optional[str]: if isinstance(result, str): return result if isinstance(result, list): - parts = [self._serialize_node_output(item) for item in result] - return '\n'.join(p for p in parts if p) or None + # agent.run() returns conversation_history (all messages); take only + # the last item, which is the agent's own reply for this node. + if not result: + return None + return self._serialize_node_output(result[-1]) if hasattr(result, 'content'): return self._serialize_node_output(result.content) if hasattr(result, 'text'): diff --git a/flo_ai/pyproject.toml b/flo_ai/pyproject.toml index ebd46389..385865cf 100644 --- a/flo_ai/pyproject.toml +++ b/flo_ai/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "flo_ai" -version = "1.1.5" +version = "1.1.6" description = "A easy way to create structured AI agents" authors = [{ name = "rootflo", email = "engineering.tools@rootflo.ai" }] requires-python = ">=3.10,<4.0" diff --git a/flo_ai/setup.py b/flo_ai/setup.py index b6044b31..29a419ed 100644 --- a/flo_ai/setup.py +++ b/flo_ai/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name='flo-ai', - version='1.1.3', + version='1.1.6', author='Rootflo', description='Create composable AI agents', long_description=long_description, diff --git a/wavefront/client/src/components/InferencePopup.tsx b/wavefront/client/src/components/InferencePopup.tsx index 768f618d..b5cb8be7 100644 --- a/wavefront/client/src/components/InferencePopup.tsx +++ b/wavefront/client/src/components/InferencePopup.tsx @@ -243,6 +243,7 @@ const InferencePopup: React.FC = ({ onClose, renderModal = const imageMessage = { image_base64: imageBase64Content, mime_type: uploadedImage.mimeType, + file_name: uploadedImage.file.name, }; messageInputs.push(imageMessage); } diff --git a/wavefront/client/src/pages/apps/[appId]/agents/[id].tsx b/wavefront/client/src/pages/apps/[appId]/agents/[id].tsx index 8da647b4..af0e4319 100644 --- a/wavefront/client/src/pages/apps/[appId]/agents/[id].tsx +++ b/wavefront/client/src/pages/apps/[appId]/agents/[id].tsx @@ -416,6 +416,7 @@ const AgentDetail: React.FC = () => { const imageMessage = { image_base64: image.base64Content, mime_type: image.mimeType, + file_name: image.file.name, }; setChatHistory((prev) => [...prev, { role: 'user', content: imageMessage }]); conversationInputs.push({ diff --git a/wavefront/client/src/pages/apps/[appId]/workflows/[id].tsx b/wavefront/client/src/pages/apps/[appId]/workflows/[id].tsx index 61ec711a..084572db 100644 --- a/wavefront/client/src/pages/apps/[appId]/workflows/[id].tsx +++ b/wavefront/client/src/pages/apps/[appId]/workflows/[id].tsx @@ -369,6 +369,7 @@ const WorkflowDetail: React.FC = () => { const imageMessage = { image_base64: image.base64Content, mime_type: image.mimeType, + file_name: image.file.name, }; messageInputs.push({ role: 'user', content: imageMessage }); setChatHistory((prev) => [...prev, { role: 'user', content: imageMessage }]); @@ -379,6 +380,7 @@ const WorkflowDetail: React.FC = () => { const imageMessage = { image_base64: imageBase64Content, mime_type: uploadedImage.mimeType, + file_name: uploadedImage.file?.name, }; messageInputs.push({ role: 'user', content: imageMessage }); setChatHistory((prev) => [...prev, { role: 'user', content: imageMessage }]); diff --git a/wavefront/client/src/types/chat-message.ts b/wavefront/client/src/types/chat-message.ts index ce93846a..1500341e 100644 --- a/wavefront/client/src/types/chat-message.ts +++ b/wavefront/client/src/types/chat-message.ts @@ -2,6 +2,7 @@ export interface ImageContent { image_base64: string; mime_type?: string; + file_name?: string; } export interface DocumentContent { diff --git a/wavefront/server/modules/agents_module/agents_module/utils/input_processing_utils.py b/wavefront/server/modules/agents_module/agents_module/utils/input_processing_utils.py index 99854344..8600f683 100644 --- a/wavefront/server/modules/agents_module/agents_module/utils/input_processing_utils.py +++ b/wavefront/server/modules/agents_module/agents_module/utils/input_processing_utils.py @@ -43,6 +43,17 @@ def process_inference_inputs( elif input_item.get('role') == 'user': input_content = input_item.get('content', {}) if is_image_message(input_content): + # Inject filename as a text message before the image so + # agents can reference the original file name in their output. + file_name = input_content.get('file_name') + if file_name: + resolved_inputs.append( + UserMessage( + content=TextMessageContent( + text=f'The original filename of this image is: {file_name}' + ) + ) + ) # Extract image_bytes and mime_type from image_base64 try: data_url_pattern = r'^data:(image/[a-zA-Z0-9.+-]+);base64,(.+)$' diff --git a/wavefront/server/modules/agents_module/pyproject.toml b/wavefront/server/modules/agents_module/pyproject.toml index 6a8974e9..7287432a 100644 --- a/wavefront/server/modules/agents_module/pyproject.toml +++ b/wavefront/server/modules/agents_module/pyproject.toml @@ -13,7 +13,7 @@ dependencies = [ "flo-utils", "tools-module", "api-services-module", - "flo-ai==1.1.5", + "flo-ai==1.1.6", ] [tool.uv.sources] diff --git a/wavefront/server/modules/knowledge_base_module/pyproject.toml b/wavefront/server/modules/knowledge_base_module/pyproject.toml index c4647a4c..d3b1839d 100644 --- a/wavefront/server/modules/knowledge_base_module/pyproject.toml +++ b/wavefront/server/modules/knowledge_base_module/pyproject.toml @@ -17,7 +17,7 @@ dependencies = [ "pandas~=2.2.3", "ollama~=0.4.8", "textract~=1.6.5", - "flo-ai==1.1.5", + "flo-ai==1.1.6", "google-cloud-pubsub~=2.30.0", "boto3<=1.38.40", "pyyaml>=6.0.3,<7", diff --git a/wavefront/server/modules/tools_module/pyproject.toml b/wavefront/server/modules/tools_module/pyproject.toml index 53ec011d..82f285a7 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.5", + "flo-ai==1.1.6", "flo_cloud", "datasource", diff --git a/wavefront/server/uv.lock b/wavefront/server/uv.lock index e98c3566..eeab4060 100644 --- a/wavefront/server/uv.lock +++ b/wavefront/server/uv.lock @@ -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.5" }, + { name = "flo-ai", specifier = "==1.1.6" }, { name = "flo-cloud", editable = "packages/flo_cloud" }, { name = "flo-utils", editable = "packages/flo_utils" }, { name = "tools-module", editable = "modules/tools_module" }, @@ -1395,7 +1395,7 @@ wheels = [ [[package]] name = "flo-ai" -version = "1.1.5" +version = "1.1.6" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "aiohttp" }, @@ -1416,9 +1416,9 @@ dependencies = [ { name = "pymupdf" }, { name = "pyyaml" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/9f/62/8f273b22ff6bec6afda759dea689ce642ecd9bfa15b04451f6c28386ab69/flo_ai-1.1.5.tar.gz", hash = "sha256:8806300f8e5b76acb5e350d0c61884c93fa9da131fdda5f8b31ef1dd836153b5", size = 98607, upload-time = "2026-04-23T10:10:29.105Z" } +sdist = { url = "https://files.pythonhosted.org/packages/35/7c/7f49bcb57eeb3c4bb9347d4af361fa1dcd69b54f8fae1b7c6d15568463b2/flo_ai-1.1.6.tar.gz", hash = "sha256:9caf305ad2f42f09908242ea4ce1a30151675ce1d5138524874b228ca770b4ab", size = 98650, upload-time = "2026-04-24T09:29:23.306Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/65/f2/a097072ec253d8af111c4f50cd52180bfbb3509011d51cf2bc49b044758d/flo_ai-1.1.5-py3-none-any.whl", hash = "sha256:0725fa7870efb8c96a8dd340443e188347c42a7825145fa3ee9752272069af13", size = 126316, upload-time = "2026-04-23T10:10:30.652Z" }, + { url = "https://files.pythonhosted.org/packages/fb/0b/63e377ec033cab319f37eb078f99ba233366b9a8e7a1bc249e4807bb73dc/flo_ai-1.1.6-py3-none-any.whl", hash = "sha256:c3c8a87e98d079204b52ace030b68b3a3eb44b863c17f151e4c2118332f5814b", size = 126372, upload-time = "2026-04-24T09:29:21.724Z" }, ] [[package]] @@ -2590,7 +2590,7 @@ dev = [ requires-dist = [ { name = "boto3", specifier = "<=1.38.40" }, { name = "datasource", editable = "plugins/datasource" }, - { name = "flo-ai", specifier = "==1.1.5" }, + { name = "flo-ai", specifier = "==1.1.6" }, { name = "flo-cloud", editable = "packages/flo_cloud" }, { name = "google-cloud-pubsub", specifier = "~=2.30.0" }, { name = "numpy", specifier = ">=1.24,<2.0" }, @@ -5553,7 +5553,7 @@ dev = [ requires-dist = [ { name = "common-module", editable = "modules/common_module" }, { name = "datasource", editable = "plugins/datasource" }, - { name = "flo-ai", specifier = "==1.1.5" }, + { name = "flo-ai", specifier = "==1.1.6" }, { name = "flo-cloud", editable = "packages/flo_cloud" }, { name = "knowledge-base-module", editable = "modules/knowledge_base_module" }, { name = "plugins-module", editable = "modules/plugins_module" },