Unstructured API MCP Server

Official
{ "cells": [ { "cell_type": "code", "id": "dd74d3ac5677b80a", "metadata": { "ExecuteTime": { "end_time": "2025-03-21T14:21:04.737564Z", "start_time": "2025-03-21T14:21:04.735273Z" } }, "source": [ "from pathlib import Path\n", "import os\n", "\n", "# Set working directory at top level or repository\n", "os.chdir(Path.cwd().parent)" ], "outputs": [], "execution_count": 1 }, { "cell_type": "code", "id": "775df9f8644b052b", "metadata": { "ExecuteTime": { "end_time": "2025-03-21T14:21:05.071455Z", "start_time": "2025-03-21T14:21:04.741301Z" } }, "source": "from minimal_client.client import MCPClient", "outputs": [], "execution_count": 2 }, { "metadata": { "ExecuteTime": { "end_time": "2025-03-21T14:21:07.772629Z", "start_time": "2025-03-21T14:21:07.770364Z" } }, "cell_type": "code", "source": [ "query = \"\"\"\n", "Hello, I would like you to create: a new S3 source connector and S3 destination connector. Call them 'MyExampleSourceS3-2' and 'MyExampleDestinationS3-2' respectively. S3 uri is 's3://crag-protected-but-non-sensitive/pluto/example_input/' and 's3://crag-protected-but-non-sensitive/pluto/example_output/'. Workflow should be called 'MycustomVLMandChunkingwithEmbedding'. I want VLM strategy with antrhopic model, chunk by title chunking with 1050 characters split size and embedding with azure_openai model. Then execute workflow.\n", "\"\"\"" ], "id": "initial_id", "outputs": [], "execution_count": 3 }, { "cell_type": "code", "id": "d529fb28-cb57-49bd-86e0-93bcd8da8318", "metadata": { "ExecuteTime": { "end_time": "2025-03-21T14:22:01.275503Z", "start_time": "2025-03-21T14:21:08.040560Z" } }, "source": [ "client = MCPClient()\n", "try:\n", " await client.connect_to_server('uns_mcp/server.py')\n", " await client.chat_loop()\n", "finally:\n", " await client.cleanup()" ], "outputs": [ { "data": { "text/plain": [ "\n", "\u001B[1;32mQuery\u001B[0m (q/quit to end chat): " ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold\">Query</span> (q/quit to end chat): </pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;31mASSISTANT\u001B[0m\n", "I'll help you create the connectors, set up the custom workflow, and execute it. Let's break this down into steps:\n", "\n", "\u001B[1;36m1\u001B[0m. First, let's create the S3 source connector:\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">ASSISTANT</span>\n", "I'll help you create the connectors, set up the custom workflow, and execute it. Let's break this down into steps:\n", "\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>. First, let's create the S3 source connector:\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;36mTOOL CALL\u001B[0m\n", "Accept execution of create_s3_source with args {'name': 'MyExampleSourceS3-2', 'remote_url': \n", "'s3://crag-protected-but-non-sensitive/pluto/example_input/'}? \u001B[1;35m[y/n]\u001B[0m \u001B[1;36m(y)\u001B[0m: " ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">TOOL CALL</span>\n", "Accept execution of create_s3_source with args {'name': 'MyExampleSourceS3-2', 'remote_url': \n", "'s3://crag-protected-but-non-sensitive/pluto/example_input/'}? <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">[y/n]</span> <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">(y)</span>: </pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;36mTOOL OUTPUT\u001B[0m:\n", "S3 Source Connector Created:\n", "Name: MyExampleSourceS3-\u001B[1;36m2\u001B[0m\n", "ID: \u001B[93m8629bcd4-e8dd-4dbb-af94-f57cd8eb112d\u001B[0m\n", "\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">TOOL OUTPUT</span>:\n", "S3 Source Connector Created:\n", "Name: MyExampleSourceS3-<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>\n", "ID: <span style=\"color: #ffff00; text-decoration-color: #ffff00\">8629bcd4-e8dd-4dbb-af94-f57cd8eb112d</span>\n", "\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;31mASSISTANT\u001B[0m\n", "\u001B[1;36m2\u001B[0m. Now, let's create the S3 destination connector:\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">ASSISTANT</span>\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>. Now, let's create the S3 destination connector:\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;36mTOOL CALL\u001B[0m\n", "Accept execution of create_s3_destination with args {'name': 'MyExampleDestinationS3-2', 'remote_url': \n", "'s3://crag-protected-but-non-sensitive/pluto/example_output/'}? \u001B[1;35m[y/n]\u001B[0m \u001B[1;36m(y)\u001B[0m: " ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">TOOL CALL</span>\n", "Accept execution of create_s3_destination with args {'name': 'MyExampleDestinationS3-2', 'remote_url': \n", "'s3://crag-protected-but-non-sensitive/pluto/example_output/'}? <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">[y/n]</span> <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">(y)</span>: </pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;36mTOOL OUTPUT\u001B[0m:\n", "S3 Destination Connector Created:\n", "Name: MyExampleDestinationS3-\u001B[1;36m2\u001B[0m\n", "ID: \u001B[93m6428e685-03b9-4f5b-bce4-a95415a0a1c8\u001B[0m\n", "\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">TOOL OUTPUT</span>:\n", "S3 Destination Connector Created:\n", "Name: MyExampleDestinationS3-<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>\n", "ID: <span style=\"color: #ffff00; text-decoration-color: #ffff00\">6428e685-03b9-4f5b-bce4-a95415a0a1c8</span>\n", "\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;31mASSISTANT\u001B[0m\n", "\u001B[1;36m3\u001B[0m. Now, let's create the custom workflow with VLM partitioning, chunking, and embedding:\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">ASSISTANT</span>\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>. Now, let's create the custom workflow with VLM partitioning, chunking, and embedding:\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;36mTOOL CALL\u001B[0m\n", "Accept execution of create_workflow with args {'workflow_config': {'name': 'MycustomVLMandChunkingwithEmbedding', \n", "'workflow_type': 'custom', 'source_id': '8629bcd4-e8dd-4dbb-af94-f57cd8eb112d', 'destination_id': \n", "'6428e685-03b9-4f5b-bce4-a95415a0a1c8', 'workflow_nodes': [{'name': 'VLMPartitioner', 'type': 'partition', \n", "'subtype': 'vlm', 'settings': {'provider': 'anthropic', 'model': 'claude-3-5-sonnet-20241022'}}, {'name': \n", "'TitleChunker', 'type': 'chunk', 'subtype': 'chunk_by_title', 'settings': {'max_characters': 1050, \n", "'new_after_n_chars': 1050, 'overlap': 0}}, {'name': 'AzureEmbedder', 'type': 'embed', 'subtype': 'azure_openai', \n", "'settings': {'model_name': 'text-embedding-3-small'}}]}}? \u001B[1;35m[y/n]\u001B[0m \u001B[1;36m(y)\u001B[0m: " ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">TOOL CALL</span>\n", "Accept execution of create_workflow with args {'workflow_config': {'name': 'MycustomVLMandChunkingwithEmbedding', \n", "'workflow_type': 'custom', 'source_id': '8629bcd4-e8dd-4dbb-af94-f57cd8eb112d', 'destination_id': \n", "'6428e685-03b9-4f5b-bce4-a95415a0a1c8', 'workflow_nodes': [{'name': 'VLMPartitioner', 'type': 'partition', \n", "'subtype': 'vlm', 'settings': {'provider': 'anthropic', 'model': 'claude-3-5-sonnet-20241022'}}, {'name': \n", "'TitleChunker', 'type': 'chunk', 'subtype': 'chunk_by_title', 'settings': {'max_characters': 1050, \n", "'new_after_n_chars': 1050, 'overlap': 0}}, {'name': 'AzureEmbedder', 'type': 'embed', 'subtype': 'azure_openai', \n", "'settings': {'model_name': 'text-embedding-3-small'}}]}}? <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">[y/n]</span> <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">(y)</span>: </pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;36mTOOL OUTPUT\u001B[0m:\n", "Workflow Information:\n", "Name: MycustomVLMandChunkingwithEmbedding\n", "ID: \u001B[93ma60fe36d-4a52-4a07-84d1-3b8c285138ce\u001B[0m\n", "Status: WorkflowState.ACTIVE\n", "Type: WorkflowType.CUSTOM\n", "\n", "Sources:\n", " - \u001B[93m8629bcd4-e8dd-4dbb-af94-f57cd8eb112d\u001B[0m\n", "\n", "Destinations:\n", " - \u001B[93m6428e685-03b9-4f5b-bce4-a95415a0a1c8\u001B[0m\n", "\n", "Schedule:\n", "\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">TOOL OUTPUT</span>:\n", "Workflow Information:\n", "Name: MycustomVLMandChunkingwithEmbedding\n", "ID: <span style=\"color: #ffff00; text-decoration-color: #ffff00\">a60fe36d-4a52-4a07-84d1-3b8c285138ce</span>\n", "Status: WorkflowState.ACTIVE\n", "Type: WorkflowType.CUSTOM\n", "\n", "Sources:\n", " - <span style=\"color: #ffff00; text-decoration-color: #ffff00\">8629bcd4-e8dd-4dbb-af94-f57cd8eb112d</span>\n", "\n", "Destinations:\n", " - <span style=\"color: #ffff00; text-decoration-color: #ffff00\">6428e685-03b9-4f5b-bce4-a95415a0a1c8</span>\n", "\n", "Schedule:\n", "\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;31mASSISTANT\u001B[0m\n", "\u001B[1;36m4\u001B[0m. Finally, let's execute the workflow:\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">ASSISTANT</span>\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span>. Finally, let's execute the workflow:\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;36mTOOL CALL\u001B[0m\n", "Accept execution of run_workflow with args {'workflow_id': 'a60fe36d-4a52-4a07-84d1-3b8c285138ce'}? \u001B[1;35m[y/n]\u001B[0m \u001B[1;36m(y)\u001B[0m: " ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">TOOL CALL</span>\n", "Accept execution of run_workflow with args {'workflow_id': 'a60fe36d-4a52-4a07-84d1-3b8c285138ce'}? <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">[y/n]</span> <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">(y)</span>: </pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;36mTOOL OUTPUT\u001B[0m:\n", "Workflow execution initiated: \u001B[1m<\u001B[0m\u001B[1;95mResponse\u001B[0m\u001B[39m \u001B[0m\u001B[1;39m[\u001B[0m\u001B[1;36m202\u001B[0m\u001B[39m Accepted\u001B[0m\u001B[1;39m]\u001B[0m\u001B[1m>\u001B[0m\n", "\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">TOOL OUTPUT</span>:\n", "Workflow execution initiated: <span style=\"font-weight: bold\">&lt;</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold\">Response</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">[</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">202</span><span style=\"color: #000000; text-decoration-color: #000000\"> Accepted</span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">]</span><span style=\"font-weight: bold\">&gt;</span>\n", "\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;31mASSISTANT\u001B[0m\n", "I've completed all the requested steps:\n", "\u001B[1;36m1\u001B[0m. Created an S3 source connector named \u001B[32m\"MyExampleSourceS3-2\"\u001B[0m\n", "\u001B[1;36m2\u001B[0m. Created an S3 destination connector named \u001B[32m\"MyExampleDestinationS3-2\"\u001B[0m\n", "\u001B[1;36m3\u001B[0m. Created a custom workflow named \u001B[32m\"MycustomVLMandChunkingwithEmbedding\"\u001B[0m with:\n", " - VLM partitioning using Anthropic's Claude model\n", " - Chunk by title strategy with \u001B[1;36m1050\u001B[0m character splits\n", " - Azure OpenAI embeddings\n", "\u001B[1;36m4\u001B[0m. Executed the workflow\n", "\n", "The workflow has been created and started successfully. You can monitor its progress using the list_jobs or \n", "get_job_info functions if needed.\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">ASSISTANT</span>\n", "I've completed all the requested steps:\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>. Created an S3 source connector named <span style=\"color: #008000; text-decoration-color: #008000\">\"MyExampleSourceS3-2\"</span>\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>. Created an S3 destination connector named <span style=\"color: #008000; text-decoration-color: #008000\">\"MyExampleDestinationS3-2\"</span>\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>. Created a custom workflow named <span style=\"color: #008000; text-decoration-color: #008000\">\"MycustomVLMandChunkingwithEmbedding\"</span> with:\n", " - VLM partitioning using Anthropic's Claude model\n", " - Chunk by title strategy with <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1050</span> character splits\n", " - Azure OpenAI embeddings\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span>. Executed the workflow\n", "\n", "The workflow has been created and started successfully. You can monitor its progress using the list_jobs or \n", "get_job_info functions if needed.\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;32mQuery\u001B[0m (q/quit to end chat): " ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold\">Query</span> (q/quit to end chat): </pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" } ], "execution_count": 4 }, { "metadata": { "ExecuteTime": { "end_time": "2025-03-21T14:22:05.110870Z", "start_time": "2025-03-21T14:22:05.108345Z" } }, "cell_type": "code", "source": [ "query = \"\"\"\n", "Hello, I would like you to create custom workflow. Source and Destination should be 'MyExampleSourceS3-2' and 'MyExampleDestinationS3-2' respectively (they already exist). Workflow should be called 'Justhires'. I want hires strategy with include_page_breaks and extract_image_block_types set to Tables. Then execute workflow.\n", "\"\"\"" ], "id": "1b5a1713f9b3d251", "outputs": [], "execution_count": 5 }, { "metadata": { "ExecuteTime": { "end_time": "2025-03-21T14:23:01.268127Z", "start_time": "2025-03-21T14:22:05.337707Z" } }, "cell_type": "code", "source": [ "client = MCPClient()\n", "try:\n", " await client.connect_to_server('uns_mcp/server.py')\n", " await client.chat_loop()\n", "finally:\n", " await client.cleanup()" ], "id": "4308a8c18d4fd620", "outputs": [ { "data": { "text/plain": [ "\n", "\u001B[1;32mQuery\u001B[0m (q/quit to end chat): " ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold\">Query</span> (q/quit to end chat): </pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;31mASSISTANT\u001B[0m\n", "I'll help you create a custom workflow with the specified parameters and then execute it. Let me break this down:\n", "\n", "\u001B[1;36m1\u001B[0m. First, I'll create a custom workflow with:\n", "- A name: \u001B[32m\"Justhires\"\u001B[0m\n", "- Source and destination IDs from the existing connectors\n", "- A partitioner node using hi_res strategy with the specified settings\n", "- Then I'll execute the created workflow\n", "\n", "Here's the workflow creation call:\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">ASSISTANT</span>\n", "I'll help you create a custom workflow with the specified parameters and then execute it. Let me break this down:\n", "\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>. First, I'll create a custom workflow with:\n", "- A name: <span style=\"color: #008000; text-decoration-color: #008000\">\"Justhires\"</span>\n", "- Source and destination IDs from the existing connectors\n", "- A partitioner node using hi_res strategy with the specified settings\n", "- Then I'll execute the created workflow\n", "\n", "Here's the workflow creation call:\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;36mTOOL CALL\u001B[0m\n", "Accept execution of create_workflow with args {'workflow_config': {'name': 'Justhires', 'workflow_type': 'custom', \n", "'source_id': 'MyExampleSourceS3-2', 'destination_id': 'MyExampleDestinationS3-2', 'workflow_nodes': [{'name': \n", "'Partitioner', 'type': 'partition', 'subtype': 'unstructured_api', 'settings': {'strategy': 'hi_res', \n", "'include_page_breaks': True, 'extract_image_block_types': ['table']}}]}}? \u001B[1;35m[y/n]\u001B[0m \u001B[1;36m(y)\u001B[0m: " ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">TOOL CALL</span>\n", "Accept execution of create_workflow with args {'workflow_config': {'name': 'Justhires', 'workflow_type': 'custom', \n", "'source_id': 'MyExampleSourceS3-2', 'destination_id': 'MyExampleDestinationS3-2', 'workflow_nodes': [{'name': \n", "'Partitioner', 'type': 'partition', 'subtype': 'unstructured_api', 'settings': {'strategy': 'hi_res', \n", "'include_page_breaks': True, 'extract_image_block_types': ['table']}}]}}? <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">[y/n]</span> <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">(y)</span>: </pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;36mTOOL OUTPUT\u001B[0m:\n", "Error creating workflow: \u001B[1m{\u001B[0m\u001B[32m\"detail\"\u001B[0m:\u001B[1m[\u001B[0m\u001B[1m{\u001B[0m\u001B[32m\"loc\"\u001B[0m:\u001B[1m[\u001B[0m\u001B[32m\"body\"\u001B[0m,\u001B[32m\"source_id\"\u001B[0m\u001B[1m]\u001B[0m,\u001B[32m\"msg\"\u001B[0m:\u001B[32m\"Input should be a valid UUID, invalid \u001B[0m\n", "\u001B[32mcharacter: expected an optional prefix of `urn:uuid:` followed by \u001B[0m\u001B[32m[\u001B[0m\u001B[32m0-9a-fA-F-\u001B[0m\u001B[32m]\u001B[0m\u001B[32m, found `M` at \u001B[0m\n", "\u001B[32m1\"\u001B[0m,\u001B[32m\"type\"\u001B[0m:\u001B[32m\"uuid_parsing\"\u001B[0m\u001B[1m}\u001B[0m,\u001B[1m{\u001B[0m\u001B[32m\"loc\"\u001B[0m:\u001B[1m[\u001B[0m\u001B[32m\"body\"\u001B[0m,\u001B[32m\"destination_id\"\u001B[0m\u001B[1m]\u001B[0m,\u001B[32m\"msg\"\u001B[0m:\u001B[32m\"Input should be a valid UUID, invalid character: \u001B[0m\n", "\u001B[32mexpected an optional prefix of `urn:uuid:` followed by \u001B[0m\u001B[32m[\u001B[0m\u001B[32m0-9a-fA-F-\u001B[0m\u001B[32m]\u001B[0m\u001B[32m, found `M` at 1\"\u001B[0m,\u001B[32m\"type\"\u001B[0m:\u001B[32m\"uuid_parsing\"\u001B[0m\u001B[1m}\u001B[0m\u001B[1m]\u001B[0m\u001B[1m}\u001B[0m\n", "\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">TOOL OUTPUT</span>:\n", "Error creating workflow: <span style=\"font-weight: bold\">{</span><span style=\"color: #008000; text-decoration-color: #008000\">\"detail\"</span>:<span style=\"font-weight: bold\">[{</span><span style=\"color: #008000; text-decoration-color: #008000\">\"loc\"</span>:<span style=\"font-weight: bold\">[</span><span style=\"color: #008000; text-decoration-color: #008000\">\"body\"</span>,<span style=\"color: #008000; text-decoration-color: #008000\">\"source_id\"</span><span style=\"font-weight: bold\">]</span>,<span style=\"color: #008000; text-decoration-color: #008000\">\"msg\"</span>:<span style=\"color: #008000; text-decoration-color: #008000\">\"Input should be a valid UUID, invalid </span>\n", "<span style=\"color: #008000; text-decoration-color: #008000\">character: expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found `M` at </span>\n", "<span style=\"color: #008000; text-decoration-color: #008000\">1\"</span>,<span style=\"color: #008000; text-decoration-color: #008000\">\"type\"</span>:<span style=\"color: #008000; text-decoration-color: #008000\">\"uuid_parsing\"</span><span style=\"font-weight: bold\">}</span>,<span style=\"font-weight: bold\">{</span><span style=\"color: #008000; text-decoration-color: #008000\">\"loc\"</span>:<span style=\"font-weight: bold\">[</span><span style=\"color: #008000; text-decoration-color: #008000\">\"body\"</span>,<span style=\"color: #008000; text-decoration-color: #008000\">\"destination_id\"</span><span style=\"font-weight: bold\">]</span>,<span style=\"color: #008000; text-decoration-color: #008000\">\"msg\"</span>:<span style=\"color: #008000; text-decoration-color: #008000\">\"Input should be a valid UUID, invalid character: </span>\n", "<span style=\"color: #008000; text-decoration-color: #008000\">expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found `M` at 1\"</span>,<span style=\"color: #008000; text-decoration-color: #008000\">\"type\"</span>:<span style=\"color: #008000; text-decoration-color: #008000\">\"uuid_parsing\"</span><span style=\"font-weight: bold\">}]}</span>\n", "\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;31mASSISTANT\u001B[0m\n", "I apologize for the error. It seems we need to get the actual UUID \u001B[1m(\u001B[0munique identifier\u001B[1m)\u001B[0m for your source and \n", "destination connectors first. Let me list the sources and destinations to get their correct IDs:\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">ASSISTANT</span>\n", "I apologize for the error. It seems we need to get the actual UUID <span style=\"font-weight: bold\">(</span>unique identifier<span style=\"font-weight: bold\">)</span> for your source and \n", "destination connectors first. Let me list the sources and destinations to get their correct IDs:\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;36mTOOL CALL\u001B[0m\n", "Accept execution of list_sources with args {}? \u001B[1;35m[y/n]\u001B[0m \u001B[1;36m(y)\u001B[0m: " ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">TOOL CALL</span>\n", "Accept execution of list_sources with args {}? <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">[y/n]</span> <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">(y)</span>: </pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;36mTOOL OUTPUT\u001B[0m:\n", "Available sources:\n", "- MyExampleSourceS3-\u001B[1;36m1\u001B[0m \u001B[1m(\u001B[0mID: \u001B[93me6882f0e-3e02-4099-aef9-72f63f8faf79\u001B[0m\u001B[1m)\u001B[0m\n", "- MyExampleSourceS3-\u001B[1;36m2\u001B[0m \u001B[1m(\u001B[0mID: \u001B[93m8629bcd4-e8dd-4dbb-af94-f57cd8eb112d\u001B[0m\u001B[1m)\u001B[0m\n", "\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">TOOL OUTPUT</span>:\n", "Available sources:\n", "- MyExampleSourceS3-<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span> <span style=\"font-weight: bold\">(</span>ID: <span style=\"color: #ffff00; text-decoration-color: #ffff00\">e6882f0e-3e02-4099-aef9-72f63f8faf79</span><span style=\"font-weight: bold\">)</span>\n", "- MyExampleSourceS3-<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span> <span style=\"font-weight: bold\">(</span>ID: <span style=\"color: #ffff00; text-decoration-color: #ffff00\">8629bcd4-e8dd-4dbb-af94-f57cd8eb112d</span><span style=\"font-weight: bold\">)</span>\n", "\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;36mTOOL CALL\u001B[0m\n", "Accept execution of list_destinations with args {}? \u001B[1;35m[y/n]\u001B[0m \u001B[1;36m(y)\u001B[0m: " ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">TOOL CALL</span>\n", "Accept execution of list_destinations with args {}? <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">[y/n]</span> <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">(y)</span>: </pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;36mTOOL OUTPUT\u001B[0m:\n", "Available destinations:\n", "- MyExampleDestinationS3-\u001B[1;36m1\u001B[0m \u001B[1m(\u001B[0mID: \u001B[93mf89b88e0-2c5b-4199-9f2a-fa7f5401b592\u001B[0m\u001B[1m)\u001B[0m\n", "- MyExampleDestinationS3-\u001B[1;36m2\u001B[0m \u001B[1m(\u001B[0mID: \u001B[93m6428e685-03b9-4f5b-bce4-a95415a0a1c8\u001B[0m\u001B[1m)\u001B[0m\n", "\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">TOOL OUTPUT</span>:\n", "Available destinations:\n", "- MyExampleDestinationS3-<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span> <span style=\"font-weight: bold\">(</span>ID: <span style=\"color: #ffff00; text-decoration-color: #ffff00\">f89b88e0-2c5b-4199-9f2a-fa7f5401b592</span><span style=\"font-weight: bold\">)</span>\n", "- MyExampleDestinationS3-<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span> <span style=\"font-weight: bold\">(</span>ID: <span style=\"color: #ffff00; text-decoration-color: #ffff00\">6428e685-03b9-4f5b-bce4-a95415a0a1c8</span><span style=\"font-weight: bold\">)</span>\n", "\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;31mASSISTANT\u001B[0m\n", "Now I'll create the workflow with the correct UUIDs:\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">ASSISTANT</span>\n", "Now I'll create the workflow with the correct UUIDs:\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;36mTOOL CALL\u001B[0m\n", "Accept execution of create_workflow with args {'workflow_config': {'name': 'Justhires', 'workflow_type': 'custom', \n", "'source_id': '8629bcd4-e8dd-4dbb-af94-f57cd8eb112d', 'destination_id': '6428e685-03b9-4f5b-bce4-a95415a0a1c8', \n", "'workflow_nodes': [{'name': 'Partitioner', 'type': 'partition', 'subtype': 'unstructured_api', 'settings': \n", "{'strategy': 'hi_res', 'include_page_breaks': True, 'extract_image_block_types': ['table']}}]}}? \u001B[1;35m[y/n]\u001B[0m \u001B[1;36m(y)\u001B[0m: " ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">TOOL CALL</span>\n", "Accept execution of create_workflow with args {'workflow_config': {'name': 'Justhires', 'workflow_type': 'custom', \n", "'source_id': '8629bcd4-e8dd-4dbb-af94-f57cd8eb112d', 'destination_id': '6428e685-03b9-4f5b-bce4-a95415a0a1c8', \n", "'workflow_nodes': [{'name': 'Partitioner', 'type': 'partition', 'subtype': 'unstructured_api', 'settings': \n", "{'strategy': 'hi_res', 'include_page_breaks': True, 'extract_image_block_types': ['table']}}]}}? <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">[y/n]</span> <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">(y)</span>: </pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;36mTOOL OUTPUT\u001B[0m:\n", "Workflow Information:\n", "Name: Justhires\n", "ID: \u001B[93m53b7ff69-f0b5-4a5b-837e-4921bbe6ad4c\u001B[0m\n", "Status: WorkflowState.ACTIVE\n", "Type: WorkflowType.CUSTOM\n", "\n", "Sources:\n", " - \u001B[93m8629bcd4-e8dd-4dbb-af94-f57cd8eb112d\u001B[0m\n", "\n", "Destinations:\n", " - \u001B[93m6428e685-03b9-4f5b-bce4-a95415a0a1c8\u001B[0m\n", "\n", "Schedule:\n", "\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">TOOL OUTPUT</span>:\n", "Workflow Information:\n", "Name: Justhires\n", "ID: <span style=\"color: #ffff00; text-decoration-color: #ffff00\">53b7ff69-f0b5-4a5b-837e-4921bbe6ad4c</span>\n", "Status: WorkflowState.ACTIVE\n", "Type: WorkflowType.CUSTOM\n", "\n", "Sources:\n", " - <span style=\"color: #ffff00; text-decoration-color: #ffff00\">8629bcd4-e8dd-4dbb-af94-f57cd8eb112d</span>\n", "\n", "Destinations:\n", " - <span style=\"color: #ffff00; text-decoration-color: #ffff00\">6428e685-03b9-4f5b-bce4-a95415a0a1c8</span>\n", "\n", "Schedule:\n", "\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;31mASSISTANT\u001B[0m\n", "Great! Now that the workflow is created, let's execute it:\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">ASSISTANT</span>\n", "Great! Now that the workflow is created, let's execute it:\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;36mTOOL CALL\u001B[0m\n", "Accept execution of run_workflow with args {'workflow_id': '53b7ff69-f0b5-4a5b-837e-4921bbe6ad4c'}? \u001B[1;35m[y/n]\u001B[0m \u001B[1;36m(y)\u001B[0m: " ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">TOOL CALL</span>\n", "Accept execution of run_workflow with args {'workflow_id': '53b7ff69-f0b5-4a5b-837e-4921bbe6ad4c'}? <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">[y/n]</span> <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">(y)</span>: </pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;36mTOOL OUTPUT\u001B[0m:\n", "Workflow execution initiated: \u001B[1m<\u001B[0m\u001B[1;95mResponse\u001B[0m\u001B[39m \u001B[0m\u001B[1;39m[\u001B[0m\u001B[1;36m202\u001B[0m\u001B[39m Accepted\u001B[0m\u001B[1;39m]\u001B[0m\u001B[1m>\u001B[0m\n", "\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">TOOL OUTPUT</span>:\n", "Workflow execution initiated: <span style=\"font-weight: bold\">&lt;</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold\">Response</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">[</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">202</span><span style=\"color: #000000; text-decoration-color: #000000\"> Accepted</span><span style=\"color: #000000; text-decoration-color: #000000; font-weight: bold\">]</span><span style=\"font-weight: bold\">&gt;</span>\n", "\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;31mASSISTANT\u001B[0m\n", "Perfect! I've completed both tasks:\n", "\u001B[1;36m1\u001B[0m. Created a custom workflow named \u001B[32m\"Justhires\"\u001B[0m with the specified hi_res strategy settings\n", "\u001B[1;36m2\u001B[0m. Executed the workflow\n", "\n", "The workflow has been created and started executing. You can monitor the progress of this execution by checking the\n", "jobs associated with this workflow. Would you like me to help you check the status of the workflow execution?\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">ASSISTANT</span>\n", "Perfect! I've completed both tasks:\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>. Created a custom workflow named <span style=\"color: #008000; text-decoration-color: #008000\">\"Justhires\"</span> with the specified hi_res strategy settings\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>. Executed the workflow\n", "\n", "The workflow has been created and started executing. You can monitor the progress of this execution by checking the\n", "jobs associated with this workflow. Would you like me to help you check the status of the workflow execution?\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n", "\u001B[1;32mQuery\u001B[0m (q/quit to end chat): " ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "<span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold\">Query</span> (q/quit to end chat): </pre>\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "\n" ], "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", "</pre>\n" ] }, "metadata": {}, "output_type": "display_data" } ], "execution_count": 6 }, { "metadata": {}, "cell_type": "code", "outputs": [], "execution_count": null, "source": "", "id": "830cb6efec14b0f1" } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.3" } }, "nbformat": 4, "nbformat_minor": 5 }