update deps

This commit is contained in:
Logan Markewich
2026-03-03 09:43:44 -06:00
parent cc61aaaa80
commit 557f51956c
3 changed files with 2136 additions and 1190 deletions
+29 -6
View File
@@ -2,8 +2,8 @@ import click
import os
from mcp.server.fastmcp import Context, FastMCP
from llama_cloud_services import LlamaExtract
from llama_index.indices.managed.llama_cloud import LlamaCloudIndex
from llama_cloud import AsyncLlamaCloud
from llama_cloud.lib.index import LlamaCloudIndex
from typing import Awaitable, Callable, Optional
@@ -39,13 +39,36 @@ def make_extract_tool(
await ctx.info(
f"Extracting data using agent: {agent_name} with file path: {file_path}"
)
llama_extract = LlamaExtract(
client = AsyncLlamaCloud()
# Find the extraction agent by name
agents = await client.extraction.extraction_agents.list(
organization_id=org_id,
project_id=project_id,
)
extract_agent = llama_extract.get_agent(name=agent_name)
result = await extract_agent.aextract(file_path)
return str(result)
agent_id = None
for agent in agents:
if agent.name == agent_name:
agent_id = agent.id
break
if agent_id is None:
raise ValueError(f"Extraction agent '{agent_name}' not found")
# Upload file
file_obj = await client.files.create(
file=file_path,
purpose="extract",
)
# Extract and wait for result
result = await client.extraction.jobs.extract(
extraction_agent_id=agent_id,
file_id=file_obj.id,
)
return str(result.data)
except Exception as e:
await ctx.error(f"Error extracting data: {str(e)}")
return f"Error extracting data: {str(e)}"
+3 -5
View File
@@ -14,11 +14,10 @@ description = "Expose LlamaCloud services as MCP tools"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"llama-index-indices-managed-llama-cloud>=0.6.9",
"llama-cloud>=1.0",
"llama-index-core>=0.12.0",
"mcp[cli]>=1.6.0",
"python-dotenv>=1.1.0",
"llama-index-tools-mcp>=0.1.0",
"llama-cloud-services",
"click"
]
license = "MIT"
@@ -31,8 +30,7 @@ keywords = [
"mcp",
"llama",
"llamacloud",
"llama-cloud",
"llama-cloud-services"
"llama-cloud"
]
[project.scripts]
Generated
+2104 -1179
View File
File diff suppressed because it is too large Load Diff