Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions ai/palette-mcp/integrate-palette-mcp/agents/tagging_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from pydantic import BaseModel

from tools import tag_cluster_for_review, tag_cluster_profile_for_review
from helpers import suppress_console_output

TAGGING_SYSTEM_PROMPT = (
"You are a cluster tagging specialist. "
Expand Down Expand Up @@ -52,7 +52,7 @@ class TaggingOutput(BaseModel):
notes: str


# async def initialize_tagging_agent(model: str) -> Any:
# async def initialize_tagging_agent(model: str, mcp_tools: list) -> Any:
# from langchain.agents import create_agent
# from langchain_openai import ChatOpenAI

Expand All @@ -62,7 +62,7 @@ class TaggingOutput(BaseModel):
# llm = ChatOpenAI(model=model)
# return create_agent(
# model=llm,
# tools=[tag_cluster_for_review, tag_cluster_profile_for_review],
# tools=mcp_tools,
# system_prompt=TAGGING_SYSTEM_PROMPT,
# response_format=TaggingOutput,
# checkpointer=InMemorySaver(),
Expand All @@ -75,6 +75,7 @@ class TaggingOutput(BaseModel):
# profile_discovery_output: str,
# active_cluster_output: str,
# tags: list[str],
# debug_level: str,
# run_id: str,
# ) -> str:
# if not tags:
Expand All @@ -99,20 +100,22 @@ class TaggingOutput(BaseModel):
# "Task:\n"
# "1) Extract unique cluster UIDs from active_clusters_using_matched_profiles.\n"
# "2) Extract unique cluster profile UIDs and scope values from matched_profiles.\n"
# f"3) For each cluster UID, call tag_cluster_for_review with cluster_uid=<uid> and tags={tags}.\n"
# f"4) For each cluster profile UID, call tag_cluster_profile_for_review with cluster_profile_uid=<uid> and tags={tags}, only if scope is not 'system'.\n"
# f"3) For each cluster UID, call manage_resource_tags with action='create', resource_type='spectroclusters', uid=<uid>, tags={tags}.\n"
# f"4) For each cluster profile UID, call manage_resource_tags with action='create', resource_type='clusterprofiles', uid=<uid>, tags={tags}, only if scope is not 'system'.\n"
# "5) For scope='system' profiles, skip tagging and record skip reason.\n"
# "6) Return a response that conforms to this JSON schema:\n"
# f"{schema}\n"
# "If there are no resources to tag, return empty arrays and explain in notes."
# )
# hide_mcp_output = debug_level != "verbose"
# run_config = {
# "configurable": {"thread_id": f"tagging:{pack_name.lower()}:{run_id}"}
# }
# result = await agent.ainvoke(
# {"messages": [{"role": "user", "content": tagging_prompt}]},
# config=run_config,
# )
# with suppress_console_output(hide_mcp_output):
# result = await agent.ainvoke(
# {"messages": [{"role": "user", "content": tagging_prompt}]},
# config=run_config,
# )
# structured = result.get("structured_response")
# if isinstance(structured, TaggingOutput):
# return structured.model_dump_json()
Expand Down
3 changes: 2 additions & 1 deletion ai/palette-mcp/integrate-palette-mcp/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def parse_args() -> argparse.Namespace:
# model=args.active_cluster_model,
# mcp_tools=mcp_tools,
# )
# tagging_agent = await initialize_tagging_agent(model=args.tagging_model)
# tagging_agent = await initialize_tagging_agent(model=args.tagging_model, mcp_tools=mcp_tools)
# reporter_agent = await initialize_reporter_agent(model=args.reporter_model)

# if is_debug_enabled(debug_level, "debug"):
Expand Down Expand Up @@ -175,6 +175,7 @@ def parse_args() -> argparse.Namespace:
# profile_discovery_output,
# active_cluster_output,
# user_tags,
# debug_level,
# run_id,
# )
# )
Expand Down
210 changes: 0 additions & 210 deletions ai/palette-mcp/integrate-palette-mcp/tools.py

This file was deleted.