Skip to main content
Glama

Unstructured API MCP Server

Official
{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "7de0b69d1a7608c3", "metadata": {}, "outputs": [], "source": [ "from pathlib import Path\n", "import os\n", "\n", "# Set working directory at top level or repository\n", "os.chdir(Path.cwd().parent)" ] }, { "cell_type": "code", "execution_count": 2, "id": "a246652d70073480", "metadata": {}, "outputs": [], "source": [ "from minimal_client.client import MCPClient" ] }, { "cell_type": "code", "execution_count": 3, "id": "ffae6980b63ca672", "metadata": {}, "outputs": [], "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 anthropic model, chunk by title chunking with 1050 characters split size and embedding with azure_openai model. Then execute workflow.\n", "\"\"\"" ] }, { "cell_type": "code", "execution_count": 4, "id": "d3bcb7cfbc3e613a", "metadata": {}, "outputs": [ { "data": { "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" ], "text/plain": [ "\n", "\u001b[1;32mQuery\u001b[0m (q/quit to end chat): " ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdin", "output_type": "stream", "text": [ " 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 anthropic model, chunk by title chunking with 1050 characters split size and embedding with azure_openai model. Then execute workflow.\n" ] }, { "data": { "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" ], "text/plain": [ "\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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, create the S3 source connector with the given name and URI\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>. Then create the S3 destination connector\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>. Create a custom workflow with VLM partitioning, chunking, and embedding\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span>. Execute the workflow\n", "\n", "Let's start:\n", "\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>. Creating the S3 source connector:\n", "</pre>\n" ], "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, create the S3 source connector with the given name and URI\n", "\u001b[1;36m2\u001b[0m. Then create the S3 destination connector\n", "\u001b[1;36m3\u001b[0m. Create a custom workflow with VLM partitioning, chunking, and embedding\n", "\u001b[1;36m4\u001b[0m. Execute the workflow\n", "\n", "Let's start:\n", "\n", "\u001b[1;36m1\u001b[0m. Creating the S3 source connector:\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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_source_connector with args {'name': 'MyExampleSourceS3-2', 'source_type': 's3', \n", "'type_specific_config': {'remote_url': '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" ], "text/plain": [ "\n", "\u001b[1;36mTOOL CALL\u001b[0m\n", "Accept execution of create_source_connector with args {'name': 'MyExampleSourceS3-2', 'source_type': 's3', \n", "'type_specific_config': {'remote_url': 's3://crag-protected-but-non-sensitive/pluto/example_input/'}}? \u001b[1;35m[y/n]\u001b[0m \u001b[1;36m(y)\u001b[0m: " ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdin", "output_type": "stream", "text": [ " y\n" ] }, { "data": { "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\">f8d095da-e948-440f-9c08-ad5a124431b1</span>\n", "\n", "</pre>\n" ], "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[93mf8d095da-e948-440f-9c08-ad5a124431b1\u001b[0m\n", "\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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>. Creating the S3 destination connector:\n", "</pre>\n" ], "text/plain": [ "\n", "\u001b[1;31mASSISTANT\u001b[0m\n", "\u001b[1;36m2\u001b[0m. Creating the S3 destination connector:\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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_destination_connector with args {'name': 'MyExampleDestinationS3-2', 'destination_type':\n", "'s3', 'type_specific_config': {'remote_url': 's3://crag-protected-but-non-sensitive/pluto/example_output/'}}? <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">[y/n]</span>\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">(y)</span>: </pre>\n" ], "text/plain": [ "\n", "\u001b[1;36mTOOL CALL\u001b[0m\n", "Accept execution of create_destination_connector with args {'name': 'MyExampleDestinationS3-2', 'destination_type':\n", "'s3', 'type_specific_config': {'remote_url': 's3://crag-protected-but-non-sensitive/pluto/example_output/'}}? \u001b[1;35m[y/n]\u001b[0m\n", "\u001b[1;36m(y)\u001b[0m: " ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdin", "output_type": "stream", "text": [ " y\n" ] }, { "data": { "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\">9a75e621-d24c-4aef-86d1-20067b2b8e58</span>\n", "\n", "</pre>\n" ], "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[93m9a75e621-d24c-4aef-86d1-20067b2b8e58\u001b[0m\n", "\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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, creating the custom workflow with the specified configuration:\n", "</pre>\n" ], "text/plain": [ "\n", "\u001b[1;31mASSISTANT\u001b[0m\n", "\u001b[1;36m3\u001b[0m. Now, creating the custom workflow with the specified configuration:\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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': 'f8d095da-e948-440f-9c08-ad5a124431b1', 'destination_id': \n", "'9a75e621-d24c-4aef-86d1-20067b2b8e58', 'workflow_nodes': [{'name': 'VLM-Partitioner', 'type': 'partition', \n", "'subtype': 'vlm', 'settings': {'provider': 'anthropic', 'model': 'claude-3-5-sonnet-20241022'}}, {'name': \n", "'Title-Chunker', 'type': 'chunk', 'subtype': 'chunk_by_title', 'settings': {'max_characters': 1050, \n", "'new_after_n_chars': 1050, 'overlap': 0}}, {'name': 'Azure-Embedder', '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" ], "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': 'f8d095da-e948-440f-9c08-ad5a124431b1', 'destination_id': \n", "'9a75e621-d24c-4aef-86d1-20067b2b8e58', 'workflow_nodes': [{'name': 'VLM-Partitioner', 'type': 'partition', \n", "'subtype': 'vlm', 'settings': {'provider': 'anthropic', 'model': 'claude-3-5-sonnet-20241022'}}, {'name': \n", "'Title-Chunker', 'type': 'chunk', 'subtype': 'chunk_by_title', 'settings': {'max_characters': 1050, \n", "'new_after_n_chars': 1050, 'overlap': 0}}, {'name': 'Azure-Embedder', '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: " ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdin", "output_type": "stream", "text": [ " y\n" ] }, { "data": { "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\">a1a6e2ba-e567-4978-b3ff-94eac54c794d</span>\n", "Status: active\n", "Type: custom\n", "\n", "Sources:\n", " - <span style=\"color: #ffff00; text-decoration-color: #ffff00\">f8d095da-e948-440f-9c08-ad5a124431b1</span>\n", "\n", "Workflow Nodes:\n", " - VLM-Partitioner <span style=\"font-weight: bold\">(</span>Type: partition<span style=\"font-weight: bold\">)</span> <span style=\"font-weight: bold\">(</span>Subtype: vlm<span style=\"font-weight: bold\">)</span>:\n", " Settings: <span style=\"font-weight: bold\">{</span>\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"provider\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"anthropic\"</span>,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"provider_api_key\"</span>: null,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"model\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"claude-3-5-sonnet-20241022\"</span>,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"output_format\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"text/html\"</span>,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"user_prompt\"</span>: null,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"format_html\"</span>: true,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"unique_element_ids\"</span>: true,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"is_dynamic\"</span>: false,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"allow_fast\"</span>: true\n", "<span style=\"font-weight: bold\">}</span>\n", " - Title-Chunker <span style=\"font-weight: bold\">(</span>Type: chunk<span style=\"font-weight: bold\">)</span> <span style=\"font-weight: bold\">(</span>Subtype: chunk_by_title<span style=\"font-weight: bold\">)</span>:\n", " Settings: <span style=\"font-weight: bold\">{</span>\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"unstructured_api_url\"</span>: null,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"unstructured_api_key\"</span>: null,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"multipage_sections\"</span>: false,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"combine_text_under_n_chars\"</span>: null,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"include_orig_elements\"</span>: false,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"new_after_n_chars\"</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1050</span>,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"max_characters\"</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1050</span>,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"overlap\"</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0</span>,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"overlap_all\"</span>: false,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"contextual_chunking_strategy\"</span>: null\n", "<span style=\"font-weight: bold\">}</span>\n", " - Azure-Embedder <span style=\"font-weight: bold\">(</span>Type: embed<span style=\"font-weight: bold\">)</span> <span style=\"font-weight: bold\">(</span>Subtype: azure_openai<span style=\"font-weight: bold\">)</span>:\n", " Settings: <span style=\"font-weight: bold\">{</span>\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"model_name\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"text-embedding-3-small\"</span>\n", "<span style=\"font-weight: bold\">}</span>\n", "\n", "Destinations:\n", " - <span style=\"color: #ffff00; text-decoration-color: #ffff00\">9a75e621-d24c-4aef-86d1-20067b2b8e58</span>\n", "\n", "Schedule:\n", " - No crontab entry\n", "\n", "</pre>\n" ], "text/plain": [ "\n", "\u001b[1;36mTOOL OUTPUT\u001b[0m:\n", "Workflow Information:\n", "Name: MycustomVLMandChunkingwithEmbedding\n", "ID: \u001b[93ma1a6e2ba-e567-4978-b3ff-94eac54c794d\u001b[0m\n", "Status: active\n", "Type: custom\n", "\n", "Sources:\n", " - \u001b[93mf8d095da-e948-440f-9c08-ad5a124431b1\u001b[0m\n", "\n", "Workflow Nodes:\n", " - VLM-Partitioner \u001b[1m(\u001b[0mType: partition\u001b[1m)\u001b[0m \u001b[1m(\u001b[0mSubtype: vlm\u001b[1m)\u001b[0m:\n", " Settings: \u001b[1m{\u001b[0m\n", " \u001b[32m\"provider\"\u001b[0m: \u001b[32m\"anthropic\"\u001b[0m,\n", " \u001b[32m\"provider_api_key\"\u001b[0m: null,\n", " \u001b[32m\"model\"\u001b[0m: \u001b[32m\"claude-3-5-sonnet-20241022\"\u001b[0m,\n", " \u001b[32m\"output_format\"\u001b[0m: \u001b[32m\"text/html\"\u001b[0m,\n", " \u001b[32m\"user_prompt\"\u001b[0m: null,\n", " \u001b[32m\"format_html\"\u001b[0m: true,\n", " \u001b[32m\"unique_element_ids\"\u001b[0m: true,\n", " \u001b[32m\"is_dynamic\"\u001b[0m: false,\n", " \u001b[32m\"allow_fast\"\u001b[0m: true\n", "\u001b[1m}\u001b[0m\n", " - Title-Chunker \u001b[1m(\u001b[0mType: chunk\u001b[1m)\u001b[0m \u001b[1m(\u001b[0mSubtype: chunk_by_title\u001b[1m)\u001b[0m:\n", " Settings: \u001b[1m{\u001b[0m\n", " \u001b[32m\"unstructured_api_url\"\u001b[0m: null,\n", " \u001b[32m\"unstructured_api_key\"\u001b[0m: null,\n", " \u001b[32m\"multipage_sections\"\u001b[0m: false,\n", " \u001b[32m\"combine_text_under_n_chars\"\u001b[0m: null,\n", " \u001b[32m\"include_orig_elements\"\u001b[0m: false,\n", " \u001b[32m\"new_after_n_chars\"\u001b[0m: \u001b[1;36m1050\u001b[0m,\n", " \u001b[32m\"max_characters\"\u001b[0m: \u001b[1;36m1050\u001b[0m,\n", " \u001b[32m\"overlap\"\u001b[0m: \u001b[1;36m0\u001b[0m,\n", " \u001b[32m\"overlap_all\"\u001b[0m: false,\n", " \u001b[32m\"contextual_chunking_strategy\"\u001b[0m: null\n", "\u001b[1m}\u001b[0m\n", " - Azure-Embedder \u001b[1m(\u001b[0mType: embed\u001b[1m)\u001b[0m \u001b[1m(\u001b[0mSubtype: azure_openai\u001b[1m)\u001b[0m:\n", " Settings: \u001b[1m{\u001b[0m\n", " \u001b[32m\"model_name\"\u001b[0m: \u001b[32m\"text-embedding-3-small\"\u001b[0m\n", "\u001b[1m}\u001b[0m\n", "\n", "Destinations:\n", " - \u001b[93m9a75e621-d24c-4aef-86d1-20067b2b8e58\u001b[0m\n", "\n", "Schedule:\n", " - No crontab entry\n", "\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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>. Now, let's execute the workflow:\n", "</pre>\n" ], "text/plain": [ "\n", "\u001b[1;31mASSISTANT\u001b[0m\n", "\u001b[1;36m4\u001b[0m. Now, let's execute the workflow:\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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': 'a1a6e2ba-e567-4978-b3ff-94eac54c794d'}? <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" ], "text/plain": [ "\n", "\u001b[1;36mTOOL CALL\u001b[0m\n", "Accept execution of run_workflow with args {'workflow_id': 'a1a6e2ba-e567-4978-b3ff-94eac54c794d'}? \u001b[1;35m[y/n]\u001b[0m \u001b[1;36m(y)\u001b[0m: " ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdin", "output_type": "stream", "text": [ " y\n" ] }, { "data": { "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" ], "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" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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 tasks:\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 embedding\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span>. Executed the workflow\n", "\n", "The workflow has been initiated successfully. You can monitor its progress using the workflow ID: \n", "<span style=\"color: #ffff00; text-decoration-color: #ffff00\">a1a6e2ba-e567-4978-b3ff-94eac54c794d</span>\n", "\n", "Would you like me to help you check the status of the workflow or assist with anything else?\n", "</pre>\n" ], "text/plain": [ "\n", "\u001b[1;31mASSISTANT\u001b[0m\n", "I've completed all the requested tasks:\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 embedding\n", "\u001b[1;36m4\u001b[0m. Executed the workflow\n", "\n", "The workflow has been initiated successfully. You can monitor its progress using the workflow ID: \n", "\u001b[93ma1a6e2ba-e567-4978-b3ff-94eac54c794d\u001b[0m\n", "\n", "Would you like me to help you check the status of the workflow or assist with anything else?\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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" ], "text/plain": [ "\n", "\u001b[1;32mQuery\u001b[0m (q/quit to end chat): " ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdin", "output_type": "stream", "text": [ " y\n" ] }, { "data": { "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" ], "text/plain": [ "\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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 check the status of the workflow and its associated job. Let me retrieve that information:\n", "</pre>\n" ], "text/plain": [ "\n", "\u001b[1;31mASSISTANT\u001b[0m\n", "I'll help you check the status of the workflow and its associated job. Let me retrieve that information:\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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 get_workflow_info with args {'workflow_id': 'a1a6e2ba-e567-4978-b3ff-94eac54c794d'}? <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" ], "text/plain": [ "\n", "\u001b[1;36mTOOL CALL\u001b[0m\n", "Accept execution of get_workflow_info with args {'workflow_id': 'a1a6e2ba-e567-4978-b3ff-94eac54c794d'}? \u001b[1;35m[y/n]\u001b[0m \u001b[1;36m(y)\u001b[0m:" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdin", "output_type": "stream", "text": [ " y\n" ] }, { "data": { "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\">a1a6e2ba-e567-4978-b3ff-94eac54c794d</span>\n", "Status: active\n", "Type: custom\n", "\n", "Sources:\n", " - <span style=\"color: #ffff00; text-decoration-color: #ffff00\">f8d095da-e948-440f-9c08-ad5a124431b1</span>\n", "\n", "Workflow Nodes:\n", " - VLM-Partitioner <span style=\"font-weight: bold\">(</span>Type: partition<span style=\"font-weight: bold\">)</span> <span style=\"font-weight: bold\">(</span>Subtype: vlm<span style=\"font-weight: bold\">)</span>:\n", " Settings: <span style=\"font-weight: bold\">{</span>\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"provider\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"anthropic\"</span>,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"provider_api_key\"</span>: null,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"model\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"claude-3-5-sonnet-20241022\"</span>,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"output_format\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"text/html\"</span>,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"user_prompt\"</span>: null,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"format_html\"</span>: true,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"unique_element_ids\"</span>: true,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"is_dynamic\"</span>: false,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"allow_fast\"</span>: true\n", "<span style=\"font-weight: bold\">}</span>\n", " - Title-Chunker <span style=\"font-weight: bold\">(</span>Type: chunk<span style=\"font-weight: bold\">)</span> <span style=\"font-weight: bold\">(</span>Subtype: chunk_by_title<span style=\"font-weight: bold\">)</span>:\n", " Settings: <span style=\"font-weight: bold\">{</span>\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"unstructured_api_url\"</span>: null,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"unstructured_api_key\"</span>: null,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"multipage_sections\"</span>: false,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"combine_text_under_n_chars\"</span>: null,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"include_orig_elements\"</span>: false,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"new_after_n_chars\"</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1050</span>,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"max_characters\"</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1050</span>,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"overlap\"</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0</span>,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"overlap_all\"</span>: false,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"contextual_chunking_strategy\"</span>: null\n", "<span style=\"font-weight: bold\">}</span>\n", " - Azure-Embedder <span style=\"font-weight: bold\">(</span>Type: embed<span style=\"font-weight: bold\">)</span> <span style=\"font-weight: bold\">(</span>Subtype: azure_openai<span style=\"font-weight: bold\">)</span>:\n", " Settings: <span style=\"font-weight: bold\">{</span>\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"model_name\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"text-embedding-3-small\"</span>\n", "<span style=\"font-weight: bold\">}</span>\n", "\n", "Destinations:\n", " - <span style=\"color: #ffff00; text-decoration-color: #ffff00\">9a75e621-d24c-4aef-86d1-20067b2b8e58</span>\n", "\n", "Schedule:\n", " - No crontab entry\n", "\n", "</pre>\n" ], "text/plain": [ "\n", "\u001b[1;36mTOOL OUTPUT\u001b[0m:\n", "Workflow Information:\n", "Name: MycustomVLMandChunkingwithEmbedding\n", "ID: \u001b[93ma1a6e2ba-e567-4978-b3ff-94eac54c794d\u001b[0m\n", "Status: active\n", "Type: custom\n", "\n", "Sources:\n", " - \u001b[93mf8d095da-e948-440f-9c08-ad5a124431b1\u001b[0m\n", "\n", "Workflow Nodes:\n", " - VLM-Partitioner \u001b[1m(\u001b[0mType: partition\u001b[1m)\u001b[0m \u001b[1m(\u001b[0mSubtype: vlm\u001b[1m)\u001b[0m:\n", " Settings: \u001b[1m{\u001b[0m\n", " \u001b[32m\"provider\"\u001b[0m: \u001b[32m\"anthropic\"\u001b[0m,\n", " \u001b[32m\"provider_api_key\"\u001b[0m: null,\n", " \u001b[32m\"model\"\u001b[0m: \u001b[32m\"claude-3-5-sonnet-20241022\"\u001b[0m,\n", " \u001b[32m\"output_format\"\u001b[0m: \u001b[32m\"text/html\"\u001b[0m,\n", " \u001b[32m\"user_prompt\"\u001b[0m: null,\n", " \u001b[32m\"format_html\"\u001b[0m: true,\n", " \u001b[32m\"unique_element_ids\"\u001b[0m: true,\n", " \u001b[32m\"is_dynamic\"\u001b[0m: false,\n", " \u001b[32m\"allow_fast\"\u001b[0m: true\n", "\u001b[1m}\u001b[0m\n", " - Title-Chunker \u001b[1m(\u001b[0mType: chunk\u001b[1m)\u001b[0m \u001b[1m(\u001b[0mSubtype: chunk_by_title\u001b[1m)\u001b[0m:\n", " Settings: \u001b[1m{\u001b[0m\n", " \u001b[32m\"unstructured_api_url\"\u001b[0m: null,\n", " \u001b[32m\"unstructured_api_key\"\u001b[0m: null,\n", " \u001b[32m\"multipage_sections\"\u001b[0m: false,\n", " \u001b[32m\"combine_text_under_n_chars\"\u001b[0m: null,\n", " \u001b[32m\"include_orig_elements\"\u001b[0m: false,\n", " \u001b[32m\"new_after_n_chars\"\u001b[0m: \u001b[1;36m1050\u001b[0m,\n", " \u001b[32m\"max_characters\"\u001b[0m: \u001b[1;36m1050\u001b[0m,\n", " \u001b[32m\"overlap\"\u001b[0m: \u001b[1;36m0\u001b[0m,\n", " \u001b[32m\"overlap_all\"\u001b[0m: false,\n", " \u001b[32m\"contextual_chunking_strategy\"\u001b[0m: null\n", "\u001b[1m}\u001b[0m\n", " - Azure-Embedder \u001b[1m(\u001b[0mType: embed\u001b[1m)\u001b[0m \u001b[1m(\u001b[0mSubtype: azure_openai\u001b[1m)\u001b[0m:\n", " Settings: \u001b[1m{\u001b[0m\n", " \u001b[32m\"model_name\"\u001b[0m: \u001b[32m\"text-embedding-3-small\"\u001b[0m\n", "\u001b[1m}\u001b[0m\n", "\n", "Destinations:\n", " - \u001b[93m9a75e621-d24c-4aef-86d1-20067b2b8e58\u001b[0m\n", "\n", "Schedule:\n", " - No crontab entry\n", "\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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", "Let me also check the associated jobs for this workflow:\n", "</pre>\n" ], "text/plain": [ "\n", "\u001b[1;31mASSISTANT\u001b[0m\n", "Let me also check the associated jobs for this workflow:\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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_jobs with args {'workflow_id': 'a1a6e2ba-e567-4978-b3ff-94eac54c794d'}? <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" ], "text/plain": [ "\n", "\u001b[1;36mTOOL CALL\u001b[0m\n", "Accept execution of list_jobs with args {'workflow_id': 'a1a6e2ba-e567-4978-b3ff-94eac54c794d'}? \u001b[1;35m[y/n]\u001b[0m \u001b[1;36m(y)\u001b[0m: " ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdin", "output_type": "stream", "text": [ " q\n" ] }, { "data": { "text/html": [ "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #800000; text-decoration-color: #800000\">Please enter Y or N</span>\n", "</pre>\n" ], "text/plain": [ "\u001b[31mPlease enter Y or N\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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_jobs with args {'workflow_id': 'a1a6e2ba-e567-4978-b3ff-94eac54c794d'}? <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" ], "text/plain": [ "\n", "\u001b[1;36mTOOL CALL\u001b[0m\n", "Accept execution of list_jobs with args {'workflow_id': 'a1a6e2ba-e567-4978-b3ff-94eac54c794d'}? \u001b[1;35m[y/n]\u001b[0m \u001b[1;36m(y)\u001b[0m: " ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdin", "output_type": "stream", "text": [ " n\n" ] }, { "data": { "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 in checking the jobs list. Let's try to list all recent jobs to find the status of your \n", "workflow:\n", "</pre>\n" ], "text/plain": [ "\n", "\u001b[1;31mASSISTANT\u001b[0m\n", "I apologize for the error in checking the jobs list. Let's try to list all recent jobs to find the status of your \n", "workflow:\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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_jobs 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" ], "text/plain": [ "\n", "\u001b[1;36mTOOL CALL\u001b[0m\n", "Accept execution of list_jobs with args {}? \u001b[1;35m[y/n]\u001b[0m \u001b[1;36m(y)\u001b[0m: " ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdin", "output_type": "stream", "text": [ " n\n" ] }, { "data": { "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 difficulties in retrieving the job status. From what we can see, the workflow is still active \n", "and properly configured with all your specified settings:\n", "- Source connector <span style=\"font-weight: bold\">(</span>S3<span style=\"font-weight: bold\">)</span>: <span style=\"color: #ffff00; text-decoration-color: #ffff00\">f8d095da-e948-440f-9c08-ad5a124431b1</span>\n", "- Destination connector <span style=\"font-weight: bold\">(</span>S3<span style=\"font-weight: bold\">)</span>: <span style=\"color: #ffff00; text-decoration-color: #ffff00\">9a75e621-d24c-4aef-86d1-20067b2b8e58</span>\n", "- VLM partitioning with Anthropic's Claude model\n", "- Title-based chunking with <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1050</span> character limit\n", "- Azure OpenAI embedding\n", "\n", "Would you like me to:\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>. Try another way to check the job status\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>. Make any modifications to the workflow\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>. Run the workflow again\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span>. Something else?\n", "\n", "Please let me know what you'd like to do next.\n", "</pre>\n" ], "text/plain": [ "\n", "\u001b[1;31mASSISTANT\u001b[0m\n", "I apologize for the difficulties in retrieving the job status. From what we can see, the workflow is still active \n", "and properly configured with all your specified settings:\n", "- Source connector \u001b[1m(\u001b[0mS3\u001b[1m)\u001b[0m: \u001b[93mf8d095da-e948-440f-9c08-ad5a124431b1\u001b[0m\n", "- Destination connector \u001b[1m(\u001b[0mS3\u001b[1m)\u001b[0m: \u001b[93m9a75e621-d24c-4aef-86d1-20067b2b8e58\u001b[0m\n", "- VLM partitioning with Anthropic's Claude model\n", "- Title-based chunking with \u001b[1;36m1050\u001b[0m character limit\n", "- Azure OpenAI embedding\n", "\n", "Would you like me to:\n", "\u001b[1;36m1\u001b[0m. Try another way to check the job status\n", "\u001b[1;36m2\u001b[0m. Make any modifications to the workflow\n", "\u001b[1;36m3\u001b[0m. Run the workflow again\n", "\u001b[1;36m4\u001b[0m. Something else?\n", "\n", "Please let me know what you'd like to do next.\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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" ], "text/plain": [ "\n", "\u001b[1;32mQuery\u001b[0m (q/quit to end chat): " ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdin", "output_type": "stream", "text": [ " q\n" ] }, { "data": { "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" ], "text/plain": [ "\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "client = MCPClient()\n", "try:\n", " await client.connect_to_server(\"http://127.0.0.1:8080/sse\")\n", " await client.chat_loop()\n", "finally:\n", " await client.cleanup()" ] }, { "cell_type": "code", "execution_count": 5, "id": "f5cfb757798bca83", "metadata": {}, "outputs": [], "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", "\"\"\"" ] }, { "cell_type": "code", "execution_count": 6, "id": "79f3023cda1ec506", "metadata": {}, "outputs": [ { "data": { "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" ], "text/plain": [ "\n", "\u001b[1;32mQuery\u001b[0m (q/quit to end chat): " ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdin", "output_type": "stream", "text": [ " 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" ] }, { "data": { "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" ], "text/plain": [ "\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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", "into steps:\n", "\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>. First, I'll create a custom workflow with the following specifications:\n", "- Name: <span style=\"color: #008000; text-decoration-color: #008000\">\"Justhires\"</span>\n", "- Source ID from <span style=\"color: #008000; text-decoration-color: #008000\">'MyExampleSourceS3-2'</span>\n", "- Destination ID from <span style=\"color: #008000; text-decoration-color: #008000\">'MyExampleDestinationS3-2'</span>\n", "- A partitioner node using hi_res strategy with the specified settings\n", "- Workflow type: custom\n", "\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>. Then I'll execute the created workflow.\n", "\n", "Let me create the workflow:\n", "</pre>\n" ], "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", "into steps:\n", "\n", "\u001b[1;36m1\u001b[0m. First, I'll create a custom workflow with the following specifications:\n", "- Name: \u001b[32m\"Justhires\"\u001b[0m\n", "- Source ID from \u001b[32m'MyExampleSourceS3-2'\u001b[0m\n", "- Destination ID from \u001b[32m'MyExampleDestinationS3-2'\u001b[0m\n", "- A partitioner node using hi_res strategy with the specified settings\n", "- Workflow type: custom\n", "\n", "\u001b[1;36m2\u001b[0m. Then I'll execute the created workflow.\n", "\n", "Let me create the workflow:\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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', 'source_id': \n", "'MyExampleSourceS3-2', 'destination_id': 'MyExampleDestinationS3-2', 'workflow_type': 'custom', 'workflow_nodes': \n", "[{'name': '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" ], "text/plain": [ "\n", "\u001b[1;36mTOOL CALL\u001b[0m\n", "Accept execution of create_workflow with args {'workflow_config': {'name': 'Justhires', 'source_id': \n", "'MyExampleSourceS3-2', 'destination_id': 'MyExampleDestinationS3-2', 'workflow_type': 'custom', 'workflow_nodes': \n", "[{'name': '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: " ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdin", "output_type": "stream", "text": [ " y\n" ] }, { "data": { "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" ], "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" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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 values for the source and destination. Let me \n", "list the sources and destinations to get the correct IDs:\n", "</pre>\n" ], "text/plain": [ "\n", "\u001b[1;31mASSISTANT\u001b[0m\n", "I apologize for the error. It seems we need to get the actual UUID values for the source and destination. Let me \n", "list the sources and destinations to get the correct IDs:\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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 {'source_type': 's3'}? <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" ], "text/plain": [ "\n", "\u001b[1;36mTOOL CALL\u001b[0m\n", "Accept execution of list_sources with args {'source_type': 's3'}? \u001b[1;35m[y/n]\u001b[0m \u001b[1;36m(y)\u001b[0m: " ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdin", "output_type": "stream", "text": [ " y\n" ] }, { "data": { "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", "- cool conector <span style=\"font-weight: bold\">(</span>ID: <span style=\"color: #ffff00; text-decoration-color: #ffff00\">207ac389-d571-42c1-ba59-606121ff77e9</span><span style=\"font-weight: bold\">)</span>\n", "- MCPS3MegaSource <span style=\"font-weight: bold\">(</span>ID: <span style=\"color: #ffff00; text-decoration-color: #ffff00\">e852aaa4-10aa-43e6-afe3-33aafa147d9f</span><span style=\"font-weight: bold\">)</span>\n", "- MCPS3MegaSource <span style=\"font-weight: bold\">(</span>ID: <span style=\"color: #ffff00; text-decoration-color: #ffff00\">edca8aae-b6b3-449e-b5b0-e95db40f23f5</span><span style=\"font-weight: bold\">)</span>\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\">2568dccd-44ab-42b9-b636-8fd3293c94f3</span><span style=\"font-weight: bold\">)</span>\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\">6abe10ae-cff3-49a8-b4a6-263d0b63e2cc</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\">a9d79ca4-ff47-48e5-9481-776fd9c84041</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\">f8d095da-e948-440f-9c08-ad5a124431b1</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\">cf16e8c7-6994-41d3-84f9-865c55a34bad</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\">8db9508a-23a4-4bd0-8ea0-bef89c4326e1</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\">c0aa92e2-84aa-459f-b455-8111817946c7</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\">eef4534c-9cbc-4bee-b2c8-02215ae0a356</span><span style=\"font-weight: bold\">)</span>\n", "\n", "</pre>\n" ], "text/plain": [ "\n", "\u001b[1;36mTOOL OUTPUT\u001b[0m:\n", "Available sources:\n", "- cool conector \u001b[1m(\u001b[0mID: \u001b[93m207ac389-d571-42c1-ba59-606121ff77e9\u001b[0m\u001b[1m)\u001b[0m\n", "- MCPS3MegaSource \u001b[1m(\u001b[0mID: \u001b[93me852aaa4-10aa-43e6-afe3-33aafa147d9f\u001b[0m\u001b[1m)\u001b[0m\n", "- MCPS3MegaSource \u001b[1m(\u001b[0mID: \u001b[93medca8aae-b6b3-449e-b5b0-e95db40f23f5\u001b[0m\u001b[1m)\u001b[0m\n", "- MyExampleSourceS3-\u001b[1;36m1\u001b[0m \u001b[1m(\u001b[0mID: \u001b[93m2568dccd-44ab-42b9-b636-8fd3293c94f3\u001b[0m\u001b[1m)\u001b[0m\n", "- MyExampleSourceS3-\u001b[1;36m1\u001b[0m \u001b[1m(\u001b[0mID: \u001b[93m6abe10ae-cff3-49a8-b4a6-263d0b63e2cc\u001b[0m\u001b[1m)\u001b[0m\n", "- MyExampleSourceS3-\u001b[1;36m2\u001b[0m \u001b[1m(\u001b[0mID: \u001b[93ma9d79ca4-ff47-48e5-9481-776fd9c84041\u001b[0m\u001b[1m)\u001b[0m\n", "- MyExampleSourceS3-\u001b[1;36m2\u001b[0m \u001b[1m(\u001b[0mID: \u001b[93mf8d095da-e948-440f-9c08-ad5a124431b1\u001b[0m\u001b[1m)\u001b[0m\n", "- MyExampleSourceS3-\u001b[1;36m2\u001b[0m \u001b[1m(\u001b[0mID: \u001b[93mcf16e8c7-6994-41d3-84f9-865c55a34bad\u001b[0m\u001b[1m)\u001b[0m\n", "- MyExampleSourceS3-\u001b[1;36m2\u001b[0m \u001b[1m(\u001b[0mID: \u001b[93m8db9508a-23a4-4bd0-8ea0-bef89c4326e1\u001b[0m\u001b[1m)\u001b[0m\n", "- MyExampleSourceS3-\u001b[1;36m2\u001b[0m \u001b[1m(\u001b[0mID: \u001b[93mc0aa92e2-84aa-459f-b455-8111817946c7\u001b[0m\u001b[1m)\u001b[0m\n", "- MyExampleSourceS3-\u001b[1;36m2\u001b[0m \u001b[1m(\u001b[0mID: \u001b[93meef4534c-9cbc-4bee-b2c8-02215ae0a356\u001b[0m\u001b[1m)\u001b[0m\n", "\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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 {'destination_type': 's3'}? <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" ], "text/plain": [ "\n", "\u001b[1;36mTOOL CALL\u001b[0m\n", "Accept execution of list_destinations with args {'destination_type': 's3'}? \u001b[1;35m[y/n]\u001b[0m \u001b[1;36m(y)\u001b[0m: " ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdin", "output_type": "stream", "text": [ " y\n" ] }, { "data": { "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", "- MCPS3Dest <span style=\"font-weight: bold\">(</span>ID: <span style=\"color: #ffff00; text-decoration-color: #ffff00\">429be83b-cfc4-43e9-afac-adb1b179b115</span><span style=\"font-weight: bold\">)</span>\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\">5732bc45-1d61-4ab8-96ce-9828f5b97ed3</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\">4c02ae55-deed-4d61-9834-1d222fa95386</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\">9a75e621-d24c-4aef-86d1-20067b2b8e58</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\">02edcd8f-ff01-44b4-943b-38751f8906ee</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\">692cce21-4139-4e78-b8f6-cf5bfab98b7a</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\">d31b6e92-531b-480c-b971-a20b09c23d92</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\">835bb5ac-4ad0-40a7-86c6-cf56aaf862a8</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\">708335a0-6ca9-4fc6-bcc8-a6152e63f6ae</span><span style=\"font-weight: bold\">)</span>\n", "\n", "</pre>\n" ], "text/plain": [ "\n", "\u001b[1;36mTOOL OUTPUT\u001b[0m:\n", "Available destinations:\n", "- MCPS3Dest \u001b[1m(\u001b[0mID: \u001b[93m429be83b-cfc4-43e9-afac-adb1b179b115\u001b[0m\u001b[1m)\u001b[0m\n", "- MyExampleDestinationS3-\u001b[1;36m1\u001b[0m \u001b[1m(\u001b[0mID: \u001b[93m5732bc45-1d61-4ab8-96ce-9828f5b97ed3\u001b[0m\u001b[1m)\u001b[0m\n", "- MyExampleDestinationS3-\u001b[1;36m2\u001b[0m \u001b[1m(\u001b[0mID: \u001b[93m4c02ae55-deed-4d61-9834-1d222fa95386\u001b[0m\u001b[1m)\u001b[0m\n", "- MyExampleDestinationS3-\u001b[1;36m2\u001b[0m \u001b[1m(\u001b[0mID: \u001b[93m9a75e621-d24c-4aef-86d1-20067b2b8e58\u001b[0m\u001b[1m)\u001b[0m\n", "- MyExampleDestinationS3-\u001b[1;36m2\u001b[0m \u001b[1m(\u001b[0mID: \u001b[93m02edcd8f-ff01-44b4-943b-38751f8906ee\u001b[0m\u001b[1m)\u001b[0m\n", "- MyExampleDestinationS3-\u001b[1;36m2\u001b[0m \u001b[1m(\u001b[0mID: \u001b[93m692cce21-4139-4e78-b8f6-cf5bfab98b7a\u001b[0m\u001b[1m)\u001b[0m\n", "- MyExampleDestinationS3-\u001b[1;36m2\u001b[0m \u001b[1m(\u001b[0mID: \u001b[93md31b6e92-531b-480c-b971-a20b09c23d92\u001b[0m\u001b[1m)\u001b[0m\n", "- MyExampleDestinationS3-\u001b[1;36m2\u001b[0m \u001b[1m(\u001b[0mID: \u001b[93m835bb5ac-4ad0-40a7-86c6-cf56aaf862a8\u001b[0m\u001b[1m)\u001b[0m\n", "- MyExampleDestinationS3-\u001b[1;36m2\u001b[0m \u001b[1m(\u001b[0mID: \u001b[93m708335a0-6ca9-4fc6-bcc8-a6152e63f6ae\u001b[0m\u001b[1m)\u001b[0m\n", "\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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 <span style=\"font-weight: bold\">(</span>I'll use the most recent ones<span style=\"font-weight: bold\">)</span>:\n", "</pre>\n" ], "text/plain": [ "\n", "\u001b[1;31mASSISTANT\u001b[0m\n", "Now I'll create the workflow with the correct UUIDs \u001b[1m(\u001b[0mI'll use the most recent ones\u001b[1m)\u001b[0m:\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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', 'source_id': \n", "'eef4534c-9cbc-4bee-b2c8-02215ae0a356', 'destination_id': '708335a0-6ca9-4fc6-bcc8-a6152e63f6ae', 'workflow_type': \n", "'custom', 'workflow_nodes': [{'name': 'Partitioner', 'type': 'partition', 'subtype': 'unstructured_api', \n", "'settings': {'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> \n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">(y)</span>: </pre>\n" ], "text/plain": [ "\n", "\u001b[1;36mTOOL CALL\u001b[0m\n", "Accept execution of create_workflow with args {'workflow_config': {'name': 'Justhires', 'source_id': \n", "'eef4534c-9cbc-4bee-b2c8-02215ae0a356', 'destination_id': '708335a0-6ca9-4fc6-bcc8-a6152e63f6ae', 'workflow_type': \n", "'custom', 'workflow_nodes': [{'name': 'Partitioner', 'type': 'partition', 'subtype': 'unstructured_api', \n", "'settings': {'strategy': 'hi_res', 'include_page_breaks': True, 'extract_image_block_types': ['table']}}]}}? \u001b[1;35m[y/n]\u001b[0m \n", "\u001b[1;36m(y)\u001b[0m: " ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdin", "output_type": "stream", "text": [ " y\n" ] }, { "data": { "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\">9bc6090f-700c-4d42-983f-7f570a82ce3b</span>\n", "Status: active\n", "Type: custom\n", "\n", "Sources:\n", " - <span style=\"color: #ffff00; text-decoration-color: #ffff00\">eef4534c-9cbc-4bee-b2c8-02215ae0a356</span>\n", "\n", "Workflow Nodes:\n", " - Partitioner <span style=\"font-weight: bold\">(</span>Type: partition<span style=\"font-weight: bold\">)</span> <span style=\"font-weight: bold\">(</span>Subtype: unstructured_api<span style=\"font-weight: bold\">)</span>:\n", " Settings: <span style=\"font-weight: bold\">{</span>\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"strategy\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"hi_res\"</span>,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"include_page_breaks\"</span>: true,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"pdf_infer_table_structure\"</span>: false,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"exclude_elements\"</span>: null,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"xml_keep_tags\"</span>: false,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"encoding\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"utf-8\"</span>,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"ocr_languages\"</span>: <span style=\"font-weight: bold\">[</span>\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"eng\"</span>\n", " <span style=\"font-weight: bold\">]</span>,\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"extract_image_block_types\"</span>: <span style=\"font-weight: bold\">[</span>\n", " <span style=\"color: #008000; text-decoration-color: #008000\">\"table\"</span>\n", " <span style=\"font-weight: bold\">]</span>\n", "<span style=\"font-weight: bold\">}</span>\n", "\n", "Destinations:\n", " - <span style=\"color: #ffff00; text-decoration-color: #ffff00\">708335a0-6ca9-4fc6-bcc8-a6152e63f6ae</span>\n", "\n", "Schedule:\n", " - No crontab entry\n", "\n", "</pre>\n" ], "text/plain": [ "\n", "\u001b[1;36mTOOL OUTPUT\u001b[0m:\n", "Workflow Information:\n", "Name: Justhires\n", "ID: \u001b[93m9bc6090f-700c-4d42-983f-7f570a82ce3b\u001b[0m\n", "Status: active\n", "Type: custom\n", "\n", "Sources:\n", " - \u001b[93meef4534c-9cbc-4bee-b2c8-02215ae0a356\u001b[0m\n", "\n", "Workflow Nodes:\n", " - Partitioner \u001b[1m(\u001b[0mType: partition\u001b[1m)\u001b[0m \u001b[1m(\u001b[0mSubtype: unstructured_api\u001b[1m)\u001b[0m:\n", " Settings: \u001b[1m{\u001b[0m\n", " \u001b[32m\"strategy\"\u001b[0m: \u001b[32m\"hi_res\"\u001b[0m,\n", " \u001b[32m\"include_page_breaks\"\u001b[0m: true,\n", " \u001b[32m\"pdf_infer_table_structure\"\u001b[0m: false,\n", " \u001b[32m\"exclude_elements\"\u001b[0m: null,\n", " \u001b[32m\"xml_keep_tags\"\u001b[0m: false,\n", " \u001b[32m\"encoding\"\u001b[0m: \u001b[32m\"utf-8\"\u001b[0m,\n", " \u001b[32m\"ocr_languages\"\u001b[0m: \u001b[1m[\u001b[0m\n", " \u001b[32m\"eng\"\u001b[0m\n", " \u001b[1m]\u001b[0m,\n", " \u001b[32m\"extract_image_block_types\"\u001b[0m: \u001b[1m[\u001b[0m\n", " \u001b[32m\"table\"\u001b[0m\n", " \u001b[1m]\u001b[0m\n", "\u001b[1m}\u001b[0m\n", "\n", "Destinations:\n", " - \u001b[93m708335a0-6ca9-4fc6-bcc8-a6152e63f6ae\u001b[0m\n", "\n", "Schedule:\n", " - No crontab entry\n", "\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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! The workflow has been created successfully. Now, let's execute the workflow:\n", "</pre>\n" ], "text/plain": [ "\n", "\u001b[1;31mASSISTANT\u001b[0m\n", "Great! The workflow has been created successfully. Now, let's execute the workflow:\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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': '9bc6090f-700c-4d42-983f-7f570a82ce3b'}? <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" ], "text/plain": [ "\n", "\u001b[1;36mTOOL CALL\u001b[0m\n", "Accept execution of run_workflow with args {'workflow_id': '9bc6090f-700c-4d42-983f-7f570a82ce3b'}? \u001b[1;35m[y/n]\u001b[0m \u001b[1;36m(y)\u001b[0m: " ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdin", "output_type": "stream", "text": [ " y\n" ] }, { "data": { "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" ], "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" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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, include_page_breaks enabled, and\n", "table extraction for image blocks.\n", "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>. Executed the workflow.\n", "\n", "The workflow has been successfully created and execution has been initiated. You can monitor the progress of the \n", "workflow execution by checking the job status using the list_jobs or get_job_info functions if needed. Would you \n", "like me to check the status of the workflow execution for you?\n", "</pre>\n" ], "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, include_page_breaks enabled, and\n", "table extraction for image blocks.\n", "\u001b[1;36m2\u001b[0m. Executed the workflow.\n", "\n", "The workflow has been successfully created and execution has been initiated. You can monitor the progress of the \n", "workflow execution by checking the job status using the list_jobs or get_job_info functions if needed. Would you \n", "like me to check the status of the workflow execution for you?\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "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" ], "text/plain": [ "\n", "\u001b[1;32mQuery\u001b[0m (q/quit to end chat): " ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdin", "output_type": "stream", "text": [ " q\n" ] }, { "data": { "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" ], "text/plain": [ "\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "client = MCPClient()\n", "try:\n", " await client.connect_to_server(\"http://127.0.0.1:8080/sse\")\n", " await client.chat_loop()\n", "finally:\n", " await client.cleanup()\n" ] }, { "cell_type": "code", "execution_count": null, "id": "2064644d-9e1e-45dd-aa77-76cdf1a00625", "metadata": {}, "outputs": [], "source": [] } ], "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 }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Unstructured-IO/UNS-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server